Uploaded image for project: 'Help-Desk'
  1. Help-Desk
  2. HELP-13344

FIWARE.Question.Tech.How to create advanced subscriptions expression at Orion Context Broker NGSIv2?.

    Details

      Description

      Created question in FIWARE Q/A platform on 03-08-2017 at 19:08
      Please, ANSWER this question AT https://stackoverflow.com/questions/45490529/how-to-create-advanced-subscriptions-expression-at-orion-context-broker-ngsiv2

      Question:
      How to create advanced subscriptions expression at Orion Context Broker NGSIv2?

      Description:
      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 of q, mq, georel,
      geometry and coords (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 and subject.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 an OR or AND ?
      Is possible to set multiple expressions. Will this behave like an OR or AND ?

      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+

        Activity

        Hide
        backlogmanager Backlog Manager added a comment -

        2018-01-12 19:51|CREATED monitor | # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2018-01-12 19:51|CREATED monitor | # answers= 1, accepted answer= True
        Hide
        backlogmanager Backlog Manager added a comment -

        2018-01-12 19:54|UPDATED status: transition Answer| # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2018-01-12 19:54|UPDATED status: transition Answer| # answers= 1, accepted answer= True
        Hide
        backlogmanager Backlog Manager added a comment -

        2018-01-12 20:03|UPDATED status: transition Finish| # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2018-01-12 20:03|UPDATED status: transition Finish| # answers= 1, accepted answer= True

          People

          • Assignee:
            fermin Fermín Galán
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: