On Sun, Jun 8, 2008 at 7:25 PM, Corin Moss <[EMAIL PROTECTED]> wrote: > > Part of the complexity of my workflow > comes from having participants that may not be currently defined within > the scope of a given engine. > > What would you think if I extended the XML participant element to be > able to specify "external" participant code - be it a GEM, a ruby source > file, yaml etc referenced by URL or similar? Obviously there are some > serious trust issues involved in doing this, but it does allow > ruote-rest to be much more flexible in its acceptance of workflow documents.
Hello, participant resolution is based on regular expressions. You could imagine having a scheme where engine.register_participant /^ext-.*$/, SpecialParticipant then, based on the actual value of the participant_name, you could trigger external stuff from your instance of SpecialParticipant. It would be possible to have participant names like "ext:ExternalLib.do_the_job" where your SpecialParticipant would extract what comes after "ext:" and eval it somehow. You could take inspiration from the 'reval' expression (http://openwferu.rubyforge.org/expressions.html#exp_reval) as well and make a less secure version of it (note that up until 0.9.18 included, evaluated code was run with a safety level, which doesn't work for JRuby. Since 0.9.19, ruby code being evaluated is first parsed and the tree checked for unsafe operations). One important point, the participant expression takes care of running the actual participant implementation in a separate thread, so that the engine can continue working without blocking while the participant work is done. Reval doesn't currently do that. Feel free to use the technique you like, there are many ways. 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 -~----------~----~----~----~------~----~------~--~---
