Closed kevindewalt closed 9 years ago
I'm used to being able to do this in AASM and am wondering this too.
In workflow
DSL every transition has to be explicitly specified.
In your example I am wondering, if really every state needs a cancel
event or all but one (cancelled
). How we could specify such an exception - via some naming convention, via additional syntax like
workflow do
event :cancel, transitions_to: :canceled, except: [:cancelled, :some_other]
This can quickly become messy... I mean both, in usage (DSL) and implementation ;-) (workflow
library).
I'm trying to DRY up some code. Is there a way to create 'global' events?
For instance, suppose a customer can transition through multiple states and the customer could transition to :canceled from any one of them.
Do I have to create the :cancel event for every state? for instance ...