acts_as_state_machine successor workflow

While acts_as_state_machine was not maintained for some years (the revived version can be now found on github), a couple of successor libraries sprang up. My favourite was workflow by Ryan Allen.

Unfortunately, after we had adopted it in our current project, we’ve found some undeterministic behaviour in the ActiveRecord integration area. So I’ve streamlined the integration code by:

  1. strictly separating the implementation between the state machine/workflow specification (states, transitions) and the model entity state

  2. putting all the model enhancements into modules and initiating the admixing the state machine functionality in the self.included method. The modules are::

    • WorkflowClassMethods
    • WorkflowInstanceMethods
    • ActiveRecordInstanceMethods

But you do not need to know all that implementation details to be able to use the workflow library. Just grab my version from github.

Comments

blog comments powered by Disqus