站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss JBPM 3.0.4 API 英文版文档

ContextInstance (jbpm-3.0.4) - JBoss JBPM 3.0.4 API 英文版文档


org.jbpm.context.exe
Class ContextInstance

java.lang.Object
  extended byorg.jbpm.module.exe.ModuleInstance
      extended byorg.jbpm.context.exe.ContextInstance
All Implemented Interfaces:
java.io.Serializable

public class ContextInstance
extends ModuleInstance

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 variables can be found in the userguide, section context

See Also:
Serialized Form

Field Summary
protected  java.util.Map tokenVariableMaps
           
protected  java.util.Map transientVariables
           
 
Fields inherited from class org.jbpm.module.exe.ModuleInstance
processInstance
 
Constructor Summary
ContextInstance()
           
 
Method Summary
 void addVariables(java.util.Map variables)
          adds all the variables on the root-token (= process-instance scope).
 void addVariables(java.util.Map variables, Token token)
          adds all the variables to the scope of the given token.
 void createVariable(java.lang.String name, java.lang.Object value)
          creates a variable on the root-token (= process-instance scope) and calculates the actual VariableInstance-type from the value.
 void createVariable(java.lang.String name, java.lang.Object value, Token token)
          creates a variable in the scope of the given token and calculates the actual VariableInstance-type from the value.
 void deleteTransientVariable(java.lang.String name)
          removes the transient variable.
 void deleteVariable(java.lang.String name)
          deletes the given variable on the root-token (=process-instance scope).
 void deleteVariable(java.lang.String name, Token token)
          deletes a variable from the given token.
 java.lang.Object getLocalVariable(java.lang.String name, Token token)
          retrieves a variable which is local to the token.
 java.lang.Object getTransientVariable(java.lang.String name)
          retrieves the transient variable for the given name.
 java.util.Map getTransientVariables()
          retrieves all the transient variables map.
 java.lang.Object getVariable(java.lang.String name)
          gets the variable with the given name on the root-token (= process-instance scope).
 java.lang.Object getVariable(java.lang.String name, Token token)
          retrieves a variable in the scope of the token.
 java.util.Map getVariables()
          gets all the variables on the root-token (= process-instance scope).
 java.util.Map getVariables(Token token)
          retrieves all the variables in scope of the given token.
 boolean hasTransientVariable(java.lang.String name)
          tells if a transient variable with the given name is present.
 boolean hasVariable(java.lang.String name)
          checks if a variable is present with the given name on the root-token (= process-instance scope).
 boolean hasVariable(java.lang.String name, Token token)
          checks if a variable is present with the given name in the scope of the token.
 void setTransientVariable(java.lang.String name, java.lang.Object value)
          sets the transient variable for the given name to the given value.
 void setTransientVariables(java.util.Map transientVariables)
          replaces the transient variables with the given map.
 void setVariable(java.lang.String name, java.lang.Object value)
          sets a variable on the process instance scope.
 void setVariable(java.lang.String name, java.lang.Object value, Token token)
          sets a variable.
 
Methods inherited from class org.jbpm.module.exe.ModuleInstance
getId, getProcessInstance, setProcessInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tokenVariableMaps

protected java.util.Map tokenVariableMaps

transientVariables

protected transient java.util.Map transientVariables
Constructor Detail

ContextInstance

public ContextInstance()
Method Detail

createVariable

public void createVariable(java.lang.String name,
                           java.lang.Object value)
creates a variable on the root-token (= process-instance scope) and calculates the actual VariableInstance-type from the value.


createVariable

public void createVariable(java.lang.String name,
                           java.lang.Object value,
                           Token token)
creates a variable in the scope of the given token and calculates the actual VariableInstance-type from the value.


getVariables

public java.util.Map getVariables()
gets all the variables on the root-token (= process-instance scope).


getVariables

public java.util.Map getVariables(Token token)
retrieves all the variables in scope of the given token.


addVariables

public void addVariables(java.util.Map variables)
adds all the variables on the root-token (= process-instance scope).


addVariables

public void addVariables(java.util.Map variables,
                         Token token)
adds all the variables to the scope of the given token.


getVariable

public java.lang.Object getVariable(java.lang.String name)
gets the variable with the given name on the root-token (= process-instance scope).


getVariable

public java.lang.Object getVariable(java.lang.String name,
                                    Token token)
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.


getLocalVariable

public java.lang.Object getLocalVariable(java.lang.String name,
                                         Token token)
retrieves a variable which is local to the token.


setVariable

public void setVariable(java.lang.String name,
                        java.lang.Object value)
sets a variable on the process instance scope.


setVariable

public void setVariable(java.lang.String name,
                        java.lang.Object value,
                        Token token)
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).


hasVariable

public boolean hasVariable(java.lang.String name)
checks if a variable is present with the given name on the root-token (= process-instance scope).


hasVariable

public boolean hasVariable(java.lang.String name,
                           Token token)
checks if a variable is present with the given name in the scope of the token.


deleteVariable

public void deleteVariable(java.lang.String name)
deletes the given variable on the root-token (=process-instance scope).


deleteVariable

public void deleteVariable(java.lang.String name,
                           Token token)
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.


getTransientVariable

public java.lang.Object getTransientVariable(java.lang.String name)
retrieves the transient variable for the given name.


setTransientVariable

public void setTransientVariable(java.lang.String name,
                                 java.lang.Object value)
sets the transient variable for the given name to the given value.


hasTransientVariable

public boolean hasTransientVariable(java.lang.String name)
tells if a transient variable with the given name is present.


getTransientVariables

public java.util.Map getTransientVariables()
retrieves all the transient variables map. note that no deep copy is performed, changing the map leads to changes in the transient variables of this context instance.


setTransientVariables

public void setTransientVariables(java.util.Map transientVariables)
replaces the transient variables with the given map.


deleteTransientVariable

public void deleteTransientVariable(java.lang.String name)
removes the transient variable.



Version : jbpm-3.0.4