Class OpenWFE::CancelProcessExpression
In: lib/openwfe/expressions/fe_cancel.rb
Parent: FlowExpression

This expression cancels the current process instance. Use with care.

    <sequence>
        <participant ref="before" />
        <cancel-process />
        <participant ref="after" />
    </sequence>

the message "after" will never get printed.

Use rather in scenarii like that one :

    class TestDefinition1 < ProcessDefinition
        def make
            process_definition :name => "25_cancel", :revision => "1" do
                sequence do
                    participant "customer"
                    _cancel_process :if => "${f:no_thanks} == true"
                    concurrence do
                        participant "accounting"
                        participant "logistics"
                    end
                end
            end
        end
    end

Note that the expression accepts an "if" attribute.

Methods

apply  

Included Modules

ConditionMixin

Public Instance methods

apply / reply

[Source]

     # File lib/openwfe/expressions/fe_cancel.rb, line 86
 86:         def apply (workitem)
 87: 
 88:             conditional = eval_condition(:if, workitem, :unless)
 89:                 #
 90:                 # for example : <cancel-process if="${approved} == false"/>
 91: 
 92:             return reply_to_parent(workitem) \
 93:                 if conditional == false
 94: 
 95:             #
 96:             # else, do cancel the process
 97: 
 98:             get_expression_pool.cancel_process self
 99: 
100:             # no need to reply to parent
101:         end

[Validate]