[jabber] listeners

8 views
Skip to first unread message

John Mettraux

unread,
Jun 11, 2009, 12:05:55 AM6/11/09
to openwferu-users
Sunhao wrote in
http://jmettraux.wordpress.com/2008/09/07/how-does-ruote-work/#comment-27923
:
>
> i am interested to learn how does the participant listener work ? i have tested the jabber listener, and it works well to receive
> response message from my google talk client.
>
> But i can not decode the response into an workitem. i just want to add the response to the workitem then reply the handle to the
> core engine.
> such as when i received the response “{my_comments => ‘i would like the work to be done till tomorrow morning.’}”
>
> wi = InFlowWorkItem.new
> wi.attributes = response_hash
> handle_item(wi)
>
> did not work for me. you did not mention the listener in the above picture.
> i’d like to know more about it. pls help! thanks a lot.

Hi Sunhao,

there is a beginning of a piece of documentation about
participants/listeners at [1].

Concerning the jabber listener, it should understand YAML, XML and
JSON. The jabber participant itself tends to encode only in JSON [2].

So on your side (not the engine side), you should simply receive a
JSON encoded hash, modify the values in it, re-encode it as JSON and
send it back to the engine via the JabberListener.

I hope this will help. Best regards,


[1] http://openwferu.rubyforge.org/part.html
[2] http://github.com/jmettraux/ruote/blob/82cfc10fa6393c8c5c026552d6929ab0cbaa87d3/lib/openwfe/extras/participants/jabber_participants.rb#L129-136

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

Reply all
Reply to author
Forward
0 new messages