cancel_process
Cancels a whole process instance.
pdef = Ruote.process_definition :name => 'test' do sequence do participant :ref => 'editor' concurrence do participant :ref => 'reviewer1' participant :ref => 'reviewer2' sequence do participant :ref => 'main_reviewer' cancel_process :if => '${f:over} == true' end end participant :ref => 'editor' end end
This example has a ‘main_reviewer’ with the ability to cancel the whole
process, if he sets the workitem field ‘over’ to ‘true’.
If the goal is to cancel only a segment of a process instance, the
expression ‘undo’ (Ruote::Exp::UndoExpression) is better suited.
‘terminate’
Sometimes ‘terminate’ reads better than ‘cancel_process’
Ruote.process_definition do alice :task => 'do this' terminate :if => '${no_need_for_bob}' bob :task => 'do that' charly :task => 'just do it' end