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
Since the implementation relies on machine.get_triggers, the machine must be created with auto_transitions=False because the test that check the state is final will never be True because, if all the to_ methods exists, the state is never final.
I don't know if this should be mentioned in the doc or if the implementation must be changed to filter all the on_ (seems not very reliable to me either), or add a tag when accepted: False on the state, or a Final tag (meaning, it's final and not accepted)
The text was updated successfully, but these errors were encountered:
The auto_transitions keyword is just a convenient way to create a bunch of to_<state> transitions. They behave like every other transition apart from that. Since there is no restriction considering how automatically generated transitions can be used, they should imho be treated as ordinary transitions.
However, I do agree this limits the usefulness of state.Error for cases in which auto transitions are intended to act as 'dev/admin' tools. We have implemented a filter function for diagrams here which might be helpful to filter out transitions that 'look like' auto transitions. What about a keyword ignore_auto_transitions for state.Error? It increases the effort required for Error initialisation but tackles the issue locally. What do you think?
I'm not very fond of the filtering idea, the problem I see is if you create to_ method by your self, it can bites (i.e, you are not very imaginative, and every trigger you create in the transition, you call it to_). My point of view on that is it should be enough to put a big fat warning in the doc saying Error is exclusive with auto_transitions. I'm fan of the Principle of least astonishment
Since the implementation relies on
machine.get_triggers
, the machine must be created with auto_transitions=False because the test that check the state is final will never be True because, if all the to_ methods exists, the state is never final.I don't know if this should be mentioned in the doc or if the implementation must be changed to filter all the on_ (seems not very reliable to me either), or add a tag when accepted: False on the state, or a
Final
tag (meaning, it's final and not accepted)The text was updated successfully, but these errors were encountered: