-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Breaking out of nested cursor in subprocess block #42
Comments
Investigating... |
I want to try and fix it, I want to make it work like we both expect, but it's not that easy. I'll get back to it later today. Thanks for reporting it! |
I simplified the hanging test: def test_nested_break_does_not_reach_ref
pdef = Ruote.process_definition do
cursor :tag => 'main' do
cursor do
bravo
end
cursor do
alpha
end
end
charly
end
alpha = @dashboard.register_participant :alpha, Ruote::StorageParticipant
bravo = @dashboard.register_participant :bravo, Ruote::StorageParticipant
charly = @dashboard.register_participant :charly, Ruote::StorageParticipant
wfid = @dashboard.launch(pdef)
wait_for(:bravo)
wi = bravo.first
wi.fields['__command__'] = [ 'break', 'main' ]
@dashboard.reply(wi)
r = @dashboard.wait_for('dispatch')
assert_equal 'charly', r['participant_name']
end There is a different behaviour between passing a command via a command expression (http://ruote.rubyforge.org/exp/command.html) and passing the command by setting "command" in the workitem. I'm still thinking how to make them uniform or introduce the distinction between direct messages and passing messages. I hope that by tomorrow I'll have a decent solution. Thanks again. |
Hi John, thanks very much. I started thinking I could accomplish what I wanted to do with I haven't had time to recreate the simplified test case, but wanted to mention it in case it helps things. Thanks! |
Hi John, From the other thread I was able to simplify the failing test case a bit: def test_nested_rewind_hangs
pdef = Ruote.process_definition do
cursor :tag => "main" do
cursor do
bravo
end
alpha
end
charly
end
@dashboard.register '.+', Ruote::StorageParticipant
wfid = @dashboard.launch(pdef)
wait_for_and_proceed(@dashboard, :bravo) {|wi| wi.fields["__command__"] = ["break", "main"] }
wait_for(:charly)
end
def wait_for_and_proceed(dashboard, participant_name, &block)
wait_for(participant_name)
wi = dashboard.storage_participant.by_participant(participant_name.to_s).first
yield wi if block_given?
dashboard.storage_participant.proceed(wi)
end |
I'm having some trouble with breaking out to a main cursor from within a cursor in a subprocess block. I've set up two test cases to illustrate what's going on below. Am I trying to do something unsupported/wacky or would you expect both of these test cases to pass?
Thanks!
Chris
The text was updated successfully, but these errors were encountered: