My problem is that I have an application that gives a user the ability to define a workflow (states, transitions, events, etc.) and have my application know how it reacts (transitions) based on the users workflow.
I have looked at several state machine gems, such as AASM, and I see how I could use the gem to pre-define the state machine but if the state machine needed to change, it looks like I would have to modify the code and re-deploy. I have been arguing with my coworker about how we could / could not utilize a state machine gem to do what we want but, to me, they all seem to define a static state machine and changes to that state machine require code changes.
His suggestion is dynamically modifying the Ruby class to match the users workflow changes. My thought is that the states, transitions, events, guards, etc. are persistable objects that the user modifies through the our API. Neither of our current lines of thought seem to work with the current Ruby state machines without some major modification on top of those gems.
The place I keep looking at as an example solution is JIRA and how you can define states, transitions, and other workflow attributes for a project dynamically.
The state_machine gem allows this:
https://github.com/pluginaweek/state_machine#static--dynamic-definitions