Closed oliver-goetz closed 3 years ago
Hello @oliver-goetz,
thank you for the report. This is the nested version of #214 which hasnt been detected since we never tested nested model callbacks where the machine acts as a model. The bug and the lack of testing should be fixed now.
This should be fixed with 0.8.4. Feel free to comment if you face more issues using nested states and model callbacks. I will reopen the issue if the bug still persists
This is working too, thanks 👍
When using a joined Model/Machine class together with a LockedHierarchicalMachine it handles custom onenter/onexit for nested states different than a HierarchicalMachine since version 0.8.0.
I setup a small working example using a template from README.md
The output includes the printed lines of all 4 custom onenter and onexit methods.
Now i justed change the import line to
from transitions.extensions import LockedHierarchicalMachine as Machine
and the whole program looks like thisThe new output looks like this.
The custom on_enter/on_exit methods of
caffeinated_running
state are not executed anymore. Analyzing the class shows that there are methods foron_enter_caffeinated_running
andon_exit_caffeinated_running
. But those are the generated functions you can use to add custom callbacks.I would expect that custom onenter and onexit methods of a LockedHierarchicalMachine are handled the same way than those of the HierarchicalMachine as it was up to version 0.7.2.