|
© 2001 BEA Systems, Inc. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.beasys.commerce.foundation.StateMachine
This is the reference implemenation of a Workflow object. It provides a simple implemenation based on a set of states and transitions.
Workflow, Serialized Form| Field Summary | |
protected State |
currentState
|
protected State |
initialState
|
protected java.util.TreeSet |
states
|
protected java.lang.String |
TRANSITION_KEY_TOKEN
|
protected java.util.TreeMap |
transitions
|
| Constructor Summary | |
StateMachine()
Use WorkflowHome.create("com.beasys.commerce.foundation.StateMachine") to instantiate the workflow. |
|
| Method Summary | |
protected void |
addTransition(Transition t)
|
java.lang.String |
doTransition(java.lang.String transitionName)
Given the name of the transition, perform the transition and return the new state. |
WorkflowContext |
getContext()
Get the context of the Workflow. |
java.lang.String |
getCurrentStateName()
Get the name of the current state |
java.lang.String |
getInitialStateName()
Get the name of the initial state |
java.lang.String[] |
getOutgoingTransitions(java.lang.String state)
Given the name of the state, return all transitions starting from that state |
java.lang.String[] |
getStateNames()
Get all State names in an array of Strings. |
java.lang.String[] |
getTransitionNames()
Get all transition names in an array of Strings. |
java.lang.String |
lookAheadTransition(java.lang.String transition)
Given the name of the transition, look ahead the transition and return the predicted new state. |
void |
reset()
Reset the current workflow state to the initial state |
void |
setContext(WorkflowContext workflowContext)
Set the new context for the underlying workflow engine. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.lang.String TRANSITION_KEY_TOKEN
protected State currentState
protected State initialState
protected java.util.TreeMap transitions
protected java.util.TreeSet states
| Constructor Detail |
public StateMachine()
| Method Detail |
public java.lang.String doTransition(java.lang.String transitionName)
throws IllegalWorkflowTransitionException
doTransition in interface Workflowtransition - the name of the transition to be performedIllegalWorkflowTransitionException - if the transition is invalidpublic WorkflowContext getContext()
getContext in interface Workflowpublic java.lang.String getCurrentStateName()
getCurrentStateName in interface Workflowpublic java.lang.String getInitialStateName()
getInitialStateName in interface Workflowpublic java.lang.String[] getStateNames()
getStateNames in interface Workflowpublic java.lang.String[] getTransitionNames()
getTransitionNames in interface Workflow
public java.lang.String lookAheadTransition(java.lang.String transition)
throws IllegalWorkflowTransitionException
lookAheadTransition in interface Workflowtransition - the name of the transition to be performedIllegalWorkflowTransitionException - if the transition is invalid
public java.lang.String[] getOutgoingTransitions(java.lang.String state)
throws IllegalWorkflowTransitionException
getOutgoingTransitions in interface Workflowstate - the name of the stateIllegalWorkflowTransitionException - if the transition is invalidpublic void reset()
reset in interface Workflowpublic void setContext(WorkflowContext workflowContext)
setContext in interface WorkflowWorkflowContext - the new context for the underlying workflow engine.protected void addTransition(Transition t)
|
© 2001 BEA Systems, Inc. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||