Skip to content

Commit

Permalink
made sure to always deregister :tag
Browse files Browse the repository at this point in the history
  • Loading branch information
jmettraux committed Jun 28, 2009
1 parent 9f826e5 commit bf2622d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
10 changes: 5 additions & 5 deletions lib/ruote/exp/flowexpression.rb
Expand Up @@ -515,6 +515,11 @@ def apply_child (child_index, workitem, forget=false)

def reply_to_parent (workitem)

if @tagname
unset_variable(@tagname)
wqueue.emit(:expressions, :left_tag, :tag => @tagname, :fei => @fei)
end

if @in_error

trigger_on_error(workitem)
Expand All @@ -525,11 +530,6 @@ def reply_to_parent (workitem)

else

if @tagname
unset_variable(@tagname)
wqueue.emit(:expressions, :left_tag, :tag => @tagname, :fei => @fei)
end

pool.reply_to_parent(self, workitem)
end
end
Expand Down
22 changes: 15 additions & 7 deletions test/functional/ft_7_tags.rb
Expand Up @@ -45,21 +45,23 @@ def test_tag

# making sure a tag is removed in case of on_cancel
#
def _test_on_cancel
def test_on_cancel

pdef = Ruote.process_definition do
sequence :tag => 'a', :on_cancel => 'decom' do
sequence do
sequence :tag => 'a', :on_cancel => 'decom' do
alpha
end
alpha
end
define 'decom' do
bravo
alpha
end
end

alpha = @engine.register_participant :alpha, Ruote::HashParticipant
bravo = @engine.register_participant :bravo, Ruote::HashParticipant

noisy
#noisy

wfid = @engine.launch(pdef)

Expand All @@ -68,10 +70,16 @@ def _test_on_cancel
assert_equal 1, @engine.process_status(wfid).tags.size

fei = alpha.first.fei.dup
fei.expid = '0_1'
fei.expid = '0_1_0'
@engine.cancel_expression(fei)

wait_for(:bravo)
wait_for(:alpha)

assert_equal 0, @engine.process_status(wfid).tags.size

alpha.reply(alpha.first)

wait_for(:alpha)

assert_equal 0, @engine.process_status(wfid).tags.size
end
Expand Down

0 comments on commit bf2622d

Please sign in to comment.