Hello Torsten,

On Wed, Nov 26, 2008 at 1:53 AM, Torsten Schoenebaum
<[EMAIL PROTECTED]> wrote:
> On Nov 25, 2:38 am, "John Mettraux" <[EMAIL PROTECTED]> wrote:
>> On Tue, Nov 25, 2008 at 12:53 AM, Torsten Schoenebaum wrote:
>
>> Indeed, makes sense. Would you consider "donating"/"contributing" this
>> code to OpenWFEru / Ruote ?
>
> That would be an honour to me. I will try to finish the participant in
> the next few weeks (sorry if it's taking some time, I've got loads of
> other things to do).

Great !


>> adding a few tests could be feasible with some ARes mocking.
>
> I'll see into that but in writing tests I'm still a newbie -- yes, I
> should really work on that point...

I can help you with that. Many people are doing BDD these days
(http://rspec.info/ mainly) but I'm sticking with TDD and Test::Unit
(my bad).


>> I did some exploratory work on "REST" methods inside of process definitions :
>>
>> http://jmettraux.wordpress.com/2008/05/27/restful-bpm/#more-445http://github.com/jmettraux/ruote/tree/master/lib%2Fopenwfe%2Fexpress...
>
> Oops -- with these expressions I could have done my job without
> writing a new participant as I only need to do a simple PUT.
>
>> but I'm not really convinced by my own approach. Somehow, wrapping
>> things inside of participants like you're doing feels better.
>
> Yeah, I got my inspiration from the MailerParticipant.

Let's keep the focus on your participant then.


> If I'm not mistaken, I could set a field or variable in the workitem
> to an array or hash this way. This could be a workaround, but not a
> very nice one. I tried that one:
>
> <process-definition name="ActiveResourceTest" revision="0.1">
>  <participant ref="reminder" site="http://localhost:7000";
> resource_name="story" method="put" action="send_reminder"
> resource_id="${field:story_id}" >
>    <a>
>      <array>
>        <string>First string</string>
>        <string>Second string</string>
>      </array>
>    </a>
>  </participant>
> </process-definition>
>
> This creates a child expression which I can get using
> get_flow_expression(workitem).children -- but how to go further? I
> assume the ValueMixin does the trick in the set expression, but how
> could I use or adopt it?

You could provide your own implementation of the ParticipantExpression
to the engine. As implemented for now, it's rather static
(http://github.com/jmettraux/ruote/tree/r0.9.19/lib%2Fopenwfe%2Fexpressions%2Fexpressionmap.rb#L92)
the ParticipantExpression class is mapped to the 'participant' names
(I guess it's time for me to make a more flexible expression map).

Meanwhile you could Provide a TorstenParticipantExpression that
extends ParticipantExpression and mixes in ValueMixin. You'd have to
make sure to swap the apply() method in the participant to a reply().
The ValueMixin provides an apply() method that then calls the reply()
method. It's complicated, that's true.

Note that if you use a Ruby process definition you can more easily
have array/hashes as expression attribute values, that could save you
time.

  participant :ref => 'reminder', :site => 'http://localhost:7000',
:res_name => 'story', :method => 'put', :val => [ 'First string',
'Second string' ]

I know it may be a pain in the ass, but I've always been trying to
somehow keep data out of processes themselves.


Best regards,

-- 
John Mettraux   -   http://jmettraux.wordpress.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"OpenWFEru users" 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-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to