From aa606dfd6159dc7e0d1ab35f656654db03c1cdec Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Mon, 30 Oct 2017 13:27:24 +0500 Subject: Map "Math" to Computed Attributes context --- src/org/traccar/processing/ComputedAttributesHandler.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/org/traccar') 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"); } -- cgit v1.2.3