diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-10-30 21:39:32 +1300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-30 21:39:32 +1300 |
commit | 6475bc9db3b1446bb90d2102003201db5611ddf0 (patch) | |
tree | c43d07825f153abd980bb3239227161952b3c500 /src/org | |
parent | 273a4b7ab23a66ddfdeb05f69edc21a970b6844c (diff) | |
parent | aa606dfd6159dc7e0d1ab35f656654db03c1cdec (diff) | |
download | traccar-server-6475bc9db3b1446bb90d2102003201db5611ddf0.tar.gz traccar-server-6475bc9db3b1446bb90d2102003201db5611ddf0.tar.bz2 traccar-server-6475bc9db3b1446bb90d2102003201db5611ddf0.zip |
Merge pull request #3617 from Abyss777/math_jexl
Map "Math" to Computed Attributes context
Diffstat (limited to 'src/org')
-rw-r--r-- | src/org/traccar/processing/ComputedAttributesHandler.java | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/org/traccar/processing/ComputedAttributesHandler.java b/src/org/traccar/processing/ComputedAttributesHandler.java index f1f371475..1e702d17f 100644 --- a/src/org/traccar/processing/ComputedAttributesHandler.java +++ b/src/org/traccar/processing/ComputedAttributesHandler.java @@ -20,6 +20,7 @@ import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.Arrays; import java.util.Collection; +import java.util.Collections; import java.util.HashSet; import java.util.Map; import java.util.Set; @@ -43,6 +44,7 @@ public class ComputedAttributesHandler extends BaseDataHandler { public ComputedAttributesHandler() { engine = new JexlEngine(); engine.setStrict(true); + engine.setFunctions(Collections.singletonMap("math", (Object) Math.class)); if (Context.getConfig() != null) { mapDeviceAttributes = Context.getConfig().getBoolean("processing.computedAttributes.deviceAttributes"); } |