Skip to content

Commit

Permalink
Revert "Insert context keys before compiling UI scripts (#4372)" (#4373)
Browse files Browse the repository at this point in the history
This reverts commit 6e6f000.

Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
  • Loading branch information
jimtng authored Sep 10, 2024
1 parent 53889cd commit 83b069d
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ protected void compileScript() throws ScriptException {
ScriptEngine scriptEngine = engine.get();
if (scriptEngine instanceof Compilable) {
logger.debug("Pre-compiling script of rule with UID '{}'", ruleUID);
setExecutionContext(scriptEngine, Map.of()); // JRuby script engine needs this before compiling
compiledScript = Optional.ofNullable(((Compilable) scriptEngine).compile(script));
}
}
Expand Down Expand Up @@ -212,7 +211,7 @@ protected void resetExecutionContext(ScriptEngine engine, Map<String, ?> context
try {
if (compiledScript.isPresent()) {
logger.debug("Executing pre-compiled script of rule with UID '{}'", ruleUID);
return compiledScript.get().eval();
return compiledScript.get().eval(engine.getContext());
}
logger.debug("Executing script of rule with UID '{}'", ruleUID);
return engine.eval(script);
Expand Down

0 comments on commit 83b069d

Please sign in to comment.