[Backlogmanager] [FIWARE-JIRA] (HELP-13341) [fiware-stackoverflow] How to use attribute metadata token in Orion Context Broker notification custom payload (NGSIV2)?

Fernando Lopez (JIRA) jira-help-desk at jira.fiware.org
Tue Jan 16 16:27:00 CET 2018


     [ https://jira.fiware.org/browse/HELP-13341?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Fernando Lopez reassigned HELP-13341:
-------------------------------------

    Assignee: Fermín Galán

> [fiware-stackoverflow] How to use attribute metadata token in Orion Context Broker notification custom payload (NGSIV2)?
> ------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HELP-13341
>                 URL: https://jira.fiware.org/browse/HELP-13341
>             Project: Help-Desk
>          Issue Type: Monitor
>          Components: FIWARE-TECH-HELP
>            Reporter: Backlog Manager
>            Assignee: Fermín Galán
>              Labels: fiware, fiware-orion, publish-subscribe
>
> Created question in FIWARE Q/A platform on 16-08-2017 at 16:08
> {color: red}Please, ANSWER this question AT{color} 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 ?



--
This message was sent by Atlassian JIRA
(v6.4.1#64016)


More information about the Backlogmanager mailing list

You can get more information about our cookies and privacy policies clicking on the following links: Privacy policy   Cookies policy