On Transition Issues with Multiple Nested States #115
-
`
As shown in my code, my goal is to: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hello, first of all I can see mutiple transitions on SwitchEvent. which one you expect to be triggered? have you tried enabling logging for the state machine? it should print transitions so you can see what is happening in runtime please let me know if it does not help. |
Beta Was this translation helpful? Give feedback.
I see, it looks like this is caused by the misuse of transition DSL. Each single Event can be processed only by single transition. There is no top-down flow in event processing mechanism in the library.
A transition can have multiple onTriggered listeners, but only one transition can be triggered by each single event.
To emultate such top-down behavior as you desired, you can declare one top-level transition with transitionConditionally method and analyse activeStates of the state machine in it's callback lamdba to select next state conditionally.