Hmm yeah i think an actual array returned from the stack option would
make it easier to code around, especially when things start getting
crowded:
engine.register_participant 'summary' do |workitem|
puts '... summary :'
puts "#{workitem.to_h.inspect}"
end
engine.register_participant '.+' do |workitem|
workitem.fields['result'] = "#{workitem.participant_name} : #{rand}"
end
pdef = Ruote.process_definition :name => 'test' do
sequence do
concurrence :merge_type => :isolate do
alpha
bravo
charly
end
summary
concurrence :merge_type => :isolate do
delta
echo
foxtrot
end
summary
end
end
prints:
... summary :
{"participant_name"=>"summary", "fields"=>{"0"=>{"result"=>"alpha :
0.769486208591124", "__result__"=>"alpha : 0.769486208591124"},
"1"=>{"result"=>"bravo : 0.0967022151526489", "__result__"=>"bravo :
0.0967022151526489"}, "2"=>{"result"=>"charly : 0.356126619902306",
"__result__"=>"charly : 0.356126619902306"},
"params"=>{"ref"=>"summary"}}, "fei"=>{"wfid"=>"20100222-sozeyubi",
"engine_id"=>"engine", "expid"=>"0_0_1"}}
... summary :
{"participant_name"=>"summary",
"fields"=>{"0"=>{"0"=>{"result"=>"alpha : 0.769486208591124",
"__result__"=>"alpha : 0.769486208591124"}, "1"=>{"result"=>"bravo :
0.0967022151526489", "__result__"=>"bravo : 0.0967022151526489"},
"2"=>{"result"=>"charly : 0.356126619902306", "__result__"=>"charly :
0.356126619902306"}}, "1"=>{"result"=>"delta : 0.375817757721307",
"0"=>{"result"=>"alpha : 0.769486208591124", "__result__"=>"alpha :
0.769486208591124"}, "1"=>{"result"=>"bravo : 0.0967022151526489",
"__result__"=>"bravo : 0.0967022151526489"}, "__result__"=>"delta :
0.375817757721307", "2"=>{"result"=>"charly : 0.356126619902306",
"__result__"=>"charly : 0.356126619902306"}},
"2"=>{"result"=>"foxtrot : 0.222753834904713",
"0"=>{"result"=>"alpha : 0.769486208591124", "__result__"=>"alpha :
0.769486208591124"}, "1"=>{"result"=>"bravo : 0.0967022151526489",
"__result__"=>"bravo : 0.0967022151526489"}, "__result__"=>"foxtrot :
0.222753834904713", "2"=>{"result"=>"charly : 0.356126619902306",
"__result__"=>"charly : 0.356126619902306"}},
"params"=>{"ref"=>"summary"}}, "fei"=>{"wfid"=>"20100222-sozeyubi",
"engine_id"=>"engine", "expid"=>"0_0_3"}}
..an array here would definitely be easier on the eyes. i haven't
downloaded the new version and tried stack out, but I'll let you know
when I do.
thanks,
dave
On Feb 20, 2:08 am, John Mettraux <[email protected]> wrote:
> On Sat, Feb 20, 2010 at 11:05 AM, John Mettraux <[email protected]> wrote:
>
> > I'm considering implementing a replacement for 'isolate' named 'stack'
> > (not sure about the name now).
>
> > Thus,
>
> > ---8<---
> > concurrence :merge => :highest, merge_type => :stack do
> > alpha
> > bravo
> > end
> > --->8---
>
> > would produce a workitem looking like 'fields' => { 'stack' => [ { ...
> > fields after 'alpha' ... }, { ... fields after 'bravo' ... } ] }
>
> > Tell me what you (and others on the list think). It might be way
> > simpler that the current 'isolate' behaviour.
>
> I like it, it's in.
>
> http://github.com/jmettraux/ruote/commit/a13060a86d41d2e3e68ab259f8d7...
>
> Best regards,
>
> --
> John Mettraux - http://jmettraux.wordpress.com
--
you received this message because you are subscribed to the "ruote users" group.
to post : send email to [email protected]
to unsubscribe : send email to [email protected]
more options : http://groups.google.com/group/openwferu-users?hl=en