Created
July 4, 2011 09:07
-
-
Save anonymous/1063110 to your computer and use it in GitHub Desktop.
Test on the :union option for concurrent participant.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'pp' | |
require 'ruote' | |
engine = Ruote::Engine.new(Ruote::Worker.new(Ruote::HashStorage.new())) | |
#engine.noisy = true | |
engine.register_participant :alpha do |workitem| | |
workitem.fields['choses'] = { 'truc' => 'bidule', 'machin' => 'chose'} | |
end | |
engine.register_participant :beta do |workitem| | |
workitem.fields['choses'] = { 'curt' => 'eludib', 'nicham' => 'esoch'} | |
end | |
engine.register_participant :delta do |workitem| | |
pp workitem | |
end | |
proc = Ruote.process_definition do |workitem| | |
sequence do | |
concurrence :merge_type => :union do | |
participant :beta | |
participant :alpha | |
end | |
participant :delta | |
end | |
end | |
id = engine.launch(proc) | |
engine.wait_for(id) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment