I am trying to use all method to get workitems for a particular participant.
I am not sure if it is a problem, could you please take a second to look at the following code?
pdef = Ruote.process_definition do
sequence :on_error=>:error_handler do
alpha :id => "alpha"
bravo :id => "bravo"
end
end
pdef2 = Ruote.process_definition do
sequence :on_error=>:error_handler do
alpha :id => "alpha2222"
bravo :id => "bravo2222"
end
end
@dashboard.register_participant "alpha", TimeoutParticipant
@dashboard.register_participant "bravo", TimeoutParticipant
@dashboard.register_participant :error_handler do |item|
puts "[error_handler]"
puts "class:#{item.error["class"]} message:#{item.error["message"]}"
end
#launch process1 and process2
wfid1=@dashboard.launch(pdef)
wfid2=@dashboard.launch(pdef2)
sleep(1)
#step1
puts "[all] for alpha"
puts @dashboard.participant("alpha").all.inspect
#finish work for process1
@dashboard.process(wfid1).current_work_items.each{|wi| @dashboard.storage_participant.proceed(wi)}
sleep(1)
#step2
puts "[after proceeding all] for alpha"
puts @dashboard.participant("alpha").all.inspect
As you suggested, I am using all to find all the available workitems for alpha. In step1(see comment), it correctly gives me two workitems which have id of "alpha" and "alpha222"
Then I proceed the process1. So after that, process1 should be at bravo step. I expect that the alpha participant should have only 1 workitem that is in process2(since the item in process1 is already proceeded).
But in step2, I got 2 workitems which are alpha222 and bravo. How does bravo become the workitem for alpha?
Is it a issue or do I use it in a wrong way?