[msm] Manually setting next state
Hi, Is there a way to manually set the next state for the state machine. I have an orthogonal region defined for handling errors, where Error is an interruptible state. ---------- ------------- | | ----------->| Error | | Ok | | | ---------- ------------- This is similar to the example here : http://svn.boost.org/svn/boost/trunk/libs/msm/doc/HTML/examples/Orthogonal-d... Once the state machine recovers from the error, I would like to start from the initial state again in the main orthogonal region. Is there a way to do this ? Thanks! Samriti
----- Original Message ----- From: samriti katoch Newsgroups: gmane.comp.lib.boost.user To: boost-users@lists.boost.org Sent: Wednesday, May 22, 2013 4:12 PM Subject: [msm] Manually setting next state Hi, Is there a way to manually set the next state for the state machine. I have an orthogonal region defined for handling errors, where Error is an interruptible state. ---------- ------------- | | ----------->| Error | | Ok | | | ---------- ------------- This is similar to the example here : http://svn.boost.org/svn/boost/trunk/libs/msm/doc/HTML/examples/Orthogonal-d... Once the state machine recovers from the error, I would like to start from the initial state again in the main orthogonal region. Is there a way to do this ? Thanks! Samriti ------------------------------------------------------------------------------ _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users Hi, technically, yes, you could call current_state() on the fsm, which gives you an array of ids for all regions, which you could change, but it's not good style, the UML conform way would be to send yourself an event in the transition Error -> Ok, which would move the first region to the initial (or any other) state. Of course, this costs more transitions. HTH, Christophe
participants (2)
-
Christophe Henry
-
samriti katoch