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

FIWARE.Question.Tech.How to use attribute metadata token in Orion Context Broker notification custom payload (NGSIV2)?.

    Details

      Description

      Created question in FIWARE Q/A platform on 16-08-2017 at 16:08
      Please, ANSWER this question AT https://stackoverflow.com/questions/45717033/how-to-use-attribute-metadata-token-in-orion-context-broker-notification-custom

      Question:
      How to use attribute metadata token in Orion Context Broker notification custom payload (NGSIV2)?

      Description:
      NGSIv2 clients can customize HTTP notification messages using a simple template mechanism.

      Considering the following notification notification.httpCustom object:

      "httpCustom": {
      "url": "http://foo.com/entity/$

      {id}

      ",
      "headers":

      { "Content-Type": "text/plain" }

      ,
      "method": "PUT",
      "qs": {
      "type": "$

      {type}

      "
      },
      "payload": "The temperature is $

      {temperature} degrees"
      }


      The token ${temperature}

      will be parsed by current context value.

      Thinking that attribute could have a metadata value could contain custom data like a temperature.scale, to store values of '°C' or '°F' for example. How can I print it in that message?

      Although attributes metadata there are 2 Special metadata in notifications:

      previousValue. The value of this metadata must be the previous value of the associated attribute. The type of this metadata must be
      the previous type of the associated attribute. If the type/value of
      previousValue is the same type/value than in the associated attribute,
      then the attribute has not actually changed its value.
      actionType. It is included if the attribute to which it is attached was included in the request that triggered the notification.
      Its value depends on the request operation type: update for updates,
      append for the creation and delete for deletion. Its type is always Text.

      The final result should be a message like that:

      The temperature is now -10 °C degrees before was 9.1 °C degrees

      Is it possible, who to use ?

        Activity

        fla Fernando Lopez made changes -
        Fix Version/s 2021 [ 12600 ]
        fla Fernando Lopez made changes -
        HD-Enabler Orion [ 10875 ]
        HD-Chapter Data [ 10838 ]
        backlogmanager Backlog Manager made changes -
        Summary [fiware-stackoverflow] How to use attribute metadata token in Orion Context Broker notification custom payload (NGSIV2)? FIWARE.Question.Tech.How to use attribute metadata token in Orion Context Broker notification custom payload (NGSIV2)?.
        fla Fernando Lopez made changes -
        Assignee Fermín Galán [ fermin ]
        backlogmanager Backlog Manager made changes -
        Resolution Done [ 10000 ]
        Status In Progress [ 3 ] Closed [ 6 ]
        backlogmanager Backlog Manager made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        backlogmanager Backlog Manager made changes -
        Field Original Value New Value
        Component/s FIWARE-TECH-HELP [ 10278 ]
        backlogmanager Backlog Manager created issue -

          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: