2013-05-23 22:30:56 utc |
chiradeep |
hi, if I retrieve a participant from the dashboard, I get an error similar to http://comments.gmane.org/gmane.comp.lang.ruby.ruote/1052 |
2013-05-23 22:31:17 utc |
chiradeep |
frobish = @engine.participant('frobish') |
2013-05-23 22:31:29 utc |
chiradeep |
frobish.reply |
2013-05-23 22:33:21 utc |
chiradeep |
NoMethodError: undefined method `fei' for nil:NilClass |
2013-05-23 22:33:33 utc |
chiradeep |
from /Users/chiradeep/.rvm/gems/ruby-1.9.3-p374/gems/ruote-2.3.0.2/lib/ruote/part/local_participant.rb:85:in `fei' |
2013-05-23 22:37:35 utc |
chiradeep |
from /Users/chiradeep/.rvm/gems/ruby-1.9.3-p374/gems/ruote-2.3.0.2/lib/ruote/part/local_participant.rb:107:in `applied_workitem' |
2013-05-23 22:40:26 utc |
chiradeep |
from /Users/chiradeep/.rvm/gems/ruby-1.9.3-p374/gems/ruote-2.3.0.2/lib/ruote/part/local_participant.rb:78:in `workitem' |
2013-05-23 22:40:34 utc |
chiradeep |
from /Users/chiradeep/.rvm/gems/ruby-1.9.3-p374/gems/ruote-2.3.0.2/lib/ruote/part/local_participant.rb:140:in `reply_to_engine' |
2013-05-23 23:30:49 utc |
jmettraux |
hello |
2013-05-23 23:31:15 utc |
jmettraux |
https://gist.github.com/ is your friend |
2013-05-23 23:33:57 utc |
jmettraux |
chiradeep: hello |
2013-05-23 23:34:07 utc |
chiradeep |
jmettraux: hi |
2013-05-23 23:34:15 utc |
jmettraux |
if you fetch a participant out of the blue, you have to call #reply with the workitem |
2013-05-23 23:34:21 utc |
chiradeep |
ah |
2013-05-23 23:34:28 utc |
jmettraux |
it cannot guess it for you |
2013-05-23 23:35:12 utc |
chiradeep |
so I have to store the workitem in the participant |
2013-05-23 23:35:21 utc |
jmettraux |
no |
2013-05-23 23:35:33 utc |
jmettraux |
let's step back a bit |
2013-05-23 23:35:41 utc |
chiradeep |
sure |
2013-05-23 23:35:45 utc |
jmettraux |
why do you want to call participant.reply ? |
2013-05-23 23:35:50 utc |
jmettraux |
what's the use case ? |
2013-05-23 23:35:54 utc |
chiradeep |
I want to send an approval request email to the manager |
2013-05-23 23:36:01 utc |
chiradeep |
he clicks on a link |
2013-05-23 23:36:24 utc |
chiradeep |
that link calls a web service that unblocks the worfklow |
2013-05-23 23:36:57 utc |
jmettraux |
so the link/webservice has to know the "fei" |
2013-05-23 23:37:05 utc |
jmettraux |
it "correlates" |
2013-05-23 23:37:11 utc |
chiradeep |
ah |
2013-05-23 23:37:25 utc |
chiradeep |
how do I get the fei |
2013-05-23 23:37:36 utc |
chiradeep |
or how do I put it into the url |
2013-05-23 23:37:54 utc |
jmettraux |
when your participant implementation receives a workitem |
2013-05-23 23:38:23 utc |
jmettraux |
it can send the email with the "fei" packed in a string |
2013-05-23 23:38:47 utc |
jmettraux |
fei.to_storage_id |
2013-05-23 23:39:30 utc |
chiradeep |
got it |
2013-05-23 23:40:07 utc |
chiradeep |
how to correlate fei with workitem |
2013-05-23 23:41:01 utc |
chiradeep |
or is there another way of moving the process forward without calling participant.reply |
2013-05-23 23:41:36 utc |
jmettraux |
usually, when there is a human involved, the StorageParticipant is used |
2013-05-23 23:42:32 utc |
jmettraux |
https://github.com/jmettraux/ruote/blob/master/test/unit/ut_1_fei.rb#L18-L26 turns a fei into a String instance |
2013-05-23 23:43:06 utc |
jmettraux |
https://github.com/jmettraux/ruote/blob/master/test/unit/ut_1_fei.rb#L105-L114 turning such a String instance back into a fei instance |
2013-05-23 23:43:29 utc |
jmettraux |
those string feis are (should be) URI safe |
2013-05-23 23:44:56 utc |
chiradeep |
looks like it. I'll take a look at StorageParticipant as well |
2013-05-23 23:45:11 utc |
chiradeep |
the fei : does it change during the process |
2013-05-23 23:45:31 utc |
jmettraux |
for those email/external stuff cases, I tend to use a participant/receiver pair |
2013-05-23 23:46:01 utc |
chiradeep |
do you have an example? The AMQP example is a little bit opaque to me |
2013-05-23 23:48:31 utc |
jmettraux |
well, going without receiver is OK |
2013-05-23 23:48:46 utc |
jmettraux |
dashboard.participant('x').reply(workitem) |
2013-05-23 23:49:11 utc |
chiradeep |
ok, I'll go that way |
2013-05-23 23:49:20 utc |
jmettraux |
you can build an empty workitem { 'fields' => {}, 'fei' => fei } |
2013-05-23 23:50:00 utc |
jmettraux |
I'm wondering if I shouldn't add the possibility to simply do dashboard.participant('x').reply(fei) |
2013-05-23 23:50:10 utc |
jmettraux |
and pick the workitem as is in the storge |
2013-05-23 23:50:10 utc |
jmettraux |
storage |
2013-05-23 23:50:14 utc |
jmettraux |
it could be useful |
2013-05-23 23:51:29 utc |
jmettraux |
in fact you can write dashboard.reply(wi) directly |
2013-05-23 23:51:56 utc |
jmettraux |
the dashboard includes the receiver mixin |
2013-05-23 23:54:12 utc |
chiradeep |
that's a good idea |
2013-05-23 23:54:22 utc |
chiradeep |
dashboard.participant('x').reply(fei) |
2013-05-23 23:54:33 utc |
jmettraux |
dashboard.reply(fei) |
2013-05-23 23:54:47 utc |
chiradeep |
that too |
2013-05-23 23:55:38 utc |
jmettraux |
https://github.com/jmettraux/ruote/issues/82 |
2013-05-23 23:57:08 utc |
jmettraux |
thanks, I'll try to look into it during the lunch break |
2013-05-23 23:57:45 utc |
chiradeep |
great |