| 11 | Finite State Machines are split into two section |
| 12 | * Stateless Work |
| 13 | * State Dependent Work |
| 14 | === example === |
| 15 | {{{ |
| 16 | FSM |
| 17 | ON START { ... } // As the FSM starts up ... execute the lambda |
| 18 | ON STOP { ... } // As the FSM is shut down |
| 19 | ON STATE CHANGE { ... } // Perfomed whenever the state changes |
| 20 | ON RECEPTION { ... } // Done on the reception of any signal |
| 21 | ON UNRECOGNISED { ... } // Done when a recieved signal is NOT acted upon |
| 22 | ON ERROR { ... } // Done when the ERROR exception is called |
| 23 | ON signalIdent { ... } // Done when a specific signal is received regardless of state |
| 24 | |
| 25 | INITIAL STATE firstState |
| 26 | ON ENTRY { ... } |
| 27 | ON EXIT { ... } |
| 28 | ON RECEPTION { ... } |
| 29 | ON UNRECOGNISED { ... } |
| 30 | ON ERROR { ... } |
| 31 | ON signalIdent { ... } |
| 32 | }}} |