Class StateMachine
java.lang.Object
org.cristalise.kernel.lifecycle.instance.stateMachine.StateMachine
- All Implemented Interfaces:
DescriptionObject
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateState(String name) Factory method to create a new State for the given name.createTransition(String name) Factory method to create a new Transition for the given name.static StringgetDefaultStateMachine(String type) intgetErrorTransitionIdForState(int id) intgetPossibleTransitions(Activity act, AgentPath agent) getState(int stateID) getTransition(int transitionID) getTransition(String name) intgetTransitionID(String name) Helper method to get transition ID by nameintgetValidTransitionID(String transName) Helper method to get transition ID by namebooleanmakeDescCollections(TransactionKey transactionKey) voidsetInitialState(State initialState) voidsetInitialStateCode(int initialStateCode) voidvoidsetTransitions(ArrayList<Transition> newTransitions) traverse(Activity act, Transition transition, AgentPath agent) booleanvalidate()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.cristalise.kernel.utils.DescriptionObject
exists, export, getItemPath, getName, getNamespace, getVersion, getXml, getXml, makeDescCollection, setItemPath, setName, setNamespace, setVersion, toOutcome
-
Field Details
-
namespace
-
name
-
version
-
itemPath
-
-
Constructor Details
-
StateMachine
public StateMachine() -
StateMachine
-
-
Method Details
-
createState
Factory method to create a new State for the given name. It does NOT check whether the name exists or not- Parameters:
name- the name of the State- Returns:
- the new State
-
createTransition
Factory method to create a new Transition for the given name. It does NOT check whether the name exists or not- Parameters:
name- the name of the Transition- Returns:
- the new Transition
-
setStates
-
setTransitions
-
validate
public boolean validate() -
getStates
-
getTransitions
-
getInitialState
-
setInitialState
-
getInitialStateCode
public int getInitialStateCode() -
setInitialStateCode
public void setInitialStateCode(int initialStateCode) -
getItemID
- Specified by:
getItemIDin interfaceDescriptionObject
-
getTransition
-
getTransition
-
getTransitionID
Helper method to get transition ID by name- Parameters:
name- the name of the Transition- Returns:
- the integer ID associated with the Transition name. Returns -1 in case the name does not exist
-
getValidTransitionID
Helper method to get transition ID by name- Parameters:
transName- the name of the Transaction- Returns:
- the ID matching the name
- Throws:
InvalidDataException- the name was not found
-
getState
-
getState
-
makeDescCollections
- Specified by:
makeDescCollectionsin interfaceDescriptionObject
-
getPossibleTransitions
public List<Transition> getPossibleTransitions(Activity act, AgentPath agent) throws ObjectNotFoundException, InvalidDataException -
traverse
public State traverse(Activity act, Transition transition, AgentPath agent) throws InvalidTransitionException, AccessRightsException, ObjectNotFoundException, InvalidDataException -
isCoherent
public boolean isCoherent() -
getErrorTransitionIdForState
public int getErrorTransitionIdForState(int id) -
getResourceType
- Specified by:
getResourceTypein interfaceDescriptionObject
-
getDefaultStateMachine
-