You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So far this library has been awesome, I'd really like to get this one feature working but for some reason transitioning back to a history state is mangling some of my parallel state machines.
I have four parallel state machines running under the "Main" state machine:
My button state machine is pretty straightforward and looks something like this:
When the button is released, it will transition my "Workout" state machine from "Workout__Active__Running" to "Workout__Active__Paused" and vice versa. "Workout__Active__Running" has some nested states that I'd like to restore when coming back from "Workout__Active__Paused":
Here's my workoutActive.scxml with the irrelevant bits removed (note that I'm using the xi:include feature so these states all get preprended with "Workout__Active__" in my generated state machine):
Something gets screwed up when trying to transition to "RunningHistory" from the "Paused" state. I've printed out the active states during the transition:
Is right before the transition back to the history, and all seems good.
It re-enters the "Workout__Active__Running" state, but for some reason "Haptics__Off", "Led__Blinking_Off", and "Button_Released" (the new button state) get removed.
It re-enters the "Workout__Active__Running_Squeezing" but now the "Button", "Haptics" and "Led_Blinking" states are gone
So it seems like it is popping off the leaf states on the parallel state machines for each history state it restores.
So looks like when we enter a history state, it pushes "forced" transition events for each transition to get back to the previous states. But it does this on all active states, so my parallel states get forced into invalid states.
Should those lines be checking event.forcedTransitionsInfo.fromState to make sure they are forcing from the expected state?
So far this library has been awesome, I'd really like to get this one feature working but for some reason transitioning back to a history state is mangling some of my parallel state machines.
I have four parallel state machines running under the "Main" state machine:
My button state machine is pretty straightforward and looks something like this:
When the button is released, it will transition my "Workout" state machine from "Workout__Active__Running" to "Workout__Active__Paused" and vice versa. "Workout__Active__Running" has some nested states that I'd like to restore when coming back from "Workout__Active__Paused":
Here's my workoutActive.scxml with the irrelevant bits removed (note that I'm using the
xi:include
feature so these states all get preprended with "Workout__Active__" in my generated state machine):Something gets screwed up when trying to transition to "RunningHistory" from the "Paused" state. I've printed out the active states during the transition:
So it seems like it is popping off the leaf states on the parallel state machines for each history state it restores.
My expected final state:
Hopefully this makes sense. Let me know if it doesn't and I'll try to provide more information.
The text was updated successfully, but these errors were encountered: