org.camunda.bpm.engine.impl.scripting
Class ExecutableScript

java.lang.Object
  extended by org.camunda.bpm.engine.impl.scripting.ExecutableScript
Direct Known Subclasses:
CompiledExecutableScript, DynamicExecutableScript

public abstract class ExecutableScript
extends Object

Represents an executable script.

Author:
Daniel Meyer

Field Summary
protected  String language
          The language of the script.
 
Constructor Summary
protected ExecutableScript(String language)
           
 
Method Summary
protected  List<Object> createDecisionOutputList(List<org.camunda.bpm.dmn.engine.DmnDecisionOutput> result)
           
protected abstract  Object evaluate(ScriptEngine scriptEngine, VariableScope variableScope, Bindings bindings)
           
 Object execute(ScriptEngine scriptEngine, VariableScope variableScope, Bindings bindings)
          Evaluates the script using the provided engine and bindings
 String getLanguage()
          The language in which the script is written.
protected  Object postProcessDmnResult(org.camunda.bpm.dmn.engine.DmnDecisionResult result)
           
 Object postProcessResult(Object result)
           
protected  Object unpackDecisionOutput(org.camunda.bpm.dmn.engine.DmnDecisionOutput output)
           
protected  Object unpackDecisionOutputs(org.camunda.bpm.dmn.engine.DmnDecisionResult result)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

language

protected final String language
The language of the script. Used to resolve the ScriptEngine.

Constructor Detail

ExecutableScript

protected ExecutableScript(String language)
Method Detail

getLanguage

public String getLanguage()
The language in which the script is written.

Returns:
the language

execute

public Object execute(ScriptEngine scriptEngine,
                      VariableScope variableScope,
                      Bindings bindings)

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 execution
bindings - the bindings to use for evaluating the script.
Returns:
the result of the script evaluation
Throws:
ProcessEngineException - in case the script cannot be evaluated.

evaluate

protected abstract Object evaluate(ScriptEngine scriptEngine,
                                   VariableScope variableScope,
                                   Bindings bindings)

postProcessResult

public Object postProcessResult(Object result)

postProcessDmnResult

protected Object postProcessDmnResult(org.camunda.bpm.dmn.engine.DmnDecisionResult result)

unpackDecisionOutput

protected Object unpackDecisionOutput(org.camunda.bpm.dmn.engine.DmnDecisionOutput output)

unpackDecisionOutputs

protected Object unpackDecisionOutputs(org.camunda.bpm.dmn.engine.DmnDecisionResult result)

createDecisionOutputList

protected List<Object> createDecisionOutputList(List<org.camunda.bpm.dmn.engine.DmnDecisionOutput> result)


Copyright © 2015 camunda services GmbH. All rights reserved.