DslStateMachineHandler

This handler will be active inside the top level of the stateMachine definition.

Author

Corneil du Plessis

Constructors

Link copied to clipboard
constructor(fsm: StateMachineBuilder<S, E, C, A, R>)

Properties

Link copied to clipboard

Functions

Link copied to clipboard

Returns the completed fsm.

Link copied to clipboard

Defines a section for default behaviour for the state machine.

Link copied to clipboard
fun initialState(deriveInitialState: StateQuery<C, S>): DslStateMachineHandler<S, E, C, A, R>

Defines an expression that will determine the initial state of the state machine based on the values of the context.

Link copied to clipboard
fun initialStates(deriveInitialMap: StateMapQuery<C, S>): DslStateMachineHandler<S, E, C, A, R>

Provides for a list of pairs with state and map name that will be pushed and the last entry will be popped and become the current map. This is required when using state machine with named maps.

Link copied to clipboard
fun invariant(message: String, condition: Condition<C>): DslStateMachineHandler<S, E, C, A, R>
Link copied to clipboard

Defines an action that will be invoked after a transition to a new state. Any exceptions thrown by the action will be ignored.

Link copied to clipboard
fun stateMap(name: String, validStates: Set<S>, handler: DslStateMapHandler<S, E, C, A, R>.() -> Unit): DslStateMapHandler<S, E, C, A, R>

creates a named statemap

Link copied to clipboard
fun whenState(currentState: S, handler: DslStateMapEventHandler<S, E, C, A, R>.() -> Unit): DslStateMapEventHandler<S, E, C, A, R>

Defines a section for a specific state.