提交 ed033f81 编写于 作者: J Joram Barrez

[Scripting] Add 'nashorn.global' object to unstored keys. Also add a method to...

[Scripting] Add 'nashorn.global' object to unstored keys. Also add a method to add new keys at runtime.
上级 08203950
......@@ -32,18 +32,18 @@ import org.activiti.engine.delegate.VariableScope;
public class ScriptBindings implements Bindings {
/**
* The script engine implementations put some key/value pairs into the binding. This list contains those keys, such that they wouldn't be stored as process variable.
* The script engine implementations put some key/value pairs into the binding.
* This list contains those keys, such that they wouldn't be stored as process variable.
*
* This list contains the keywords for JUEL, Javascript and Groovy.
*/
protected static final Set<String> UNSTORED_KEYS = new HashSet<String>(Arrays.asList("out", "out:print", "lang:import", "context", "elcontext", "print", "println"));
protected static final Set<String> UNSTORED_KEYS =
new HashSet<String>(Arrays.asList("out", "out:print", "lang:import", "context", "elcontext", "print", "println", "nashorn.global"));
protected List<Resolver> scriptResolvers;
protected VariableScope variableScope;
protected Bindings defaultBindings;
protected boolean storeScriptVariables = true; // By default everything is
// stored (backwards
// compatibility)
protected boolean storeScriptVariables = true; // By default everything is stored (backwards compatibility)
public ScriptBindings(List<Resolver> scriptResolvers, VariableScope variableScope) {
this.scriptResolvers = scriptResolvers;
......@@ -124,4 +124,9 @@ public class ScriptBindings implements Bindings {
public boolean isEmpty() {
throw new UnsupportedOperationException();
}
public void addUnstoredKey(String unstoredKey) {
UNSTORED_KEYS.add(unstoredKey);
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册