Finite State Machine behavior for the C3 runtime.
this has already been done - github.com/armandoalonso/fsm
Best Regards!!!