Hello,

some of you have been asking (mostly IRC), about "dynamic participants".

One of the motivations went like "participants just for that process instance", 
that got me thinking.

The solution advocated was to register participants then unregister them via 
the process. This is possible, but sounds like a lot of work (and you have to 
unregister them).

I've been looking at an obscure feature about variables and indirection :

  
http://github.com/jmettraux/ruote/blob/ruote2.1/test/functional/ft_27_var_indirection.rb#L13-30

And that got me thinking about something that could look like :

---8<---
  Ruote.process_definition do
    sequence do

      set 'v:customer' => [ 'MyProject::CustomerParticipant', {} ]

      #...

      customer # bound just for this process instance
      accounting # regular participant
    end
  end
--->8---

Participants would be bound in variables, with the scope of a variable (and 
thus vanish with the scope).

  set 'v:customer' => [ 'MyProject::CustomerParticipant', {} ]

looks decent, but it's a bit of a "code intrusion" inside of the definition.

Also how could I pass info from the process instance to the "on-the-fly" 
participant ?

Dollar substitution only works when values are strings, not arrays like here.

The workitem could carry all the necessary info.

For the AMQP people out there, it would look like

  set 'v:customer' => [ 'MyProject::CustomerParticipant', { 'queue' => 'x' } ]

Maybe I should look at a new expression that could say :

  register 'customer', :class => 'MyProject::CustomerParticipant', :queue => 'x'
  register 'customer', :class => '${f:customer_participant_class}', :queue => 
'${f:the_queue}'

that would do the "set variable".


I know it's a bit confusing, but anybody has comments ?

-- 
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