-
Notifications
You must be signed in to change notification settings - Fork 19
Description
in https://hsmcpp.readthedocs.io/en/latest/features/transitions/transitions.html#overview you state
It is possible to define multiple transitions between two states. As a general rule, these transitions should be exclusive, but HSM doesn’t enforce this. If multiple valid transitions are found for the same event then the first applicable one will be used (based on registration order). But this situation should be treated by developers as a bug in their code since it most probably will result in unpredictable behavior.
in https://hsmcpp.readthedocs.io/en/latest/features/transitions/transitions.html#priority-of-transitions you state
Ideally, when designing state machine, you should avoid having multiple transitions which could be valid at the same time. This will make understanding the logic and debugging easier. But if for some reason your state machine will contain such transition, hsmcpp library will still handle them in a deterministic and predictable manner:
all valid transitions will be executed if they are defined on the same level;
self transitions are always executed before any outgoing transitions;
if transitions are defined on multiple levels (for example between substates and on the same level as a parent):
internal transitions between substates always have the highest priority. Outer transitions will be ignored;
Which one is accurate?
Also, if the second one is true, why would you want to use something like this? I don't know any use case in practice on why you would want to use that? That would be quite a sever design flaw in my opinion.