Gonzalo Suárez wrote: 
> I have a participant that inherits from StorageParticipant. I've
> written methods consume, cancel and reply in order to do xmpp
> notifications. But I have a special case when updating the workitem.
> If the workitem includes a special key, say "_pick" (similar to
> "_proceed") then, I should update the workitem in a special way and do
> another notification.
> 
> I reviewed Ruote-Kit's resource directory and plan to add some logic
> to handle this within the PUT /workitem method as this:
> 
> --8--
> 
>     if options[:pick]
>       RuoteKit.engine.storage_participant.pick(@workitem)
>     end
> 
> --8--
> 
> But, of course storage_participant doesn't have a pick method.

Three options:
1) Write a module with the pick method which you include into the
   StorageParticipant class
2) Monkey-path Ruote::Engine#storage_participant to return an instance
   of your participant class
3) If you change RuoteKit's source anyway, you could change the calls
   to RuoteKit.storage_participant in the workitems resource to an own
   method

Choose that one which you like most ;-)

> Besides, I need to update the workitem so I would probably have to use
> update method, and maybe add the logic there. What do you think? Too
> messy?

You could handle the '_pick' field within the update method of your
participant so that you don't need to change RuoteKit's source, can't
you?

HTH,
Torsten


-- 
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