Hello List,

I've just pushed a set of changes that simplify local participants. For 
instance, you can rewrite

---8<---
class MyParticipant
  include Ruote::LocalParticipant
  def consume(workitem)
    workitem.fields['message'] = 'this is my participant'
    reply_to_engine(workitem)
  end
end
--->8---

as

---8<---
class MyParticipant
  include Ruote::LocalParticipant
  def on_workitem
    workitem.fields['message'] = 'this is my participant'
    reply
  end
end
--->8---

The 'workitem' becomes implicit (ie, an instance method).

The other methods (on_cancel, on_reply, accept?, dont_thread?) have been 
simplified likewise, with helper methods like fei, fexp, workitem, flavour, 
lookup_variable popping up.

For more information, please refresh

  http://ruote.rubyforge.org/implementing_participants.html

I've updated with [upcoming] ruote 2.2.1 information.

I prefer the on_x scheme, it clearly shows the "hookesque" nature of the 
participants.

Feel free to fire questions and suggestions, and/or to point me at typos and 
errors...

It should be 100% backward compatible, if not, please shout.


Best regards,

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

-- 
you received this message because you are subscribed to the "ruote users" group.
to post : send email to [email protected]
to unsubscribe : send email to [email protected]
more options : http://groups.google.com/group/openwferu-users?hl=en

Reply via email to