Closed emclab closed 2 years ago
We end up keeping transitions_to the same state if the other paralle event hasn't been fired or to next state if all other parallel events have been fired. Here is an example for one event:
state :awaiting_review do event :review, :transitions_to => :awaiting_review, :if => proc {other_events_not_filed} event :review, :transitions_to => :next_state, :if => proc {other_event_did_filed} end
Here is an example from [Geekq/workflow][1] which we are using in our rails app:
workflow do state :new do event :submit, :transitions_to => :awaiting_review end state :awaiting_review do event :review, :transitions_to => :being_reviewed end state :being_reviewed do event :accept, :transitions_to => :accepted event :reject, :transitions_to => :rejected end state :accepted state :rejected end
The events in a state are mutually exclusive. For example, only one of events accept and reject is going to happen. How to add a parallel event like send_bill, in :awaiting_review? Both send bill and review are going to happen at the same time. Here is what we would like to have (parallel_event is NOT Geekq/workflow definition):