Simple Transitions
Simple transitions are declared using the 'on' builder.
The above examples creates a Finite State Machine (machine) which declares its initial state as being Solid
and then declares a single transition Solid -> Liquid when the event OnMelted
is applied to the FSM.
We can now write a unit test that validates our state machine when `machine.applyEvent(OnMelted())` is called.
Many transitions
A State can have any number of on
transitions including multiple transitions for the same Event providing a guard conditions is used.
See the section on Guard Conditions for details on defining conditional transitions.
Last updated