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

java.lang.Object
  extended by org.camunda.bpm.engine.impl.scripting.ExecutableScript
      extended by org.camunda.bpm.engine.impl.scripting.SourceExecutableScript
Direct Known Subclasses:
ResourceExecutableScript

public class SourceExecutableScript
extends ExecutableScript

A script which is provided as source code.

Author:
Daniel Meyer

Field Summary
protected  CompiledScript compiledScript
          The cached compiled script.
protected  String scriptSource
          The source of the script.
protected  boolean shouldBeCompiled
          Flag to signal if the script should be compiled
 
Fields inherited from class org.camunda.bpm.engine.impl.scripting.ExecutableScript
language
 
Constructor Summary
SourceExecutableScript(String language, String source)
           
 
Method Summary
protected  void compileScript()
           
protected  Object evaluateScript(ScriptEngine engine, Bindings bindings)
           
 Object execute(ScriptEngine engine, VariableScope variableScope, Bindings bindings)
          Evaluates the script using the provided engine and bindings
 CompiledScript getCompiledScript()
           
 String getScriptSource()
           
 boolean isShouldBeCompiled()
           
 void setScriptSource(String scriptSource)
          Sets the script source code.
 
Methods inherited from class org.camunda.bpm.engine.impl.scripting.ExecutableScript
getLanguage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

scriptSource

protected String scriptSource
The source of the script.


shouldBeCompiled

protected boolean shouldBeCompiled
Flag to signal if the script should be compiled


compiledScript

protected CompiledScript compiledScript
The cached compiled script.

Constructor Detail

SourceExecutableScript

public SourceExecutableScript(String language,
                              String source)
Method Detail

execute

public Object execute(ScriptEngine engine,
                      VariableScope variableScope,
                      Bindings bindings)
Description copied from class: ExecutableScript

Evaluates the script using the provided engine and bindings

Specified by:
execute in class ExecutableScript
Parameters:
engine - 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

compileScript

protected void compileScript()

evaluateScript

protected Object evaluateScript(ScriptEngine engine,
                                Bindings bindings)

getScriptSource

public String getScriptSource()

setScriptSource

public void setScriptSource(String scriptSource)
Sets the script source code. And invalidates any cached compilation result.

Parameters:
scriptSource - the new script source code

getCompiledScript

public CompiledScript getCompiledScript()

isShouldBeCompiled

public boolean isShouldBeCompiled()


Copyright © 2015 camunda services GmbH. All rights reserved.