org.ow2.bonita.facade.runtime.impl
Class ActivityInstanceImpl<T extends ActivityBody>

java.lang.Object
  extended by org.ow2.bonita.facade.runtime.impl.RuntimeRecordImpl
      extended by org.ow2.bonita.facade.runtime.impl.ActivityInstanceImpl<T>
All Implemented Interfaces:
java.io.Serializable, ActivityInstance<T>, RuntimeRecord
Direct Known Subclasses:
ActivityFullInstanceImpl

public class ActivityInstanceImpl<T extends ActivityBody>
extends RuntimeRecordImpl
implements ActivityInstance<T>

Author:
Pierre Vigneras
See Also:
Serialized Form

Field Summary
protected  java.lang.String activityId
           
protected  java.lang.String activityInstanceId
           
protected  T body
           
protected  java.lang.String iterationId
           
protected  ActivityInstanceUUID uuid
           
protected  java.util.Map<java.lang.String,java.lang.Object> variablesBeforeStarted
           
protected  java.util.List<VariableUpdate> variableUpdates
           
 
Fields inherited from class org.ow2.bonita.facade.runtime.impl.RuntimeRecordImpl
instanceUUID, processUUID
 
Constructor Summary
protected ActivityInstanceImpl()
           
  ActivityInstanceImpl(ActivityInstance<? extends ActivityBody> record)
           
protected ActivityInstanceImpl(ActivityInstanceUUID uuid, java.lang.String activityId, ProcessDefinitionUUID processUUID, ProcessInstanceUUID instanceUUID, java.lang.String iterationId, java.lang.String activityInstanceId)
           
 
Method Summary
 java.lang.String getActivityId()
          Returns the value of the id attribute of the Activity element defined into the XPDL file.
 java.lang.String getActivityInstanceId()
          Returns the activity instance id of this activity (in case of multi instantiation)
 T getBody()
           The body of the activity depends on some XPDL definition elements within the Activity element like: Implementation (No, Subflow), StartMode (Manual/Automatic) or Route.
 java.lang.String getIterationId()
          Returns the iteration id of this activity
 java.util.Map<java.lang.String,java.lang.Object> getLastKnownVariableValues()
          Returns the map containing all variables with the last updated value.
 ActivityInstanceUUID getUUID()
          Returns the UUID of the activity instance.
 java.util.Map<java.lang.String,java.lang.Object> getVariablesBeforeStarted()
          Returns all variables for the recorded activity before the activity has been started.
 java.util.List<VariableUpdate> getVariableUpdates()
          Gives access to the historic of variables updates.
 java.lang.Object getVariableValueBeforeStarted(java.lang.String variableId)
          Returns the value of the variable with the specified key before the activity has been started.
 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, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.ow2.bonita.facade.runtime.RuntimeRecord
getProcessDefinitionUUID, getProcessInstanceUUID
 

Field Detail

uuid

protected ActivityInstanceUUID uuid

activityId

protected java.lang.String activityId

iterationId

protected java.lang.String iterationId

activityInstanceId

protected java.lang.String activityInstanceId

variablesBeforeStarted

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

variableUpdates

protected java.util.List<VariableUpdate> variableUpdates

body

protected T extends ActivityBody body
Constructor Detail

ActivityInstanceImpl

protected ActivityInstanceImpl()

ActivityInstanceImpl

protected ActivityInstanceImpl(ActivityInstanceUUID uuid,
                               java.lang.String activityId,
                               ProcessDefinitionUUID processUUID,
                               ProcessInstanceUUID instanceUUID,
                               java.lang.String iterationId,
                               java.lang.String activityInstanceId)

ActivityInstanceImpl

public ActivityInstanceImpl(ActivityInstance<? extends ActivityBody> record)
Method Detail

toString

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

getVariablesBeforeStarted

public java.util.Map<java.lang.String,java.lang.Object> getVariablesBeforeStarted()
Description copied from interface: ActivityInstance
Returns all variables for the recorded activity before the activity has been started. If a hook with an OnReady event name has been defined, this hook has been executed. The map returned by this method contains both global variables (for the process) and local variables (for this activity). Key is the variable processDefinitionUUID and value is the variable object (can be: an Enumeration, a plain String, a Boolean, a Date, a Long or a Double). An empty map is returned if no variable is found.

Specified by:
getVariablesBeforeStarted in interface ActivityInstance<T extends ActivityBody>
Returns:
The map containing activity variables.

getVariableValueBeforeStarted

public java.lang.Object getVariableValueBeforeStarted(java.lang.String variableId)
Description copied from interface: ActivityInstance
Returns the value of the variable with the specified key before the activity has been started. If a hook with an OnReady event name has been defined, this hook has been executed.

Specified by:
getVariableValueBeforeStarted in interface ActivityInstance<T extends ActivityBody>
Parameters:
variableId - the variable processDefinitionUUID.
Returns:
The value of the variable with the specified key (can be: an Enumeration, a plain String, a Boolean, a Date, a Long or a Double).

getBody

public T getBody()
Description copied from interface: ActivityInstance

The body of the activity depends on some XPDL definition elements within the Activity element like: Implementation (No, Subflow), StartMode (Manual/Automatic) or Route.

The returned body gives access to the recorded informations that are specific to the type of the body.

Specified by:
getBody in interface ActivityInstance<T extends ActivityBody>
Returns:
The recorded informations depending on the type of the body.

getIterationId

public java.lang.String getIterationId()
Description copied from interface: ActivityInstance
Returns the iteration id of this activity

Specified by:
getIterationId in interface ActivityInstance<T extends ActivityBody>

getActivityInstanceId

public java.lang.String getActivityInstanceId()
Description copied from interface: ActivityInstance
Returns the activity instance id of this activity (in case of multi instantiation)

Specified by:
getActivityInstanceId in interface ActivityInstance<T extends ActivityBody>

getActivityId

public java.lang.String getActivityId()
Description copied from interface: ActivityInstance
Returns the value of the id attribute of the Activity element defined into the XPDL file.

Specified by:
getActivityId in interface ActivityInstance<T extends ActivityBody>

getVariableUpdates

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

Specified by:
getVariableUpdates in interface ActivityInstance<T extends ActivityBody>
Returns:
The list of recorded informations for the variable updates.

getLastKnownVariableValues

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

Specified by:
getLastKnownVariableValues in interface ActivityInstance<T extends ActivityBody>
Returns:
The map containing all variables with the last updated value.

getUUID

public ActivityInstanceUUID getUUID()
Description copied from interface: ActivityInstance
Returns the UUID of the activity instance.

Specified by:
getUUID in interface ActivityInstance<T extends ActivityBody>
Returns:
The UUID of the activity instance.


Copyright © 2009 OW2 Consortium. All Rights Reserved.