On Mon, Jun 14, 2010 at 09:11:37AM +0200, Asier wrote:
> El 10/06/2010 3:45, John Mettraux escribió:
> 
> >you could pass 'parameters' to your subprocess :
> >
> >   http://ruote.rubyforge.org/exp/subprocess.html
> >   under 'passing attributes as variables'
> >
> >For example :
> >
> >---8<---
> >Ruote.process_definition do
> >
> >   sequence do
> >     asier_participant :user =>  'juan'
> >     asier_participant :user =>  'mafalda'
> >   end
> >
> >   define :name =>  'asier_participant' do
> >     participant :ref =>  '${v:user}'
> >     participant :ref =>  '${user}' :if =>  '${user}'
> >   end
> >end
> >--->8---
> >
> >Please note that the user is passed to the subprocess as a variable (no 
> >conflict with your subsequent 'user' field).
> 
> This exactly what I'm looking for! Lots of thanks, John. I think
> sometimes you must feel like a teacher with awkward students.

Hello Asier,

it's more like "I wish I had the time to document this or that feature more 
thoroughly" or "I wish I had the time to make the doc better".


> >(I assume it's OK for you to translate to XML by yourself).
> >
> >Note : these days I'm using ruote + rails a lot, I'm using a 
> >StorageParticipant and a workitem
> >field named 'user'. All the delegation occurs without the workitem leaving 
> >the storage participant,
> >by simply modifiying the value of this 'user' field. Many possibilities.
> 
> I don't understand this approach: "all the delegation occurs without
> the workitem leaving the storage participant".
> 
> Like in a loop?
> 
> set 'user' => 'asier'
> repeat do
>   participant '${user}'
>   stop :unless => "${user}'
> end

This is a possible variant (in fact you've just described the 'universal' 
sequential process).

Not at all. The delegation/assignement mechanism I wrote about is not modelled 
in the process definition, it happens without engine control.

For example, this process flows from an auditor (role) to a supervisor (role) :

  sequence do
    auditor
    supervisor
  end

If I have a "catch all" participant like :

  sp = engine.register_participant '.+', Ruote::StorageParticipant

I can do things like :

  my_workitems = sp.by_field('user', my_username)

  unassigned_workitems = sp.by_field('user')

I can assign to other people

  wi = my_workitems.first
  wi.fields['user'] = 'asier'
  sp.update(wi)

I can list your workitems

  asier_workitems = sp.by_field('user', 'asier')

...


Hope it helps, 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

Reply via email to