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

[fiware-stackoverflow] Why this orion subscription don't works as I want?

    Details

      Description

      Created question in FIWARE Q/A platform on 28-06-2016 at 14:06
      Please, ANSWER this question AT https://stackoverflow.com/questions/38076588/why-this-orion-subscription-dont-works-as-i-want

      Question:
      Why this orion subscription don't works as I want?

      Description:
      I have the following subscription in orion 1.2.1:

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

      { "idPattern": "event-.*", "type": "Event" }

      ],
      "condition": {
      "attrs": [
      "IdEvent",
      "mFlag"
      ],
      "expression":

      { "q": "mFlag>0" }

      }
      },
      "notification": {
      "attrsFormat":"legacy",
      "http":

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

      ,
      "attrs": [
      "IdEvent"
      ]
      }
      }' \
      'http://localhost:1026/v2/subscriptions'

      When I send an entity update like this one:

      curl --include \
      --request PATCH \
      --header "Content-Type: application/json" \
      --data-binary '{
      "mFlag":

      { "value":"5", "type":"int" }

      }' \
      'http://localhost:1026/v2/entities/event-2/attrs'

      Orion is not notifiying and it is making me crazy don't know what is wrong. Any idea?

      When I remove this part of the subscription:

      "expression": {
      "q": "mFlag>0"
      }

      it works but I need it to notify when any attribute is changed and the condition is satisfied.

        Activity

        Hide
        backlogmanager Backlog Manager added a comment -

        2017-05-22 15:13|CREATED monitor | # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2017-05-22 15:13|CREATED monitor | # answers= 1, accepted answer= True
        Hide
        backlogmanager Backlog Manager added a comment -

        2017-05-22 18:09|UPDATED status: transition Answer| # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2017-05-22 18:09|UPDATED status: transition Answer| # answers= 1, accepted answer= True
        Hide
        backlogmanager Backlog Manager added a comment -

        2017-05-22 21:09|UPDATED status: transition Finish| # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2017-05-22 21:09|UPDATED status: transition Finish| # answers= 1, accepted answer= True

          People

          • Assignee:
            backlogmanager Backlog Manager
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: