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 ExpressionThe language of the script e.g.protected ExpressionThe name of the result variable to store the result of the script evaluation in the variableScope.protected StringThe 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.Builderwhich can be evaluated usingevaluateScriptRequest(ScriptEngineRequest.Builder).protected ObjectevaluateScript(ScriptingEngines scriptingEngines, ScriptEngineRequest request) protected ObjectevaluateScriptRequest(ScriptEngineRequest.Builder requestBuilder) protected abstract ScriptingEnginesvoidsetLanguage(Expression language) voidsetResultVariable(Expression resultVariable) voidvoidsetScript(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 tonullto null. -
script
The actual payload of the script in the given language. Mandatory. Must not be or evaluate tonullto 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.Builderwhich 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
-