Class
caplin.workbench.model

MiniStateMachine

The MiniStateMachine provides a simple configurable state Machine. You must provide a valid representation of the state model the MiniStateMachine will be in.


The format will be a map, with each key representing a state, and an array of valid states that can be transitioned to as the value


mStates["state1"] = ["state2", "state3"]
mStates["state2"] = ["steate1"]
mStates["state3"] = ["state1", "state2"]

Constructor Summary

Attributes Name and Description
caplin.workbench.model.MiniStateMachine(Object mStates, String sInitialState)

Method Summary

Attributes Name and Description
void getAvailableStates()

Returns the available states that the MiniStateMachine can be in.

void getCurrentState()

Returns the current MiniStateMachine state.

void getValidTransitions(String The)

Returns the available states that can be transitioned from the state given.

void setState(String sNewState)

Sets the given state.

Constructor Detail

caplin.workbench.model.MiniStateMachine(Object mStates, String sInitialState)

Parameters
Object mStates Representation of the states the MinisStateMachine will use.
String sInitialState Initial state your MiniStateMachine is on.

Method Detail

void getAvailableStates()

Returns the available states that the MiniStateMachine can be in.

void getCurrentState()

Returns the current MiniStateMachine state.

void getValidTransitions(String The)

Returns the available states that can be transitioned from the state given. If no state is given it will return the available transitions from the current state.

Parameters
String The state from which we want to know the transitions

void setState(String sNewState)

Sets the given state. This state must be within the available ones.

Parameters
String sNewState The new state to be set