Hello John,
>
> There are some scoping rules. Mostly subprocesses and concurrent branches get
> a new scope.
>
> This works :
>
> ---8<---
> require 'rubygems'
> require 'ruote'
>
> engine = Ruote::Engine.new(Ruote::Worker.new(Ruote::HashStorage.new()))
>
> pdef = Ruote.define do
> concurrent_iterator :on => (1..5).to_a do
> sequence do
> set 'v:v' => '>${v:i}<'
> echo '${v:i} nada ${v:v}'
> end
> end
> end
>
> wfid = engine.launch(pdef)
>
> engine.wait_for(wfid)
> --->8---
>
> You probably want to do something like
>
> ---8<---
> pdef = Ruote.define do
> concurrent_iterator :on => (1..5).to_a do
> sequence do
> set 'v:/v' => '>${v:i}<' # <------------------------------ notice the /
> echo '${v:i} nada ${v:v}'
> end
> end
> end
> --->8---
>
> But then you'll get an output of
>
> 1 nada >5<
> 2 nada >5<
> 3 nada >5<
> 4 nada >5<
> 5 nada >5<
>
> Last 'set' to execute wins.
>
> Try to avoid using process variables in such concurrency cases. Let the merge
> do its work.
It's clear now. Thanks for explanation!
> > And finally, I have a small suggestion regarding "set" syntax.
> > Sometimes it needs to append value to array, without care about
> > array's index. It could look like this:
> > set :field => 'array_field.+', :value => 'some_val'
> > Maybe you will find this useful.
>
> Could inc/dec be what you need ?
>
> http://ruote.rubyforge.org/exp/inc.html
I'm a bit confused... still know little about ruote.
>
> Isn't putting too much data manipulation logic in a business process a bit
> off ? A participant that does all the complex data manipulation in plain ruby
> is probably better.
>
> What do you think ?
>
You are absolutely right. I still learn ruote and try different
approaches of building process logic to see what happened and how it
works.
Many thanks for advice!
Best regards, Oleg
--
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