| java.lang.Object org.jbpm.module.exe.ModuleInstance org.jbpm.context.exe.ContextInstance
ContextInstance | public class ContextInstance extends ModuleInstance (Code) | | maintains all the key-variable pairs for a process instance. You can obtain a
ContextInstance from a processInstance from a process instance like this :
ProcessInstance processInstance = ...;
ContextInstance contextInstance = processInstance.getContextInstance();
More information on context and process variableInstances can be found in
the userguide, section context
|
Method Summary | |
public void | addVariables(Map variables) adds all the variableInstances on the root-token (= process-instance scope). | public void | addVariables(Map variables, Token token) adds all the variableInstances to the scope of the given token. | TokenVariableMap | createTokenVariableMap(Token token) | public void | createVariable(String name, Object value) creates a variable on the root-token (= process-instance scope) and
calculates the actual VariableInstance-type from the value. | public void | createVariable(String name, Object value, Token token) creates a variable in the scope of the given token and calculates the
actual VariableInstance-type from the value. | public void | deleteTransientVariable(String name) removes the transient variable. | public void | deleteVariable(String name) deletes the given variable on the root-token (=process-instance scope). | public void | deleteVariable(String name, Token token) deletes a variable from the given token. | public Object | getLocalVariable(String name, Token token) retrieves a variable which is local to the token.
Method
ContextInstance.getVariableLocally(String,Token) is the same
as this method and it was added for naming consistency. | public TokenVariableMap | getOrCreateTokenVariableMap(Token token) searches for the first token-variable-map for the given token
and creates it on the root token if it doesn't exist. | Token | getRootToken() | public TokenVariableMap | getTokenVariableMap(Token token) looks for the first token-variable-map that is found
up the token-parent hirarchy. | public Map | getTokenVariableMaps() | public Object | getTransientVariable(String name) retrieves the transient variable for the given name. | public Map | getTransientVariables() retrieves all the transient variableInstances map. | public Object | getVariable(String name) gets the variable with the given name on the root-token (= process-instance
scope). | public Object | getVariable(String name, Token token) retrieves a variable in the scope of the token. | public VariableInstance | getVariableInstance(String name, Token token) | public Object | getVariableLocally(String name, Token token) retrieves a variable which is local to the token.
this method was added for naming consistency. | public Map | getVariables() gets all the variableInstances on the root-token (= process-instance scope). | public Map | getVariables(Token token) retrieves all the variableInstances in scope of the given token. | public boolean | hasTransientVariable(String name) tells if a transient variable with the given name is present. | public boolean | hasVariable(String name) checks if a variable is present with the given name on the root-token (=
process-instance scope). | public boolean | hasVariable(String name, Token token) checks if a variable is present with the given name in the scope of the
token. | public void | setTransientVariable(String name, Object value) sets the transient variable for the given name to the given value. | public void | setTransientVariables(Map transientVariables) replaces the transient variableInstances with the given map. | public void | setVariable(String name, Object value) sets a variable on the process instance scope. | public void | setVariable(String name, Object value, Token token) sets a variable. | public void | setVariableLocally(String name, Object value) sets the variable on the root token, creates the variable if necessary and
calculates the actual VariableInstance-type from the value. | public void | setVariableLocally(String name, Object value, Token token) creates a variable in the scope of the given token and calculates the
actual VariableInstance-type from the value. | public void | setVariables(Map variables) The method setVariables is the same as the
ContextInstance.addVariables(Map,Token) ,
but it was added for more consistency. | public void | setVariables(Map variables, Token token) adds all the variableInstances to the scope of the given token. |
tokenVariableMaps | protected Map tokenVariableMaps(Code) | | |
transientVariables | protected transient Map transientVariables(Code) | | |
updatedVariableContainers | protected transient List updatedVariableContainers(Code) | | |
ContextInstance | public ContextInstance()(Code) | | |
addVariables | public void addVariables(Map variables)(Code) | | adds all the variableInstances on the root-token (= process-instance scope).
|
createVariable | public void createVariable(String name, Object value)(Code) | | creates a variable on the root-token (= process-instance scope) and
calculates the actual VariableInstance-type from the value.
|
createVariable | public void createVariable(String name, Object value, Token token)(Code) | | creates a variable in the scope of the given token and calculates the
actual VariableInstance-type from the value.
|
deleteTransientVariable | public void deleteTransientVariable(String name)(Code) | | removes the transient variable.
|
deleteVariable | public void deleteVariable(String name)(Code) | | deletes the given variable on the root-token (=process-instance scope).
|
deleteVariable | public void deleteVariable(String name, Token token)(Code) | | deletes a variable from the given token. For safety reasons, this method does
not propagate the deletion to parent tokens in case the given token does not contain
the variable.
|
getOrCreateTokenVariableMap | public TokenVariableMap getOrCreateTokenVariableMap(Token token)(Code) | | searches for the first token-variable-map for the given token
and creates it on the root token if it doesn't exist.
|
getTokenVariableMap | public TokenVariableMap getTokenVariableMap(Token token)(Code) | | looks for the first token-variable-map that is found
up the token-parent hirarchy.
|
getTokenVariableMaps | public Map getTokenVariableMaps()(Code) | | |
getTransientVariable | public Object getTransientVariable(String name)(Code) | | retrieves the transient variable for the given name.
|
getTransientVariables | public Map getTransientVariables()(Code) | | retrieves all the transient variableInstances map. note that no deep copy is
performed, changing the map leads to changes in the transient variableInstances of
this context instance.
|
getVariable | public Object getVariable(String name)(Code) | | gets the variable with the given name on the root-token (= process-instance
scope).
|
getVariable | public Object getVariable(String name, Token token)(Code) | | retrieves a variable in the scope of the token. If the given token does not
have a variable for the given name, the variable is searched for up the
token hierarchy.
|
getVariables | public Map getVariables()(Code) | | gets all the variableInstances on the root-token (= process-instance scope).
|
getVariables | public Map getVariables(Token token)(Code) | | retrieves all the variableInstances in scope of the given token.
|
hasTransientVariable | public boolean hasTransientVariable(String name)(Code) | | tells if a transient variable with the given name is present.
|
hasVariable | public boolean hasVariable(String name)(Code) | | checks if a variable is present with the given name on the root-token (=
process-instance scope).
|
hasVariable | public boolean hasVariable(String name, Token token)(Code) | | checks if a variable is present with the given name in the scope of the
token.
|
setTransientVariable | public void setTransientVariable(String name, Object value)(Code) | | sets the transient variable for the given name to the given value.
|
setTransientVariables | public void setTransientVariables(Map transientVariables)(Code) | | replaces the transient variableInstances with the given map.
|
setVariable | public void setVariable(String name, Object value)(Code) | | sets a variable on the process instance scope.
|
setVariable | public void setVariable(String name, Object value, Token token)(Code) | | sets a variable. If a variable exists in the scope given by the token, that
variable is updated. Otherwise, the variable is created on the root token
(=process instance scope).
|
setVariableLocally | public void setVariableLocally(String name, Object value)(Code) | | sets the variable on the root token, creates the variable if necessary and
calculates the actual VariableInstance-type from the value.
|
setVariableLocally | public void setVariableLocally(String name, Object value, Token token)(Code) | | creates a variable in the scope of the given token and calculates the
actual VariableInstance-type from the value.
|
|
|