de.danet.an.workflow.omgcore
Class WfExecutionObject.State

java.lang.Object
  extended byde.danet.an.workflow.omgcore.WfExecutionObject.State
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
WfExecutionObject.ClosedState, WfExecutionObject.OpenState
Enclosing class:
WfExecutionObject

public static class WfExecutionObject.State
extends java.lang.Object
implements java.io.Serializable

This class defines the top-hierachy possible states of a WfExecutionObject as returned by workflowState().

See Also:
Serialized Form

Field Summary
static WfExecutionObject.State CLOSED
          Reflects that the object is finished and inactive.
static WfExecutionObject.State OPEN
          To reflect that the object is active and not finished.
 
Constructor Summary
protected WfExecutionObject.State(java.lang.String text)
          Default constructor.
 
Method Summary
static WfExecutionObject.State fromString(java.lang.String text)
          Get a state by name.
 WfExecutionObject.State getParent()
          Returns the parent in the state hierachy if all states defined in this class or null, if this states are at the top level of the hierachy.
 WfExecutionObject.State howClosedState()
          Returns the workflow substate for closed execution objects.
 boolean isSameOrSubState(WfExecutionObject.State s)
          Checks if this state is the same state as the given state or a substate of the given state.
protected static void registerState(WfExecutionObject.State state)
          Register state for fromString evaluation.
protected  java.lang.String textRepresentation()
          Return the textual representation of the state.
 java.lang.String toString()
          Returns the string representation of the state.
 WfExecutionObject.State whileOpenState()
          Returns the workflow substate for open execution objects.
 WfExecutionObject.State whyNotRunningState()
          Returns the workflow substate for open, not running execution objects.
 WfExecutionObject.State workflowState()
          Returns the workflow state, i.e. this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

OPEN

public static final WfExecutionObject.State OPEN
To reflect that the object is active and not finished.


CLOSED

public static final WfExecutionObject.State CLOSED
Reflects that the object is finished and inactive.

Constructor Detail

WfExecutionObject.State

protected WfExecutionObject.State(java.lang.String text)
Default constructor.

Parameters:
text - Textual representation of the state
Method Detail

textRepresentation

protected final java.lang.String textRepresentation()
Return the textual representation of the state.

Returns:
the textual representation

getParent

public WfExecutionObject.State getParent()
Returns the parent in the state hierachy if all states defined in this class or null, if this states are at the top level of the hierachy.

Returns:
parent in the state hierachy

workflowState

public WfExecutionObject.State workflowState()
Returns the workflow state, i.e. this object.

Returns:
the state as State object.

whileOpenState

public WfExecutionObject.State whileOpenState()
Returns the workflow substate for open execution objects.

Returns:
the state as State object.

whyNotRunningState

public WfExecutionObject.State whyNotRunningState()
Returns the workflow substate for open, not running execution objects.

Returns:
the state as State object.

howClosedState

public WfExecutionObject.State howClosedState()
Returns the workflow substate for closed execution objects.

Returns:
the state as State object.

toString

public java.lang.String toString()
Returns the string representation of the state.

Returns:
string representation of the state.

registerState

protected static void registerState(WfExecutionObject.State state)
Register state for fromString evaluation.

Additionally introduced sub-states must call this method during their initialization if the textual representation is to be recognized in the fromString method. It is up to the implementor of a derived state to assure that the sub-state is initialized before the from String method is called.

Parameters:
state - the State to be registered.

fromString

public static WfExecutionObject.State fromString(java.lang.String text)
                                          throws InvalidStateException
Get a state by name.

Parameters:
text - state name to search
Returns:
state object
Throws:
InvalidStateException - if text is not a valid state name.

isSameOrSubState

public boolean isSameOrSubState(WfExecutionObject.State s)
Checks if this state is the same state as the given state or a substate of the given state.

Parameters:
s - State to compare
Returns:
true if same or sub-state false else.