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

FIWARE.Question.Tech.Data.OrionContextBroker.How to make orion send notifications only when subscription condition is satisfied?

    Details

      Description

      Created question in FIWARE Q/A platform on 24-05-2016 at 12:05
      Please, ANSWER this question AT http://stackoverflow.com/questions/37410846/how-to-make-orion-send-notifications-only-when-subscription-condition-is-satisfi

      Question:
      How to make orion send notifications only when subscription condition is satisfied?

      Description:
      I have made this subscription but it notifies always a attribute is changed.

      curl --include \
      --header 'Content-Type: application/json' \
      --request POST \
      --data-binary '{
      "attrsFormat":"legacy",
      "description": "Day subscription",
      "subject": {
      "entities": [

      { "idPattern": "es-leon-.*", "type": "Event" }

      ],
      "condition": {
      "attrs": [
      "idEvent",
      "Title",
      "dFlag"
      ],
      "expression":

      { "q": "dFlag>0" }

      }
      },
      "notification": {
      "http":

      { "url" : "http://localhost:5050/notify" }

      ,
      "attrs": [
      "idEvent",
      "Title",
      "dFlag"
      ]
      }
      }' \
      'http://localhost:1026/v2/subscriptions'

      I want that orion notify when any attribute described in the condition is changed AND the condition is satisfied.

      Example I have in orion this entitys:

      Concert1 (idEvent=Mozart, Title=Mconcert, dFlag=1)
      Concert2 (idEvent=Salieri, Title=Sconcert, dFlag=0)

      I want that when I made a change to any attribute of Concert1, as the condition is satisfied, it will notify.
      In the case of Concert2, as the condition is not satisfied, it will not notify.

      Is it posible? what I have wrong in this subscription example?

      In the documentation do not said much:

      condition: Condition that will trigger the notification. It can have
      two optional properties:

      attrs: array of attribute names
      expression: an expression composed of q, georel, geometry and coords (see "List entities" operation above about this field).

      List entities

      q: A query expression, composed of a list of statements separated by ;, i.e. q=statement;statements;statement. See Simple Query Language specification. Example: temperature>40.

        Activity

        backlogmanager Backlog Manager created issue -
        Hide
        backlogmanager Backlog Manager added a comment -

        2016-05-24 15:05|CREATED monitor | # answers= 0, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2016-05-24 15:05|CREATED monitor | # answers= 0, accepted answer= False
        backlogmanager Backlog Manager made changes -
        Field Original Value New Value
        Component/s FIWARE-TECH-HELP [ 10278 ]
        backlogmanager Backlog Manager made changes -
        HD-Enabler Unknown [ 10910 ]
        HD-Chapter Unknown [ 10845 ]
        HD-Node Unknown [ 10852 ]
        mev Manuel Escriche made changes -
        HD-Enabler Unknown [ 10910 ] Orion [ 10875 ]
        backlogmanager Backlog Manager made changes -
        HD-Chapter Unknown [ 10845 ] Data [ 10838 ]
        backlogmanager Backlog Manager made changes -
        Assignee Fermín Galán [ fermin ]
        fermin Fermín Galán made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        fermin Fermín Galán made changes -
        Status In Progress [ 3 ] Impeded [ 10004 ]
        Hide
        fermin Fermín Galán added a comment -

        Impeded due to: waiting to user input

        Show
        fermin Fermín Galán added a comment - Impeded due to: waiting to user input
        fermin Fermín Galán made changes -
        Status Impeded [ 10004 ] In Progress [ 3 ]
        fermin Fermín Galán made changes -
        Status In Progress [ 3 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        backlogmanager Backlog Manager made changes -
        Summary [fiware-stackoverflow] How to make orion send notifications only when subscription condition is satisfied? FIWARE.Question.Tech.Data.OrionContextBroker.How to make orion send notifications only when subscription condition is satisfied?
        HD-Node Unknown [ 10852 ]
        fla Fernando Lopez made changes -
        Fix Version/s 2021 [ 12600 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        2d 20h 56m 1 Fermín Galán 27/May/16 12:03 PM
        In Progress In Progress Impeded Impeded
        2s 1 Fermín Galán 27/May/16 12:03 PM
        Impeded Impeded In Progress In Progress
        3d 1h 33m 1 Fermín Galán 30/May/16 1:36 PM
        In Progress In Progress Closed Closed
        4s 1 Fermín Galán 30/May/16 1:36 PM

          People

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

            Dates

            • Created:
              Updated:
              Resolved: