Class ScriptBindings
- java.lang.Object
-
- org.camunda.bpm.engine.impl.scripting.engine.ScriptBindings
-
- All Implemented Interfaces:
java.util.Map<java.lang.String,java.lang.Object>
,javax.script.Bindings
public class ScriptBindings extends java.lang.Object implements javax.script.Bindings
A
Bindings
implementation which wraps an existing binding and enhances the key / value map with read-only access to:- variables provided in a
VariableScope
, - additional bindings provided through a set of
Resolvers
.
Note on backwards compatibility: before 7.2 the Script bindings behaved in a way that all script variables were automatically exposed as process variables. You can enable this behavior by setting
autoStoreScriptVariables
.- Author:
- Tom Baeyens, Daniel Meyer
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
autoStoreScriptVariables
if true, all script variables will be set in the variable scope.protected java.util.List<Resolver>
scriptResolvers
protected static java.util.Set<java.lang.String>
UNSTORED_KEYS
The script engine implementations put some key/value pairs into the binding.protected VariableScope
variableScope
protected javax.script.Bindings
wrappedBindings
-
Constructor Summary
Constructors Constructor Description ScriptBindings(java.util.List<Resolver> scriptResolvers, VariableScope variableScope, javax.script.Bindings wrappedBindings)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Map<java.lang.String,java.lang.Object>
calculateBindingMap()
void
clear()
boolean
containsKey(java.lang.Object key)
boolean
containsValue(java.lang.Object value)
java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>>
entrySet()
java.lang.Object
get(java.lang.Object key)
protected boolean
isAutoStoreScriptVariablesEnabled()
boolean
isEmpty()
java.util.Set<java.lang.String>
keySet()
java.lang.Object
put(java.lang.String name, java.lang.Object value)
void
putAll(java.util.Map<? extends java.lang.String,? extends java.lang.Object> toMerge)
java.lang.Object
remove(java.lang.Object key)
int
size()
java.util.Collection<java.lang.Object>
values()
-
-
-
Field Detail
-
UNSTORED_KEYS
protected static final java.util.Set<java.lang.String> UNSTORED_KEYS
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.
-
scriptResolvers
protected java.util.List<Resolver> scriptResolvers
-
variableScope
protected VariableScope variableScope
-
wrappedBindings
protected javax.script.Bindings wrappedBindings
-
autoStoreScriptVariables
protected boolean autoStoreScriptVariables
if true, all script variables will be set in the variable scope.
-
-
Constructor Detail
-
ScriptBindings
public ScriptBindings(java.util.List<Resolver> scriptResolvers, VariableScope variableScope, javax.script.Bindings wrappedBindings)
-
-
Method Detail
-
isAutoStoreScriptVariablesEnabled
protected boolean isAutoStoreScriptVariablesEnabled()
-
containsKey
public boolean containsKey(java.lang.Object key)
- Specified by:
containsKey
in interfacejavax.script.Bindings
- Specified by:
containsKey
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
get
public java.lang.Object get(java.lang.Object key)
- Specified by:
get
in interfacejavax.script.Bindings
- Specified by:
get
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
put
public java.lang.Object put(java.lang.String name, java.lang.Object value)
- Specified by:
put
in interfacejavax.script.Bindings
- Specified by:
put
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
entrySet
public java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>> entrySet()
- Specified by:
entrySet
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
keySet
public java.util.Set<java.lang.String> keySet()
- Specified by:
keySet
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
size
public int size()
- Specified by:
size
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
values
public java.util.Collection<java.lang.Object> values()
- Specified by:
values
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
putAll
public void putAll(java.util.Map<? extends java.lang.String,? extends java.lang.Object> toMerge)
- Specified by:
putAll
in interfacejavax.script.Bindings
- Specified by:
putAll
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
remove
public java.lang.Object remove(java.lang.Object key)
- Specified by:
remove
in interfacejavax.script.Bindings
- Specified by:
remove
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
clear
public void clear()
- Specified by:
clear
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
containsValue
public boolean containsValue(java.lang.Object value)
- Specified by:
containsValue
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
calculateBindingMap
protected java.util.Map<java.lang.String,java.lang.Object> calculateBindingMap()
-
-