AsyncStateMapDefinition

class AsyncStateMapDefinition<S, E, C, A, R>(val name: String?, val validStates: Set<S>, val invariants: Set<Pair<String, Condition<C>>>, val transitionRules: Map<Pair<S, E>, AsyncTransitionRules<S, E, C, A, R>>, val defaultTransitions: Map<E, DefaultAsyncTransition<S, E, C, A, R>>, val entryActions: Map<S, DefaultEntryExitAction<C, S, A>>, val exitActions: Map<S, DefaultEntryExitAction<C, S, A>>, val defaultActions: Map<S, DefaultAsyncStateAction<C, S, E, A, R>>, val automaticTransitions: Map<S, AsyncTransitionRules<S, E, C, A, R>>, val timerDefinitions: Map<S, AsyncTimerDefinition<S, E, C, A, R>>, val globalDefault: DefaultAsyncStateAction<C, S, E, A, R>?, val defaultEntryAction: DefaultEntryExitAction<C, S, A>?, val defaultExitAction: DefaultEntryExitAction<C, S, A>?, val afterStateChangeAction: AsyncStateChangeAction<C, S>?)

Constructors

Link copied to clipboard
constructor(name: String?, validStates: Set<S>, invariants: Set<Pair<String, Condition<C>>>, transitionRules: Map<Pair<S, E>, AsyncTransitionRules<S, E, C, A, R>>, defaultTransitions: Map<E, DefaultAsyncTransition<S, E, C, A, R>>, entryActions: Map<S, DefaultEntryExitAction<C, S, A>>, exitActions: Map<S, DefaultEntryExitAction<C, S, A>>, defaultActions: Map<S, DefaultAsyncStateAction<C, S, E, A, R>>, automaticTransitions: Map<S, AsyncTransitionRules<S, E, C, A, R>>, timerDefinitions: Map<S, AsyncTimerDefinition<S, E, C, A, R>>, globalDefault: DefaultAsyncStateAction<C, S, E, A, R>?, defaultEntryAction: DefaultEntryExitAction<C, S, A>?, defaultExitAction: DefaultEntryExitAction<C, S, A>?, afterStateChangeAction: AsyncStateChangeAction<C, S>?)

Properties

Link copied to clipboard

This action will be invoked after a change in the state of the statemachine. This machine will catch and ignore any exceptions thrown by the handler.

Link copied to clipboard

This a map of TransitionRules by state for automatic transitions.

Link copied to clipboard

This is a map of default actions for event on specific startState.

Link copied to clipboard

This is the default action that will be invoked when entering any state when no other action has been matched.

Link copied to clipboard

This is the default action that will be invoked when exiting any state when no other action has been matched.

Link copied to clipboard

The default transitions will be used if no transition of found matching a given event

Link copied to clipboard

This is a map of actions keyed by the state. A specific action will be invoked when a state is entered.

Link copied to clipboard

This is a map of actions keyed by the state. A specific action will be invoked when a state is exited.

Link copied to clipboard

This is the action that will be invoked of no other has been matched

Link copied to clipboard

Invariant conditions are checked before and after every transition and will throw an InvariantException if false

Link copied to clipboard
val name: String?

The name of the statemap. The top-level state map name is null

Link copied to clipboard

The timer definitions will be activated on entry to state and deactivated on state exit

Link copied to clipboard

transitionRule contains a map of TransitionRules that is keyed by a Pair of state,event This will be the most common transition rule.

Link copied to clipboard

A set of the valid states for this map.

Functions

Link copied to clipboard
fun allowed(given: S, includeDefault: Boolean = false): Set<E>

This function will provide the set of allowed events given a specific state. It isn't a guarantee that a subsequent transition will be successful since a guard may prevent a transition. Default state handlers are not considered.

Link copied to clipboard
fun eventAllowed(event: E, given: S, includeDefault: Boolean): Boolean

This function will provide an indicator if an event is allowed for a given state. When no state transition is declared this function will return false unless includeDefault is true and there is a default transition of handler for the event.