From 4059ea24221c8bd36af1c2fbe5d4d25a7318fda7 Mon Sep 17 00:00:00 2001 From: Kai Kreuzer Date: Wed, 16 Dec 2020 23:20:37 +0100 Subject: [PATCH] [automation] Correctly return the evaluation result of DSL scripts Fixes #1946 Signed-off-by: Kai Kreuzer --- .../model/script/runtime/internal/engine/DSLScriptEngine.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bundles/org.openhab.core.model.script.runtime/src/org/openhab/core/model/script/runtime/internal/engine/DSLScriptEngine.java b/bundles/org.openhab.core.model.script.runtime/src/org/openhab/core/model/script/runtime/internal/engine/DSLScriptEngine.java index 3b66218be..e9d55cc1f 100644 --- a/bundles/org.openhab.core.model.script.runtime/src/org/openhab/core/model/script/runtime/internal/engine/DSLScriptEngine.java +++ b/bundles/org.openhab.core.model.script.runtime/src/org/openhab/core/model/script/runtime/internal/engine/DSLScriptEngine.java @@ -122,11 +122,10 @@ public class DSLScriptEngine implements javax.script.ScriptEngine { s = scriptEngine.newScriptFromString(script); } IEvaluationContext evalContext = createEvaluationContext(s, specificContext); - s.execute(evalContext); + return s.execute(evalContext); } catch (ScriptExecutionException | ScriptParsingException e) { throw new ScriptException(e.getMessage(), modelName, -1); } - return null; } private DefaultEvaluationContext createEvaluationContext(Script script, IEvaluationContext specificContext) {