Execution Context
class ExecutionContext<State : Enum<State>, Event : Enum<Event>, GuardKey : Enum<GuardKey>, ActionKey : Enum<ActionKey>, Memento>
Content copied to clipboard
An ExecutionContext represents a running finite state machine. In order to execute a step, it maintains a reference to the executor, the current state, and a client-provided memento which will be passed as the sole argument of every action invocation.
To obtain a new execution context, a client should call StateMachine.createExecutionContext on an established FSM.
To execute a step, a client should call handleEvent with an appropriate event.
Author
Mark van Gulik
Todd L Smith
Parameters
State
The state type.
Event
The event type.
Guard Key
The guard key type.
Action Key
The action key type.
Memento
The memento type.
machine
The state machine to instantiate as an ExecutionContext.
memento
The object which should be passed to all actions.