From 0aa7d648f6b34d1121b936b274a8bd0c64eece24 Mon Sep 17 00:00:00 2001 From: Robert-96 Date: Fri, 12 Mar 2021 11:52:17 +0200 Subject: [PATCH] Fix issues where the global attributes were not executed correctly by ExecutionContext --- .../java/org/graphwalker/core/machine/ExecutionContext.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphwalker-core/src/main/java/org/graphwalker/core/machine/ExecutionContext.java b/graphwalker-core/src/main/java/org/graphwalker/core/machine/ExecutionContext.java index 32be78d55..c4b49c304 100644 --- a/graphwalker-core/src/main/java/org/graphwalker/core/machine/ExecutionContext.java +++ b/graphwalker-core/src/main/java/org/graphwalker/core/machine/ExecutionContext.java @@ -247,7 +247,7 @@ public void execute(Action action) { LOG.debug("Execute action: '{}' in model: '{}'", action.getScript(), getModel().getName()); Pattern pattern = Pattern.compile(REGEXP_GLOBAL); Matcher matcher = pattern.matcher(action.getScript()); - if (action.getScript().matches(REGEXP_GLOBAL)) { + if (matcher.find()) { globalExecutionEnvironment.eval("js", action.getScript().replaceAll(REGEXP_GLOBAL, "")); } else { executionEnvironment.eval("js", action.getScript());