Hello John, first of all: Thanks for your remarks and constant work and help.
On Nov 25, 2:38 am, "John Mettraux" <[EMAIL PROTECTED]> wrote: > On Tue, Nov 25, 2008 at 12:53 AM, Torsten Schoenebaum wrote: > > > @default_action > > element_id = workitem.params['element_id'] ? workitem.params > > ['element_id'] : @default_element_id > > maybe something like > > site = workitems.params['site'] || @default_site > > would be easier to read. Yes, indeed. I'm still learning to write nice Ruby code... > > # create new subclass of ActiveResource::Base > > active_resource_class = Class.new(ActiveResource::Base) > > active_resource_class.site = site # set site parameter > > active_resource_class.element_name = element_name # set element > > name > > Maybe "resource" instead of "element" would better suit the > ActiveResource context : "resource_id", "resource_name"... Yes, I'll change that. I simply used the same names as in ActiveResource. > Maybe this participant could be called "ActiveResourceParticipant" > since it's ARes specific (though active resource compliant servers got > be used as well). And again you're right. > > For me, this implementation works fine, but I'd like to make it more > > general usable: Not only PUTs should be possible, but all other REST > > actions. I'm thinking of replacing > > active_resource_object.put(action) > > by > > active_resource_object.send(rest_method, arguments) > > 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). > 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 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. > > In this context I'd like to know if there is a possibility to use > > hashes or arrays as attributes in the xml definition of a workflow? > > Something like > > <participant ref="reminder" action="put" arguments="{:action => > > 'send_reminder', :some_parameter => 'foo'}" /> > > ? > > Please have a look at this test (and the adjacent tests) for a > suggestion of how you could do that : > > http://github.com/jmettraux/ruote/tree/master/test%2Fft_57_a.rb#L147-167 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? Thanks again for your help, Torsten --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
