Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add jexl example to ngsi payload #802

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions docs/usermanual.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Examples of these `ngsiv2` payloads are the following ones:
"id": "MyEntityId1",
"type": "MyEntityType1",
"attr1": { "type": "Text", "value": "MyAttr1Value"},
"attr2": { "type": "Text", "value": "MyAttr1Value"
"attr2": { "type": "Text", "value": "MyAttr1Value",
"metadata": {
"TimeInstant": {
"type": "DateTime",
Expand Down Expand Up @@ -212,7 +212,7 @@ Example of these `ngsild` payloads are the following ones:
},
...
]
````
```

(2) NGSI-LD single entity format:

Expand Down Expand Up @@ -264,6 +264,17 @@ Some additional considerations to take into account:
are include as NGSI-v2 metadata in the entity corresponding to the measure at Context Broker. Note IOTA doesn't
provide the `type` for that metadata, so the Context Broker applies
[a default type based in the metadata `value` JSON type](https://github.com/telefonicaid/fiware-orion/blob/master/doc/manuals/orion-api.md#partial-representations).
- JEXL expression take place after key-value payload transformation, i.e. (1) NGSI-v2 batch update example after key-value tranformation would be:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about reformulate it in this way:

Only attributes value are available in JEXL context. In other words, it is not possible to access to attribute type or metadata. In order to address to the attribute value when using it in a JEXL expression, it is only required to use the attribute name. For example, in order to use attr2 value from pervious example, the expression should be something like this: "expression":"'This is my'+attr2"

Makes sense?

```
{
"id": "MyEntityId1",
"type": "MyEntityType1",
"attr1": "MyAttr1Value",
"attr2": "MyAttr1Value"
}
```
So, there is no access to attribute's type or metadata.


##### SOAP-XML Measure reporting

Expand Down
Loading