diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index 6e8aff872..74647a7d8 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -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) diff --git a/doc/expressionLanguage.md b/doc/expressionLanguage.md index 394c53aad..01ffe940c 100644 --- a/doc/expressionLanguage.md +++ b/doc/expressionLanguage.md @@ -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" } ] @@ -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