Class AbstractScriptEvaluator
java.lang.Object
org.flowable.common.engine.impl.scripting.AbstractScriptEvaluator
- Direct Known Subclasses:
ScriptExecutionListener
,ScriptHttpHandler
,ScriptTaskListener
,ScriptTypeExecutionListener
,ScriptTypeTaskListener
Base class simplifying binding and evaluation of scriptable elements.
- Author:
- Rich Kroll, Joram Barrez, Arthur Hupka-Merle
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Expression
The language of the script e.g.protected Expression
The name of the result variable to store the result of the script evaluation in the variableScope.protected String
The actual payload of the script in the given language. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateScriptRequest
(VariableContainer variableContainer) Validates language and script and creates a pre-populatedScriptEngineRequest.Builder
which can be evaluated usingevaluateScriptRequest(ScriptEngineRequest.Builder)
.protected Object
evaluateScript
(ScriptingEngines scriptingEngines, ScriptEngineRequest request) protected Object
evaluateScriptRequest
(ScriptEngineRequest.Builder requestBuilder) protected abstract ScriptingEngines
void
setLanguage
(Expression language) void
setResultVariable
(Expression resultVariable) void
void
setScript
(Expression script) Sets the script as Expression for backwards compatibility.protected void
-
Field Details
-
language
The language of the script e.g. an Expression evaluating to javascript, juel, groovy, etc. Mandatory. Must not be or evaluate tonull
to null. -
script
The actual payload of the script in the given language. Mandatory. Must not be or evaluate tonull
to null. -
resultVariable
The name of the result variable to store the result of the script evaluation in the variableScope.
-
-
Constructor Details
-
AbstractScriptEvaluator
public AbstractScriptEvaluator() -
AbstractScriptEvaluator
-
-
Method Details
-
createScriptRequest
Validates language and script and creates a pre-populatedScriptEngineRequest.Builder
which can be evaluated usingevaluateScriptRequest(ScriptEngineRequest.Builder)
.- Returns:
- the ScriptEngineRequest builder instance for further population
-
evaluateScriptRequest
-
evaluateScript
-
validateParameters
protected void validateParameters() -
getScriptingEngines
-
setScript
-
setScript
Sets the script as Expression for backwards compatibility. Requires to for 'field' injection of scripts. Expression is not evaluated -
getScript
-
setLanguage
-
setResultVariable
-