Hi Matt,

On 7/12/07, Matt Zukowski <[EMAIL PROTECTED]> wrote:
>
> This is in regards to my original question, where I want to implement
> a "wait until we receiv some additional info from an external source"
> pattern. The way I understand it from your explanation is that I
> should implement a WaitForUpdateParticipant that mixes in the
> StoreParticipantMixin. This participant would take the workitem, store
> it somewhere and stop. I would then need to add an external API to my
> Fluxr server that would allow some external client to connect,
> retrieve the workitem, and update it's properties with some new info.
> This update would trigger a forward() call in my
> WaitForUpdateParticipant, and at this point the workflow would
> automatically resume.
>
> Is this right?

It's right. But I think you shouldn't implement a
WaitForUpdateParticipant, simply use a YamlParticipant or densha's
LocalActiveParticipant (try with YamlParticipantFirst).

The "external API" could be provided very easily via ActiveResource or
simply as a web application (workitem list, workitem edition, save,
forward, ...) thanks to Camping.

OpenWFEru ships with some participants that dispatch workitems to
things like Amazon SQS or simply as XML over a TCP socket.
It also features some listeners to 'listen' to workitems coming back
(or launchitems requiring process execution).
http://openwferu.rubyforge.org/participants.html


> If so,
>
> 1) How do I bring a persisted engine back to life? I have a feeling
> this will be self-explanatory once I actually get around to trying it,
> but I might as well ask :)

Well, simply instantiate it. In the case of a FilePersistedEngine,
make sure it points to the right directory. The process instance will
be available again (the engine will load them on demand (process
rehydration)).


> 2) After my WaitForUpdateParticipant completes, I will probably want
> to branch my workflow based on the workitem's updated fields. How
> exactly do I do this? I can't quite figure out from the rdocs how you
> check the value of a workitem's field using the 'if' expression.

the rdoc is not that bad :
http://openwferu.rubyforge.org/rdoc/classes/OpenWFE/IfExpression.html

basically, it goes like :

    <if>
        <...condition.../>
        <...then branch.../>
        <...optional else branch.../>
    </if>

The 'if' splits the process in two. Of course you can combine all the
expressions to build things like :

---8<---
<if>
    <equals field-value="my_field" other-value="ok" />
    <!-- then -->
    <sequence>
        <participant ref="alfredo" />
        <concurrence count="1">
            <participant ref="bartolomeo" />
            <subprocess ref="review_proposal" />
        </concurrence>
    </sequence>
    <!-- else -->
    <concurrence>
        <participant ref="bartolomeo" />
        <participant ref="cristina" />
    </concurrence>
</if>
--->8---

The condition may be included as an attribute of the 'if' expression like in :

<if test="${field:my_field} == ok" />

please have a look at the tests for if and equals :
http://viewvc.rubyforge.mmmultiworks.com/cgi/viewvc.cgi/trunk/openwfe-ruby/test/ft_17_condition.rb?root=openwferu&view=markup
http://viewvc.rubyforge.mmmultiworks.com/cgi/viewvc.cgi/trunk/openwfe-ruby/test/ft_3_equals.rb?root=openwferu&view=markup

Maybe 'if' and expression usage questions had better go in the users
mailing list, to reach a greater audience.


Hope this helps, best regards,

-- 
John Mettraux   -///-   http://jmettraux.openwfe.org

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"OpenWFEru dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/openwferu-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to