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

FIWARE.Question.Tech.FIWARE Orion, NGSIv2 subscription in attributes with structured values.

    Details

      Description

      Created question in FIWARE Q/A platform on 08-12-2020 at 14:12
      Please, ANSWER this question AT https://stackoverflow.com/questions/65200347/fiware-orion-ngsiv2-subscription-in-attributes-with-structured-values

      Question:
      FIWARE Orion, NGSIv2 subscription in attributes with structured values

      Description:
      I'm working with Orion Contex Broker and I need to receive notifications when a parameter in a structured attribute changes its value. An example:

      Subscription:

      curl -iX POST \
      --url 'http://localhost:1026/v2/subscriptions' \
      --header 'content-type: application/json' \
      --data '{
      "description":"Notify me of Store changes in street Address",
      "subject":{
      "entities":[

      { "idPattern":".*", "type":"Store" }

      ],
      "condition":

      { "attrs":[ "address.streetAddress" ] }

      },
      "notification":{
      "http":

      { "url":"http://localhost:3000/subscription/store-change" }

      }
      }'

      Create entity:

      curl -iX POST \
      --url 'http://localhost:1026/v2/op/update' \
      -H 'Content-Type: application/json' \
      -d '{
      "actionType":"append",
      "entities":[
      {
      "type":"Store",
      "id":"urn:ngsi-ld:Store:001",
      "address":{
      "type":"PostalAddress",
      "value":

      { "streetAddress":"Old", "addressRegion":"Berlin" }

      },
      "name":

      { "type":"Text", "value":"Bösebrücke Einkauf" }

      }
      ]
      }'

      Update the entity:

      curl -iX PATCH \
      --url 'http://localhost:1026/v2/entities/urn:ngsi-ld:Store:001/attrs' \
      -H 'Content-Type: application/json' \
      -d '{
      "address":{
      "type":"PostalAddress",
      "value":

      { "streetAddress":"Bornholmer" }

      }
      }'

      The expected result would be to receive a notification when the entity was created and update. Another possibility could be the "condition expressions". However one of kind: "q": "address.streetAddress!=$

      {previousValue}

      " is not implemented yet.

        Activity

        Hide
        backlogmanager Backlog Manager added a comment -

        2020-12-11 09:34|CREATED monitor | # answers= 0, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2020-12-11 09:34|CREATED monitor | # answers= 0, accepted answer= False
        Hide
        backlogmanager Backlog Manager added a comment -

        2020-12-28 12:49|UPDATED status: transition Answer| # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2020-12-28 12:49|UPDATED status: transition Answer| # answers= 1, accepted answer= True
        Hide
        backlogmanager Backlog Manager added a comment -

        2021-01-04 10:31|UPDATED status: transition Finish| # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2021-01-04 10:31|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: