fgmacedo / python-statemachine

Python Finite State Machines made easy.
MIT License
902 stars 84 forks source link

Execute a state machine from another state machine #416

Closed sergifiUVa closed 9 months ago

sergifiUVa commented 9 months ago

Hi, i'm woking on a project where i created an actions executer which receives orders (send a robot to bedroom and say "good morning") and initiates a state machine from another .py file that executes that task.

This works good, but now i'm trying to create short modules that can be used in many tasks (for example, instead of the actions executer that calls one state machine that executes the whole "send robot to bedrom and say something", i'm looking for the action executer to call a state machine that also calls another state machine in another .py file that does "send robot to a location", and then come back to previous state machine and execute the "say something" part)

Summing up, i wanna know how to call a state machine from another state machine and when the second one ends, keep the execution of the first one.

Sorry if i didn't make myself clear

sergifiUVa commented 9 months ago

To make things clear, i wanna execute a second state machine on a state