Replies: 2 comments 1 reply
-
Can you share code? In general, there is possibly a better way to model transitioning to a parent state, depending on the situation. For instance, you can make use of Think of it in a real-world scenario: a subordinate would never tell some leader what to do. Instead, a subordinate would notify the leader that they are done, and the leader will decide what to do given that information. |
Beta Was this translation helpful? Give feedback.
-
Here's a snippet from a machine that made me ask this question. Basically this part of the machine is in an idle state until you attempt to switch branch, where it switches to a state that handles that and bounces through an error state if something goes wrong. But I always want it to end up back in the idle state.
|
Beta Was this translation helpful? Give feedback.
-
How do people transition to parent states? It's easy to transition to child states with
.
but I'm not aware of any way to go back up the state hierarchy. Is this because it's bad practice? The way I do it currently is assign an id with the same name as the state to any states I need to transition to that aren't direct siblings/childs of the states that transition to it, which works fine, just feels like a bit of a hack.Beta Was this translation helpful? Give feedback.
All reactions