According to official documentation of Orion Context Broker NGSIv2 :
You can include filtering expressions in conditions. For example, to get notified not only if pressure changes, but if it changes within the range 700-800. This is an advanced topic, see the "Subscriptions" section in the NGSIv2 specification.
At NGSIv2 subscriptions there is no notifyConditions
such as NGSIv1 , it was replaced by subject.condition object:
condition
: Condition to trigger notifications. This field is optional and it may contain two properties, both optional:
attrs
: array of attribute names
expression
: an expression composed ofq
,mq
,georel
,geometry
andcoords
(see "List entities" operation above about this field)
When we use subject.condition.attrs
, it contains an array of attributes names, these names define the "triggering attributes", i.e. attributes that upon creation/change due to entity creation or update trigger the notification.
But, for subject.condition.expression
there is not example at official documentations.
Getting pieces of puzzle is possible to deduce :
- Is possible do combine
subject.condition.expression
andsubject.condition.attrs
. If I set and attribute different of expression,eg. attr foo with expression 'boo>10' what it will do ? Will this behave like anOR
orAND
? - Is possible to set multiple expressions. Will this behave like an
OR
orAND
?
It would be nice to have some examples of these more complex subscriptions combining the different ways of delimiting the entities in the subscription.
NOTE: This question is related to Orion Version 1.7.0+