com.oakgrovesystems.reactor.processMediation
Class Process

java.lang.Object
  |
  +--com.oakgrovesystems.reactor.processMediation.Process
All Implemented Interfaces:
ProcessMediationObject, java.io.Serializable

public class Process
extends java.lang.Object
implements java.io.Serializable, ProcessMediationObject

Process objects are the primary building blocks of a process model. They contain information about the current state and status of the process, the conditions under which it should start, stop, and change state, and the relationships the Process has with other objects. Most non-trivial business processes consist of multiple steps (subprocesses) that can often themselves be broken down into smaller, simpler steps. To model such processes, Process objects are associated with an arbitrary number of subprocesses, which are themselves Process objects, and can be broken down recursively into other subprocesses. Process objects represent both process definitions ('definitions') and enactments of a process definition ('instances'). The only difference between a Process object that is an instance and one that is a definition is that the boolean attribute 'definition' is true for definitions and false for instances. Also, some attributes are only relevant for instances (state, current statuses, start time, end time, and actual cost). Instances are cloned from definitions by issuing a 'clone instance' command to the Reactor system.

See Also:
Serialized Form

Field Summary
protected  com.oakgrovesystems.reactor.processMediation.ACL acl
           
protected  java.util.HashSet changeConditions
          The change conditions of a Process dictate the circumstances under which the Process's state or current statuses should change.
protected  java.util.HashSet currentStatuses
          The current statuses attribute of a Process object indicates the Statuses that currently apply to the Process.
protected  java.lang.String description
           
protected  java.lang.String endDate
           
protected  java.lang.String id
           
protected  boolean isDefinition
          true if the Process is a definition, false if it is an instance
protected  java.lang.String label
           
protected  com.oakgrovesystems.reactor.processMediation.MetaDataParser metaDataParser
           
protected  java.lang.String metaDataString
           
protected  java.util.HashSet operands
          The set of ReactorObjectIds of the Operands associated with this Process
protected  com.oakgrovesystems.reactor.ReactorObjectId parent
           
protected  java.util.HashSet policies
          The set of ReactorObjectIds of the Policies associated with this Process
protected  java.util.HashSet preconditions
          The preconditions of a Process dictate the circumstances under which it should be started automatically.
protected  java.lang.String startDate
           
protected  int state
          The state attribute of a Process object holds the information on the current state of the process.
static int STATE_FINISHED
           
static int STATE_STARTED
           
static int STATE_UNSTARTED
           
protected  java.util.HashSet statuses
          The set of ReactorObjectIds of the Statuses associated with this Process
protected  java.util.HashSet subprocesses
          The set of ReactorObjectIds of the Subprocesses of this Process
protected  java.util.List timerIds
          An ordered list of the ids (Strings) of the Timers that were started when this Process was started.
protected  java.util.List timers
          An ordered list of timers (TimerSpec objects) that will be started in the Reactor Timer Service when the Process starts and deleted when the Process stops.
 
Constructor Summary
Process()
          Creates a new Process and sets its Id
Process(com.oakgrovesystems.reactor.ReactorObjectId parent)
          Creates a new Process with the specified superprocess
 
Method Summary
 void addChangeCondition(com.oakgrovesystems.reactor.processMediation.ProcessChangeCondition pcc)
           
 void addCurrentStatus(com.oakgrovesystems.reactor.ReactorObjectId status)
           
 void addOperand(com.oakgrovesystems.reactor.ReactorObjectId operand)
           
 void addPolicy(com.oakgrovesystems.reactor.ReactorObjectId policy)
           
 void addPrecondition(com.oakgrovesystems.reactor.processMediation.ProcessPrecondition ppc)
           
 void addStatus(com.oakgrovesystems.reactor.ReactorObjectId status)
           
 void addSubprocess(com.oakgrovesystems.reactor.ReactorObjectId subprocess)
           
 void addTimer(com.oakgrovesystems.reactor.processMediation.TimerSpec timer)
           
 com.oakgrovesystems.reactor.processMediation.ProcessMediationObject copy()
          returns a deep copy of this ProcessMediationObject (all mutable members are copied)
 com.oakgrovesystems.reactor.processMediation.ACL getACL()
          gets the ACL of this ProcessMediationObject.
 java.util.Set getAssociatedObjects()
          Returns a set consisting of the ReactorObjectIds of all the Operands, Statuses, and Policies associated with this Process.
 java.util.Set getChangeConditions()
           
 java.util.Set getCurrentStatuses()
           
 java.lang.String getDescription()
          gets the desciption of this ProcessMediationObject.
 java.lang.String getEndDate()
           
 java.lang.String getId()
          gets the Id of this ProcessMediationObject.
 java.lang.String getLabel()
          set the desciption of this ProcessMediationObject.
 java.lang.String getMetaDataString()
           
 java.lang.String getMetaDataValue(java.lang.String key)
           
 java.util.Set getOperands()
           
 com.oakgrovesystems.reactor.ReactorObjectId getParent()
          returns the id of the superprocess of this Process
 java.util.Set getPolicies()
           
 java.util.Set getPreconditions()
           
 java.lang.String getStartDate()
           
 int getState()
           
 java.util.Set getStatuses()
           
 java.util.Set getSubprocesses()
           
 java.util.List getTimerIds()
           
 java.util.List getTimers()
           
 boolean hasCurrentStatus(com.oakgrovesystems.reactor.ReactorObjectId id)
           
 boolean hasOperand(com.oakgrovesystems.reactor.ReactorObjectId id)
           
 boolean hasPolicy(com.oakgrovesystems.reactor.ReactorObjectId id)
           
 boolean hasStatus(com.oakgrovesystems.reactor.ReactorObjectId id)
           
 boolean hasSubprocess(com.oakgrovesystems.reactor.ReactorObjectId id)
           
 boolean isDefinition()
          returns true if this Process is a definition, false if it is an instance
 void removeCurrentStatus(com.oakgrovesystems.reactor.ReactorObjectId status)
           
 void removeOperand(com.oakgrovesystems.reactor.ReactorObjectId operand)
           
 void removePolicy(com.oakgrovesystems.reactor.ReactorObjectId policy)
           
 void removeStatus(com.oakgrovesystems.reactor.ReactorObjectId status)
           
 void removeSubprocess(com.oakgrovesystems.reactor.ReactorObjectId subprocess)
           
 boolean sameAs(java.lang.Object o)
          compares two Processes for content equality
 void setACL(com.oakgrovesystems.reactor.processMediation.ACL acl)
          set the ACL of this ProcessMediationObject.
 void setChangeConditions(java.util.Collection c)
           
 void setCurrentStatuses(java.util.Collection c)
           
 void setDescription(java.lang.String description)
          set the desciption of this ProcessMediationObject.
 void setEndDate(java.lang.String endDate)
           
 void setId(java.lang.String id)
          set the Id of this ProcessMediationObject.
 void setIsDefinition(boolean isDefinition)
          specifies if this Process is a definition or an instance
 void setLabel(java.lang.String label)
          set the label of this ProcessMediationObject.
 void setMetaDataKeyValue(java.lang.String key, java.lang.String value)
           
 void setMetaDataString(java.lang.String s)
           
 void setOperands(java.util.Collection c)
           
 void setParent(com.oakgrovesystems.reactor.ReactorObjectId parent)
          sets the superprocess of this Process
 void setPolicies(java.util.Collection c)
           
 void setPreconditions(java.util.Collection preconditions)
           
 void setStartDate(java.lang.String startDate)
           
 void setState(int state)
           
 void setStatuses(java.util.Collection c)
           
 void setSubprocesses(java.util.Collection c)
           
 void setTimerIds(java.util.List timerIds)
           
 void setTimers(java.util.List timers)
           
 java.lang.String toString()
          returns the label if it is not empty or null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

STATE_UNSTARTED

public static final int STATE_UNSTARTED
See Also:
Constant Field Values

STATE_STARTED

public static final int STATE_STARTED
See Also:
Constant Field Values

STATE_FINISHED

public static final int STATE_FINISHED
See Also:
Constant Field Values

parent

protected com.oakgrovesystems.reactor.ReactorObjectId parent

id

protected java.lang.String id

isDefinition

protected boolean isDefinition
true if the Process is a definition, false if it is an instance


label

protected java.lang.String label

description

protected java.lang.String description

acl

protected com.oakgrovesystems.reactor.processMediation.ACL acl

startDate

protected java.lang.String startDate

endDate

protected java.lang.String endDate

metaDataString

protected java.lang.String metaDataString

metaDataParser

protected com.oakgrovesystems.reactor.processMediation.MetaDataParser metaDataParser

timers

protected java.util.List timers
An ordered list of timers (TimerSpec objects) that will be started in the Reactor Timer Service when the Process starts and deleted when the Process stops. The ordering of the List is used to match up TimerSpecs with the timer IDs of the started timers. The ids for the timers are stored in the timerIds List such that the first id in the TimerIds list corresponds to the first Timer in the timers list, and so on. The timerIds list is populated at the time the Process is started. Thereafter, the lengths of the timers and timerIds Lists should always be equal.


timerIds

protected java.util.List timerIds
An ordered list of the ids (Strings) of the Timers that were started when this Process was started. The ordering of the list is used to match up ids with their corresponding TimerSpecs in the timers List.


state

protected int state
The state attribute of a Process object holds the information on the current state of the process. It is not used by Process definitions- only instances. Process instances can be in one of three states: unstarted, started, or finished. When an instance is cloned from a definition, it is placed in the unstarted state. It remains in the unstarted state until either a start command is issued to start it or its precondition becomes true and it is started automatically. It then transitions to the started state. It remains in the started state until either a stop command is issued to stop it or one of its change conditions becomes true and the change dictated by that change condition indicates that the process should be stopped. It then transitions to the finished state. From the finished state, an instance can be restarted (transition back to the started state) in the same way that it transitions from the unstarted state to the started state- by a start command or its precondition becoming true. A Process will also transition to the finished state from either of the other states if its superprocess transitions to the finished state. State transitions can also occur as a result of application of the Process's change conditions.


currentStatuses

protected java.util.HashSet currentStatuses
The current statuses attribute of a Process object indicates the Statuses that currently apply to the Process. It is not used by Process definitions- only instances. A Process can have any number of current statuses at a given time. Reactor adds or removes Statuses to the Process's set of current statuses in response to an 'add status' or 'remove status' command or by application of the Process's change conditions.


preconditions

protected java.util.HashSet preconditions
The preconditions of a Process dictate the circumstances under which it should be started automatically. Specifically, one of the conditions specified by the preconditions attribute must be false and become true in order for the Process to be started automatically.


changeConditions

protected java.util.HashSet changeConditions
The change conditions of a Process dictate the circumstances under which the Process's state or current statuses should change. A change condition for a Process is composed of a condition that must be met and a change that should be applied to the Process when the condition is met. The condition specified by a change condition must be false and become true for the change to be applied automatically. changeConditions is a Set of instances of ProcessChangeCondition


operands

protected java.util.HashSet operands
The set of ReactorObjectIds of the Operands associated with this Process


statuses

protected java.util.HashSet statuses
The set of ReactorObjectIds of the Statuses associated with this Process


policies

protected java.util.HashSet policies
The set of ReactorObjectIds of the Policies associated with this Process


subprocesses

protected java.util.HashSet subprocesses
The set of ReactorObjectIds of the Subprocesses of this Process

Constructor Detail

Process

public Process()
Creates a new Process and sets its Id


Process

public Process(com.oakgrovesystems.reactor.ReactorObjectId parent)
Creates a new Process with the specified superprocess

Parameters:
parent - the id of the superprocess
Method Detail

getParent

public com.oakgrovesystems.reactor.ReactorObjectId getParent()
returns the id of the superprocess of this Process

Returns:
the id of the superprocess of this Process

setParent

public void setParent(com.oakgrovesystems.reactor.ReactorObjectId parent)
sets the superprocess of this Process

Parameters:
parent - the id of the new superprocess of this Process

getId

public java.lang.String getId()
gets the Id of this ProcessMediationObject. Ids are used to uniquely identify objects in the Reactor system ids should be created using the com.oakgrovesystems.util.UniqueId class

Specified by:
getId in interface ProcessMediationObject
Returns:
the Id of this ProcessMediationObject

setId

public void setId(java.lang.String id)
set the Id of this ProcessMediationObject. Ids are used to uniquely identify objects in the Reactor system ids should be created using the com.oakgrovesystems.util.UniqueId class

Specified by:
setId in interface ProcessMediationObject
Parameters:
id - the Id of this ProcessMediationObject

isDefinition

public boolean isDefinition()
returns true if this Process is a definition, false if it is an instance

Returns:
true if this Process is a definition, false if it is an instance

setIsDefinition

public void setIsDefinition(boolean isDefinition)
specifies if this Process is a definition or an instance

Parameters:
isDefinition - true if this Process is a definition; false if it is an instance

getLabel

public java.lang.String getLabel()
set the desciption of this ProcessMediationObject. Desciptions are human readable text describing a Process. They are not used by internal Reactor functionality, but are included for use by Reactor clients.

Specified by:
getLabel in interface ProcessMediationObject
Returns:
the label of this ProcessMediationObject

setLabel

public void setLabel(java.lang.String label)
set the label of this ProcessMediationObject. Labels are short human-readable strings that can be used as an alternative to ids to identify a Process. All the objects associated with a Process should have unique labels.

Specified by:
setLabel in interface ProcessMediationObject
Parameters:
label - the label of this ProcessMediationObject

getDescription

public java.lang.String getDescription()
gets the desciption of this ProcessMediationObject. Desciptions are human readable text describing a Process. They are not used by internal Reactor functionality, but are included for use by Reactor clients.

Specified by:
getDescription in interface ProcessMediationObject
Returns:
the description of this ProcessMediationObject

setDescription

public void setDescription(java.lang.String description)
set the desciption of this ProcessMediationObject. Desciptions are human readable text describing a Process. They are not used by internal Reactor functionality, but are included for use by Reactor clients.

Specified by:
setDescription in interface ProcessMediationObject
Parameters:
description - the description of this ProcessMediationObject

getACL

public com.oakgrovesystems.reactor.processMediation.ACL getACL()
gets the ACL of this ProcessMediationObject. ACLs describe the relationships between ProcessMediationObjects and users of the Reactor system.

Specified by:
getACL in interface ProcessMediationObject
Returns:
the acl of this ProcessMediationObject

setACL

public void setACL(com.oakgrovesystems.reactor.processMediation.ACL acl)
set the ACL of this ProcessMediationObject. ACLs describe the relationships between ProcessMediationObjects and users of the Reactor system.

Specified by:
setACL in interface ProcessMediationObject
Parameters:
acl - the acl of this ProcessMediationObject

getStartDate

public java.lang.String getStartDate()

setStartDate

public void setStartDate(java.lang.String startDate)

getEndDate

public java.lang.String getEndDate()

setEndDate

public void setEndDate(java.lang.String endDate)

getTimers

public java.util.List getTimers()

setTimers

public void setTimers(java.util.List timers)

addTimer

public void addTimer(com.oakgrovesystems.reactor.processMediation.TimerSpec timer)

setTimerIds

public void setTimerIds(java.util.List timerIds)

getTimerIds

public java.util.List getTimerIds()

getState

public int getState()

setState

public void setState(int state)

getPreconditions

public java.util.Set getPreconditions()

setPreconditions

public void setPreconditions(java.util.Collection preconditions)

addPrecondition

public void addPrecondition(com.oakgrovesystems.reactor.processMediation.ProcessPrecondition ppc)

getChangeConditions

public java.util.Set getChangeConditions()

setChangeConditions

public void setChangeConditions(java.util.Collection c)

addChangeCondition

public void addChangeCondition(com.oakgrovesystems.reactor.processMediation.ProcessChangeCondition pcc)

getAssociatedObjects

public java.util.Set getAssociatedObjects()
Returns a set consisting of the ReactorObjectIds of all the Operands, Statuses, and Policies associated with this Process.


getOperands

public java.util.Set getOperands()

setOperands

public void setOperands(java.util.Collection c)

addOperand

public void addOperand(com.oakgrovesystems.reactor.ReactorObjectId operand)

removeOperand

public void removeOperand(com.oakgrovesystems.reactor.ReactorObjectId operand)

hasOperand

public boolean hasOperand(com.oakgrovesystems.reactor.ReactorObjectId id)

getStatuses

public java.util.Set getStatuses()

setStatuses

public void setStatuses(java.util.Collection c)

addStatus

public void addStatus(com.oakgrovesystems.reactor.ReactorObjectId status)

removeStatus

public void removeStatus(com.oakgrovesystems.reactor.ReactorObjectId status)

hasStatus

public boolean hasStatus(com.oakgrovesystems.reactor.ReactorObjectId id)

getCurrentStatuses

public java.util.Set getCurrentStatuses()

setCurrentStatuses

public void setCurrentStatuses(java.util.Collection c)

addCurrentStatus

public void addCurrentStatus(com.oakgrovesystems.reactor.ReactorObjectId status)

removeCurrentStatus

public void removeCurrentStatus(com.oakgrovesystems.reactor.ReactorObjectId status)

hasCurrentStatus

public boolean hasCurrentStatus(com.oakgrovesystems.reactor.ReactorObjectId id)

getPolicies

public java.util.Set getPolicies()

setPolicies

public void setPolicies(java.util.Collection c)

addPolicy

public void addPolicy(com.oakgrovesystems.reactor.ReactorObjectId policy)

removePolicy

public void removePolicy(com.oakgrovesystems.reactor.ReactorObjectId policy)

hasPolicy

public boolean hasPolicy(com.oakgrovesystems.reactor.ReactorObjectId id)

getSubprocesses

public java.util.Set getSubprocesses()

setSubprocesses

public void setSubprocesses(java.util.Collection c)

addSubprocess

public void addSubprocess(com.oakgrovesystems.reactor.ReactorObjectId subprocess)

removeSubprocess

public void removeSubprocess(com.oakgrovesystems.reactor.ReactorObjectId subprocess)

hasSubprocess

public boolean hasSubprocess(com.oakgrovesystems.reactor.ReactorObjectId id)

getMetaDataString

public java.lang.String getMetaDataString()

setMetaDataString

public void setMetaDataString(java.lang.String s)

getMetaDataValue

public java.lang.String getMetaDataValue(java.lang.String key)

setMetaDataKeyValue

public void setMetaDataKeyValue(java.lang.String key,
                                java.lang.String value)

toString

public java.lang.String toString()
returns the label if it is not empty or null. otherwise, returns the id

Overrides:
toString in class java.lang.Object
Returns:
the label if it is not empty or null. otherwise, returns the id

copy

public com.oakgrovesystems.reactor.processMediation.ProcessMediationObject copy()
returns a deep copy of this ProcessMediationObject (all mutable members are copied)

Specified by:
copy in interface ProcessMediationObject
Returns:
a deep copy of this ProcessMediationObject

sameAs

public boolean sameAs(java.lang.Object o)
compares two Processes for content equality

Parameters:
o - the Process to compare for content equality
Returns:
a boolean indicating if the Processes are equal


Copyright (c) 1999-2004 Oak Grove Systems. All Rights Reserved.