private static void DefineMachine(IAsyncStateMachine <State, Event> fsm) { fsm.In(State.A) .On(Event.S2).Goto(State.S2) .On(Event.X); fsm.In(State.B) .On(Event.S).Goto(State.S) .On(Event.X); fsm.DefineHierarchyOn(State.S) .WithHistoryType(HistoryType.Deep) .WithInitialSubState(State.S1) .WithSubState(State.S2); fsm.In(State.S) .On(Event.B).Goto(State.B); }