DslStateMapEventHandler

class DslStateMapEventHandler<S, E, C, A, R>(currentState: S, fsm: StateMapBuilder<S, E, C, A, R>)

This class is used in dsl to handle the state declarations.

Author

Corneil du Plessis

Constructors

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

Functions

Link copied to clipboard
fun automatic(targetState: S, action: SyncStateAction<C, A, R>?)
fun automatic(targetState: S, guard: StateGuard<C, A>, action: SyncStateAction<C, A, R>?)
Link copied to clipboard
fun automaticPop(action: SyncStateAction<C, A, R>?)
fun automaticPop(targetState: S, action: SyncStateAction<C, A, R>?)
fun automaticPop(guard: StateGuard<C, A>, action: SyncStateAction<C, A, R>?)
fun automaticPop(targetState: S, guard: StateGuard<C, A>, action: SyncStateAction<C, A, R>?)
fun automaticPop(targetMap: String, targetState: S, action: SyncStateAction<C, A, R>?)
fun automaticPop(targetMap: String, targetState: S, guard: StateGuard<C, A>, action: SyncStateAction<C, A, R>?)
Link copied to clipboard
fun automaticPush(targetMap: String, targetState: S, action: SyncStateAction<C, A, R>?)
fun automaticPush(targetMap: String, targetState: S, guard: StateGuard<C, A>, action: SyncStateAction<C, A, R>?)
Link copied to clipboard
fun default(action: DefaultStateAction<C, S, E, A, R>)

Defines a default action when no other transition are matched

Link copied to clipboard

Defines an action to be performed before transition causes a change in state

Link copied to clipboard
fun onEvent(event: E, action: SyncStateAction<C, A, R>?): DslStateMapEventHandler<S, E, C, A, R>

Defines a transition where an on causes an action but doesn't change the state.

fun onEvent(event: EventState<E, S>, action: SyncStateAction<C, A, R>?): DslStateMapEventHandler<S, E, C, A, R>

Defines a transition when the state is the currentState and the on is received. The state is changed to the targetState.

fun onEvent(event: E, guard: StateGuard<C, A>, action: SyncStateAction<C, A, R>?): DslStateMapEventHandler<S, E, C, A, R>

Defines a guarded transition where an on causes an action but doesn't change the state and will only be used if the guard expression is met. This will be an internal transition with no change in state.

fun onEvent(event: EventState<E, S>, guard: StateGuard<C, A>, action: SyncStateAction<C, A, R>?): DslStateMapEventHandler<S, E, C, A, R>

Defines a guarded transition. Where the transition will only be used if the guarded expression is met

Link copied to clipboard
fun onEventPop(event: E, action: SyncStateAction<C, A, R>?): DslStateMapEventHandler<S, E, C, A, R>
fun onEventPop(event: Pair<E, S>, action: SyncStateAction<C, A, R>?): DslStateMapEventHandler<S, E, C, A, R>
fun onEventPop(event: E, guard: StateGuard<C, A>, action: SyncStateAction<C, A, R>?): DslStateMapEventHandler<S, E, C, A, R>
fun onEventPop(event: Pair<E, S>, guard: StateGuard<C, A>, action: SyncStateAction<C, A, R>?): DslStateMapEventHandler<S, E, C, A, R>
fun onEventPop(event: E, targetMap: String, targetState: S, action: SyncStateAction<C, A, R>?): DslStateMapEventHandler<S, E, C, A, R>
fun onEventPop(event: E, targetMap: String, targetState: S, guard: StateGuard<C, A>, action: SyncStateAction<C, A, R>?): DslStateMapEventHandler<S, E, C, A, R>
Link copied to clipboard
fun onEventPush(event: E, targetMap: String, targetState: S, action: SyncStateAction<C, A, R>?): DslStateMapEventHandler<S, E, C, A, R>

Defines a push transition on event for a targetMap and targetState.

fun onEventPush(event: E, targetMap: String, targetState: S, guard: StateGuard<C, A>, action: SyncStateAction<C, A, R>?): DslStateMapEventHandler<S, E, C, A, R>

Defines a push transition on event for a targetMap and targetState when the guard evaluates to true

Link copied to clipboard

Defines an action to be performed after a transition has changed the state