Hi John, thanks for the code! I have adapted it and it works perfectly.
Kind regards. Diego. 2009/2/4 John Mettraux <[email protected]> > > On Wed, Feb 4, 2009 at 3:47 AM, Diego Moreno <[email protected]> wrote: > > > > In my fat definitions there are some points where many fields are set, > one > > after another. One way to improve this it is to write a participant that > set > > multiple fields at the same time loading these fields from a external > file. > > This way we can keep slim definitions. Next code is an example to do this > > within a consume(workitem) method in a new type of participant. > > > > # From a external file we get a hash like this > > field_hash = { "f1" => "v1", "f2" => "v3", "f3" => "v3" } > > # Use of rufus-dolar gem > > flow_expression = self.get_flow_expression(workitem) > > field_hash = OpenWFE.dosub( field_hash, flow_expression, workitem ) > > > > field_hash.each_pair do | key, value | > > workitem.set_attribute( key, value ) > > end > > > > I do one set_attribute call for each field, but I do not know if there is > a > > way to setting various fields (from a hash) at the same time. Is it > possible > > to optimize this code? > > I followed your idea and wrote that : http://gist.github.com/57859 > > I hope it will help you. It performs dollar substitution on values > only if they are strings. > > > Kind regards, > > -- > John Mettraux - http://jmettraux.wordpress.com > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruote (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 -~----------~----~----~----~------~----~------~--~---
