On Thu, Jul 08, 2010 at 12:54:05PM -0700, Don French wrote:
>
> Using this example:
>
> 1 sequence do
> 2 participant '${f:patient}'
> 3 participant '${f:doctor}'
> 4 end
>
> Using patients: 'patient 1', 'patient 2', and physicians - 'physician
> 1', and 'physician 2'
>
> I am assuming that I would need to register participants under each of
> those names. That seems like a lot of registered participants given a
> real world environment. Can you register the participant in the
> sequence and then unregister it before the end? What is the
> difference in using generic named participants like 'patient' and
> 'physician' as opposed to dynamic like above. Is one a better approach
> and why?
Hello Don,
you could go and register participant categories :
engine.register_participant 'patient .+', PatientParticipant
engine.register_participant 'physician .+', PhysicianParticipant
and then do the 'dynamic' thing inside of the participant.
( Ruote::StorageParticipant parenthesis ...
For human participants, I tend to use a Ruote::StorageParticipant (basically a
kind of workitem [in]box)
engine.register_participant 'patient .+', Ruote::StorageParticipant
engine.register_participant 'physician .+', Ruote::StorageParticipant
I then query it like this
sp = Ruote::StorageParticipant.new(engine)
patient_wi = sp.by_participant('patient 1')
In some cases, a "catch all" is registered last
engine.register_participant '.+', Ruote::StorageParticipant
All the workitems for unnamed participants (and subprocesses) go into it. This
is very handy, but can have undesired effects
sequence do
don
jhon
end
There will be workitems for "don" and "jhon", too bad since I'm expecting them
for "john" (anything that is not a ruote expression or a subprocess is caught
by the "catch all" participant).
... end of Ruote::StorageParticipant parenthesis )
You could also do
engine.register_participant 'patient .+', QueueParticipant, :channel =>
'patient'
engine.register_participant 'patient .+', QueueParticipant, :channel =>
'physician'
and true your QueueParticipant implementation to route the workitems to the
right "real" participant behind the scenes.
It would be OK to register / unregister participant, but I think this could
make the system less robust. Better to put the dynamicity elsewhere.
I hope it helps, cheers,
--
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