Skip to content

Commit d47127a

Browse files
authored
Merge pull request #845 from telefonicaid/fgalan-patch-1
FIX improve expression plugin documentation
2 parents 9319e7d + 31c0b02 commit d47127a

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

CHANGES_NEXT_RELEASE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Set Nodejs 10 as minimum version in packages.json (effectively removing Nodev8 from supported versions)
22
Add mongodb additional options (`ssl` and `extraArgs`) to be able to connect "MongoDB as a Cloud Service" (#859)
3-
Add support for JEXL as expression language (#801)
3+
Add support for JEXL as expression language (#801, #687)

doc/expressionLanguage.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,15 @@ provisioning. The following example shows a device provisioning payload with def
4646
"expression": "${@level / 100}"
4747
},
4848
{
49-
"object_id": "tt",
50-
"name": "temperature",
49+
"name": "level",
50+
"type": "Number"
51+
},
52+
{
53+
"name": "latitude",
54+
"type": "Number"
55+
},
56+
{
57+
"name": "longitude",
5158
"type": "Number"
5259
}
5360
]
@@ -62,6 +69,11 @@ Expression Language (see definition [below](#language-description)). In order fo
6269
evaluated, all the expression patterns must be evaluatable (there must be a value in the measurement for all the
6370
variables of all the expression patterns).
6471

72+
Note that you need to include in the provision operation all the attributes required as inputs for the expressions.
73+
In this example, they are `level`, `latitude` and `longitude`. Otherwise the device sending the measures will get
74+
`{"name":"ATTRIBUTE_NOT_FOUND","message":"Some of the attributes does not exist"}` when it sends some of these
75+
and the expression will not be calculated.
76+
6577
The exact same syntax works for Configuration and Device provisioning.
6678

6779
### Variable values

0 commit comments

Comments
 (0)