StateMachine

data class StateMachine(matrix: Map<State, Map<EventType, State>> = emptyMap())

Represents a StateMachine that defines the lifecycle of a BusinessObjectType. A state machine is defined by a set of States and Transitions between them. Using the nextState method, the next State of the StateMachine can be retrieved for a given State and EventType. This is the way BusinessObjects evolve through their lifecycle.

Constructors

Link copied to clipboard
constructor(matrix: Map<State, Map<EventType, State>> = emptyMap())

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
Link copied to clipboard
fun nextState(currentState: State, event: EventType): Either<EventHandlingError, State>
Link copied to clipboard
fun states(): List<State>
Link copied to clipboard
open override fun toString(): String