# File lib/ruote/exp/flowexpression.rb, line 373 def cancel (flavour) return reply_to_parent(h.applied_workitem) if h.children.empty? # # there are no children, nothing to cancel, let's just reply to # the parent expression do_persist || return # # before firing the cancel message to the children # # if the do_persist returns false, it means it failed, implying this # expression is stale, let's return, thus discarding this cancel message children.each do |cfei| # # let's send a cancel message to each of the children # # maybe some of them are gone or have not yet been applied, anyway, # the message are sent @context.storage.put_msg( 'cancel', 'fei' => cfei, 'parent_id' => h.fei, # indicating that this is a "cancel child" 'flavour' => flavour) end #if ! children.find { |i| Ruote::Exp::FlowExpression.fetch(@context, i) } # # # # since none of the children could be found in the storage right now, # # it could mean that all children are already done or it could mean # # that they are not yet applied... # # # # just to be sure let's send a new cancel message to this expression # # # # it's very important, since if there is no child to cancel the parent # # the flow might get stuck here # @context.storage.put_msg( # 'cancel', # 'fei' => h.fei, # 'flavour' => flavour) #end end