Statemachine and skipping a state
I am currently experimenting with the state machine (from statemachine.org) by using the enhanced event prototype for Robotlegs. Only I am failing to understand how I can move to a different state. I have added three more states.
My idea is to have one state which can only be entered when a
flag is set in a model, if it's false it should
fall-back to different state. For example, you have the following
states: SECOND, THIRD
Now by default it will always move to the
SECOND-state via the NEXT-action only
when the flag is FALSE is should skip
SECOND and hop to THIRD instead. Only I
have looked at the documentation of the state-machine class but
it's not obvious for me how to do this. At the moment it looks like
I would need to define a SKIP_TO_THIRD action to all
state definition in the XML file.Because in this project you can
move to SECOND from states FOURTH
too.
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
| ? | Show this help |
|---|---|
| ESC | Blurs the current field |
Comment Form
| r | Focus the comment reply box |
|---|---|
| ^ + ↩ | Submit the comment |
You can use Command ⌘ instead of Control ^ on Mac
1 Posted by Weyert on 18 May, 2011 11:12 AM
Also looks like state cancelled event never gets called. Making it really hard to recover from cancelled state transitions :(
Weyert closed this discussion on 19 May, 2011 09:13 PM.