Closed fgalan closed 1 month ago
The built-in attributes in https://github.com/telefonicaid/fiware-orion/blob/master/doc/manuals/orion-api.md#builtin-metadata could be included in the context:
In fact, adding previousValue
would solve issue https://github.com/telefonicaid/fiware-orion/issues/4560
For me 1) since JEXL provides great built in features to access JSON/Object data information and filtering.
After a brief internal discussion, let's go for alternative 1
Did you consider to use a "less usual name", like __metadata
to avoid unintentional collisions?
Did you consider to use a "less usual name", like
__metadata
to avoid unintentional collisions?
Maybe, but the syntax is more "dirty"...
Is any actual probability that some insane user :) names an attribute with the name metadata
?
Is your feature request related to a problem / use case? Please describe.
Adding attribute metadata context will enhance CB JEXL notification features. For instance, we could define a new attribute which value is the one in some metadata.
Describe the solution you'd like
Include attribute metadata in evaluation context at JEXL context building time.
Describe alternatives you've considered
Considering the following entity:
Alternative 1: use a
metadata
object, which keys would be attribute names. So evaluation context will be:Alternative 2: don't use an object, but a "flatten" of context identifiers, this way:
In both case, name collision could occur (i.e. new object
metadata
could collide if some attribute is namedmetatata
in alterative 1 and the same with attributes named eg.A__metadata__MD1
) but this would be very weird and an anti-pattern.Describe why you need this feature