Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion CHANGES_NEXT_RELEASE
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Set Nodejs 10 as minimum version in packages.json (effectively removing Nodev8 from supported versions)
Add mongodb additional options (`ssl` and `extraArgs`) to be able to connect "MongoDB as a Cloud Service" (#859)
Add support for JEXL as expression language (#801)
Add support for JEXL as expression language (#801, #687)
16 changes: 14 additions & 2 deletions doc/expressionLanguage.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,15 @@ provisioning. The following example shows a device provisioning payload with def
"expression": "${@level / 100}"
},
{
"object_id": "tt",
"name": "temperature",
"name": "level",
"type": "Number"
},
{
"name": "latitude",
"type": "Number"
},
{
"name": "longitude",
"type": "Number"
}
]
Expand All @@ -62,6 +69,11 @@ Expression Language (see definition [below](#language-description)). In order fo
evaluated, all the expression patterns must be evaluatable (there must be a value in the measurement for all the
variables of all the expression patterns).

Note that you need to include in the provision operation all the attributes required as inputs for the expressions.
In this example, they are `level`, `latitude` and `longitude`. Otherwise the device sending the measures will get
`{"name":"ATTRIBUTE_NOT_FOUND","message":"Some of the attributes does not exist"}` when it sends some of these
and the expression will not be calculated.

The exact same syntax works for Configuration and Device provisioning.

### Variable values
Expand Down