lib/ruote/exp/fe_cancel_process.rb in ruote-2.2.0 vs lib/ruote/exp/fe_cancel_process.rb in ruote-2.3.0

- old
+ new

@@ -1,7 +1,7 @@ #-- -# Copyright (c) 2005-2011, John Mettraux, jmettraux@gmail.com +# Copyright (c) 2005-2012, John Mettraux, jmettraux@gmail.com # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell @@ -47,16 +47,30 @@ # 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 + # class CancelProcessExpression < FlowExpression - names :cancel_process, :terminate + names :cancel_process, :terminate, :kill_process def apply - @context.storage.put_msg('cancel_process', 'wfid' => h.fei['wfid']) + @context.storage.put_msg( + 'cancel_process', + 'wfid' => h.fei['wfid'], + 'flavour' => name == 'kill_process' ? 'kill' : nil) end def reply(workitem) # never called