-
Beta Was this translation helpful? Give feedback.
Answered by
crozone
Jul 20, 2023
Replies: 1 comment 1 reply
-
Consider making "In Progress" a superstate that encapsulates "Paused" and "Running". Then you can have another "Stopped" state as the initial state. The "Start" trigger would transition "Stopped" -> "In Progress". The initial state for "In Progress" would be "Running". The "Pause" trigger would transition "Running" -> "Paused". The "Resume" trigger would transition "Paused" -> "Running". The "End" trigger would transition "In Progress" -> "Stopped". Resource cleanup occurs on entry to "Stopped". |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
vkensou
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Consider making "In Progress" a superstate that encapsulates "Paused" and "Running". Then you can have another "Stopped" state as the initial state.
The "Start" trigger would transition "Stopped" -> "In Progress". The initial state for "In Progress" would be "Running".
The "Pause" trigger would transition "Running" -> "Paused".
The "Resume" trigger would transition "Paused" -> "Running".
The "End" trigger would transition "In Progress" -> "Stopped". Resource cleanup occurs on entry to "Stopped".