org.ow2.bonita.facade.runtime.impl
Class ProcessInstanceImpl

java.lang.Object
  extended by org.ow2.bonita.facade.runtime.impl.RuntimeRecordImpl
      extended by org.ow2.bonita.facade.runtime.impl.ProcessInstanceImpl
All Implemented Interfaces:
java.io.Serializable, ProcessInstance, RuntimeRecord
Direct Known Subclasses:
ProcessFullInstanceImpl

public class ProcessInstanceImpl
extends RuntimeRecordImpl
implements ProcessInstance

Author:
Pierre Vigneras
See Also:
Serialized Form

Field Summary
protected  java.util.Set<ProcessInstanceUUID> childrenInstanceUUID
           
protected  java.lang.String endedBy
           
protected  java.util.Date endedDate
           
protected  java.util.Map<java.lang.String,java.lang.Object> initialVariableValues
           
protected  java.util.List<InstanceStateUpdate> instanceStateUpdates
           
protected  ProcessInstanceUUID parentInstanceUUID
           
protected  java.lang.String startedBy
           
protected  java.util.Date startedDate
           
protected  java.util.List<VariableUpdate> variableUpdates
           
 
Fields inherited from class org.ow2.bonita.facade.runtime.impl.RuntimeRecordImpl
instanceUUID, processUUID
 
Constructor Summary
protected ProcessInstanceImpl()
           
  ProcessInstanceImpl(ProcessInstance processInstance)
           
  ProcessInstanceImpl(ProcessInstanceUUID instanceUUID, ProcessDefinitionUUID processUUID, ProcessInstanceUUID parentInstanceUUID, java.util.Map<java.lang.String,java.lang.Object> initialVariableValues)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.util.Set<ProcessInstanceUUID> getChildrenInstanceUUID()
          If this instance is a parent execution, it returns UUID of children instances otherwise an empty set
 java.lang.String getEndedBy()
          Returns the user finishing the instance of the workflow process.
 java.util.Date getEndedDate()
          Returns the date recorded when the instance is finished.
 java.lang.Object getInitialVariableValue(java.lang.String variableId)
          Returns the value of the variable with the specified key recorded at the instance creation.
 java.util.Map<java.lang.String,java.lang.Object> getInitialVariableValues()
          Returns all global variables (for the process instance) defined within the xml definition file and also optionally added as parameter (variable map) of the instantiateProcess() method.
 InstanceState getInstanceState()
          Returns the current instance state.
 java.util.List<InstanceStateUpdate> getInstanceStateUpdates()
          Returns the list of recorded state changes.
 java.util.Map<java.lang.String,java.lang.Object> getLastKnownVariableValues()
          Returns the map containing all variables with the last updated value.
 ProcessInstanceUUID getParentInstanceUUID()
          If the instance is created to execute a subflow it returns the instance processDefinitionUUID of the instance creating this instance of subflow, otherwise it returns null.
 java.lang.String getStartedBy()
          Returns the user creating and starting the instance of the workflow process.
 java.util.Date getStartedDate()
          Returns the date recorded when the instance has been created and started.
 ProcessInstanceUUID getUUID()
          Returns the UUID of the process instance.
 java.util.List<VariableUpdate> getVariableUpdates()
          Gives access to the historic of variables updates.
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class org.ow2.bonita.facade.runtime.impl.RuntimeRecordImpl
getProcessDefinitionUUID, getProcessInstanceUUID
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.ow2.bonita.facade.runtime.RuntimeRecord
getProcessDefinitionUUID, getProcessInstanceUUID
 

Field Detail

startedDate

protected java.util.Date startedDate

startedBy

protected java.lang.String startedBy

parentInstanceUUID

protected ProcessInstanceUUID parentInstanceUUID

childrenInstanceUUID

protected java.util.Set<ProcessInstanceUUID> childrenInstanceUUID

initialVariableValues

protected java.util.Map<java.lang.String,java.lang.Object> initialVariableValues

endedDate

protected java.util.Date endedDate

endedBy

protected java.lang.String endedBy

variableUpdates

protected java.util.List<VariableUpdate> variableUpdates

instanceStateUpdates

protected java.util.List<InstanceStateUpdate> instanceStateUpdates
Constructor Detail

ProcessInstanceImpl

protected ProcessInstanceImpl()

ProcessInstanceImpl

public ProcessInstanceImpl(ProcessInstanceUUID instanceUUID,
                           ProcessDefinitionUUID processUUID,
                           ProcessInstanceUUID parentInstanceUUID,
                           java.util.Map<java.lang.String,java.lang.Object> initialVariableValues)

ProcessInstanceImpl

public ProcessInstanceImpl(ProcessInstance processInstance)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getEndedBy

public java.lang.String getEndedBy()
Description copied from interface: ProcessInstance
Returns the user finishing the instance of the workflow process.

Specified by:
getEndedBy in interface ProcessInstance
Returns:
the user finishing the instance of the workflow process.

getEndedDate

public java.util.Date getEndedDate()
Description copied from interface: ProcessInstance
Returns the date recorded when the instance is finished.

Specified by:
getEndedDate in interface ProcessInstance
Returns:
the date recorded when the instance is finished.

getInitialVariableValues

public java.util.Map<java.lang.String,java.lang.Object> getInitialVariableValues()
Description copied from interface: ProcessInstance
Returns all global variables (for the process instance) defined within the xml definition file and also optionally added as parameter (variable map) of the instantiateProcess() method. Variable values are ones recorded at instance creation. Map Key is the variable processDefinitionUUID. Map Object is the variable value. An empty map is returned if no variable is found.

Specified by:
getInitialVariableValues in interface ProcessInstance
Returns:
the map containing global (for process instance) variables recorded at instance creation. The variable object (can be: an Enumeration, a plain String, a Boolean, a Date, a Long or a Double).

getInstanceState

public InstanceState getInstanceState()
Description copied from interface: ProcessInstance
Returns the current instance state.

Specified by:
getInstanceState in interface ProcessInstance
Returns:
the current instance state.

getParentInstanceUUID

public ProcessInstanceUUID getParentInstanceUUID()
Description copied from interface: ProcessInstance
If the instance is created to execute a subflow it returns the instance processDefinitionUUID of the instance creating this instance of subflow, otherwise it returns null.

Specified by:
getParentInstanceUUID in interface ProcessInstance
Returns:
the ProcessInstanceUUID of the parent instance (case of subflow) otherwise null.

getChildrenInstanceUUID

public java.util.Set<ProcessInstanceUUID> getChildrenInstanceUUID()
Description copied from interface: ProcessInstance
If this instance is a parent execution, it returns UUID of children instances otherwise an empty set

Specified by:
getChildrenInstanceUUID in interface ProcessInstance
Returns:
If this instance is a parent execution, it returns UUID of children instances otherwise an empty set

getStartedBy

public java.lang.String getStartedBy()
Description copied from interface: ProcessInstance
Returns the user creating and starting the instance of the workflow process.

Specified by:
getStartedBy in interface ProcessInstance
Returns:
the user creating and starting the instance of the workflow process.

getStartedDate

public java.util.Date getStartedDate()
Description copied from interface: ProcessInstance
Returns the date recorded when the instance has been created and started.

Specified by:
getStartedDate in interface ProcessInstance
Returns:
the date recorded when the instance has been created and started.

getInitialVariableValue

public java.lang.Object getInitialVariableValue(java.lang.String variableId)
Description copied from interface: ProcessInstance
Returns the value of the variable with the specified key recorded at the instance creation.

Specified by:
getInitialVariableValue in interface ProcessInstance
Parameters:
variableId - the variable processDefinitionUUID.
Returns:
the value of the variable with the specified key recorded at the instance creation. (can be: an Enumeration, a plain String, a Boolean, a Date, a Long or a Double).

getLastKnownVariableValues

public java.util.Map<java.lang.String,java.lang.Object> getLastKnownVariableValues()
Description copied from interface: ProcessInstance
Returns the map containing all variables with the last updated value.

Specified by:
getLastKnownVariableValues in interface ProcessInstance
Returns:
The map containing all variables with the last updated value. the variable object can be: an Enumeration, a plain String, a Boolean, a Date, a Long or a Double.

getUUID

public ProcessInstanceUUID getUUID()
Description copied from interface: ProcessInstance
Returns the UUID of the process instance.

Specified by:
getUUID in interface ProcessInstance
Returns:
The UUID of the process instance.

getVariableUpdates

public java.util.List<VariableUpdate> getVariableUpdates()
Description copied from interface: ProcessInstance
Gives access to the historic of variables updates.

Specified by:
getVariableUpdates in interface ProcessInstance
Returns:
The list of recorded informations for the variable updates.

getInstanceStateUpdates

public java.util.List<InstanceStateUpdate> getInstanceStateUpdates()
Description copied from interface: ProcessInstance
Returns the list of recorded state changes.

Specified by:
getInstanceStateUpdates in interface ProcessInstance
Returns:
The list of recorded state changes.

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object


Copyright © 2009 OW2 Consortium. All Rights Reserved.