Class ExecutableScript
java.lang.Object
org.finos.fluxnova.bpm.engine.impl.scripting.ExecutableScript
- Direct Known Subclasses:
CompiledExecutableScript,DynamicExecutableScript
Represents an executable script.
- Author:
- Daniel Meyer
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Objectevaluate(ScriptEngine scriptEngine, VariableScope variableScope, Bindings bindings) execute(ScriptEngine scriptEngine, VariableScope variableScope, Bindings bindings) Evaluates the script using the provided engine and bindingsprotected StringgetActivityIdExceptionMessage(VariableScope variableScope) The language in which the script is written.protected StringpreprocessScript(String script, VariableScope variableScope) Preprocesses a script before execution.
-
Field Details
-
language
The language of the script. Used to resolve theScriptEngine.
-
-
Constructor Details
-
ExecutableScript
-
-
Method Details
-
getLanguage
The language in which the script is written.- Returns:
- the language
-
execute
Evaluates the script using the provided engine and bindings
- Parameters:
scriptEngine- the script engine to use for evaluating the script.variableScope- the variable scope of the executionbindings- the bindings to use for evaluating the script.- Returns:
- the result of the script evaluation
- Throws:
ProcessEngineException- in case the script cannot be evaluated.
-
getActivityIdExceptionMessage
-
evaluate
protected abstract Object evaluate(ScriptEngine scriptEngine, VariableScope variableScope, Bindings bindings) -
preprocessScript
Preprocesses a script before execution.If script preprocessing is disabled, no preprocessor is configured, or the preprocessor returns
null, the original script is returned unchanged.If preprocessing fails with an exception, a warning is logged and the original script is returned as a safe fallback to ensure scripts continue to execute.
- Parameters:
script- the script text to preprocess; may benullvariableScope- the current execution context; may benull- Returns:
- the preprocessed script, or the original script if preprocessing is disabled,
not configured, returns
null, or fails with an exception
-