Do Ruby/Rails state machines exist that execute event transitions when a state change occurs?
Posted
by
Bryan
on Stack Overflow
See other posts from Stack Overflow
or by Bryan
Published on 2010-12-31T21:03:14Z
Indexed on
2010/12/31
21:53 UTC
Read the original article
Hit count: 307
Hello All,
Hopefully this isn't a silly question and I'm just not overlooking something in Ruby/Rails state machines (AASM, Transitions, AlterEgo, etc). From what I can tell, these state machine implementations operate on the preface that an event will get fired and the appropriate transition for that event will be triggered based on the old and new state. However, they don't seem to work the other way; say a user wants to change state from 'created' to 'assigned' and have the correct transition occur (rather than firing the event that causes the current state to be transitioned to the new state).
Essentially, I want the user to be able to select a new state from a select box of available states and have the appropriate transition, guards, success callbacks, etc executed. Does anyone know if the existing state machine implementations support this?
© Stack Overflow or respective owner