| 2010-03-25 02:58:40 utc | gmcinnes | Hey all. Anyone about? I'm having a hard time getting a simple _if to work in a workflow in 1.9.x Can an _if control execution of a subprocess? |
| 2010-03-25 02:59:06 utc | gmcinnes | i.e. I want to run the subprocess if and only if the _if test is true |
| 2010-03-25 03:05:01 utc | jmettraux | back |
| 2010-03-25 03:05:31 utc | jmettraux | subprocess :ref => 'x', :if => '${ok}' |
| 2010-03-25 03:05:37 utc | jmettraux | or |
| 2010-03-25 03:06:26 utc | jmettraux | _if :test => '${ok} == true' { then_block; else_block } |
| 2010-03-25 03:07:43 utc | jmettraux | or you can gist (http://gist.github.com/) your definition |
| 2010-03-25 03:07:56 utc | jmettraux | gmcinnes: hello |
| 2010-03-25 03:08:55 utc | gmcinnes | hey jmettraux. how's it? |
| 2010-03-25 03:09:03 utc | jmettraux | doing fine, and you ? |
| 2010-03-25 03:09:27 utc | gmcinnes | doing well. |
| 2010-03-25 03:12:02 utc | gmcinnes | here's the def'n I have now: http://gist.github.com/343131 |
| 2010-03-25 03:12:55 utc | gmcinnes | I have a ton of other questions if you have a few mins :) |
| 2010-03-25 03:12:58 utc | jmettraux | _if :test => "${voip_action_id}" do |
| 2010-03-25 03:13:02 utc | jmettraux | should be sufficient |
| 2010-03-25 03:13:19 utc | jmettraux | but maybe you want ${f:voip_action_id} |
| 2010-03-25 03:13:39 utc | gmcinnes | oops. yup. |
| 2010-03-25 03:13:58 utc | jmettraux | 2.1.x defaults to field |
| 2010-03-25 03:14:22 utc | jmettraux | please fire the questions |
| 2010-03-25 03:14:50 utc | gmcinnes | main one: is there any way for participants to access workflow expressions such as _when? |
| 2010-03-25 03:15:11 utc | jmettraux | yes |
| 2010-03-25 03:15:42 utc | jmettraux | by placing information relevant to the _when in their workitem and replying |
| 2010-03-25 03:16:25 utc | jmettraux | I'm not sure, but I have the impression you want a behaviour like a "listen" : http://openwferu.rubyforge.org/expressions.html#exp_listen |
| 2010-03-25 03:22:33 utc | gmcinnes | hmm. so I could pull the voip_sender subprocess stuff out, and put it in a new workflow that is wrapped in a listen that listens for the reply from check_adherence participant |
| 2010-03-25 03:22:39 utc | gmcinnes | if I understand correctly. |
| 2010-03-25 03:23:06 utc | jmettraux | I don't know |
| 2010-03-25 03:23:10 utc | gmcinnes | :) |
| 2010-03-25 03:23:15 utc | jmettraux | It's just an impression |
| 2010-03-25 03:23:44 utc | jmettraux | the impression is you want a process to watch the reply of a participant in another process or concurrent branch |
| 2010-03-25 03:24:47 utc | jmettraux | if it is not that, then you can safely go on with the classical one participant apply one participant reply |
| 2010-03-25 03:25:29 utc | jmettraux | your iterator looks good, you're gathering information, then when all is done, you display_dump |
| 2010-03-25 03:28:15 utc | gmcinnes | basically, I have a participant that checks the adherence, then I want another participant that takes care of firing off voip calls if there is a voip_action_id in the workitem |
| 2010-03-25 03:29:17 utc | jmettraux | the code that you have looks right |
| 2010-03-25 03:29:50 utc | gmcinnes | seems easy enough, but I wanted to be able to use participant expressions such as _when and _iterator and _sleep to handle retries and only sending during reasonable hours etc. |
| 2010-03-25 03:30:22 utc | gmcinnes | here's the subprocess: http://gist.github.com/343140 |
| 2010-03-25 03:31:16 utc | jmettraux | whoah |
| 2010-03-25 03:31:31 utc | gmcinnes | ? |
| 2010-03-25 03:32:31 utc | jmettraux | trying to think about how I would model that |
| 2010-03-25 03:33:09 utc | gmcinnes | I think I'm doing it wrong 'cause it seems more complex than neccessary. |
| 2010-03-25 03:34:12 utc | jmettraux | ACTION prepares a gist |
| 2010-03-25 03:34:25 utc | gmcinnes | Awesome. |
| 2010-03-25 03:35:08 utc | jmettraux | I wish you were on 2.1.x |
| 2010-03-25 03:37:27 utc | gmcinnes | Me too. Only a week to go. This functionality is the last I'll ever have to add to the 1.9.x branch. |
| 2010-03-25 03:37:58 utc | jmettraux | http://gist.github.com/343143 |
| 2010-03-25 03:38:05 utc | gmcinnes | In fact my ticket here says "yak shave through Twilio and Ruote 2.x" |
| 2010-03-25 03:38:14 utc | jmettraux | :) |
| 2010-03-25 03:40:08 utc | gmcinnes | do I need the :to_v part of the iterator expression? |
| 2010-03-25 03:40:29 utc | jmettraux | on 2.1.x you can drop it, on 0.9.x, I can't remember |
| 2010-03-25 03:40:52 utc | gmcinnes | ok. |
| 2010-03-25 03:52:07 utc | gmcinnes | hmm. weird. wait :for => '1s' seems to block forever (I removed the other wait while testing just now. |
| 2010-03-25 03:52:48 utc | jmettraux | anything in the error log ? |
| 2010-03-25 03:56:29 utc | gmcinnes | not that I see. |
| 2010-03-25 03:57:03 utc | jmettraux | and if you run without the wait :for => '1s' ? |
| 2010-03-25 03:57:40 utc | gmcinnes | works as expected. all my tests pass. |
| 2010-03-25 03:58:09 utc | jmettraux | good, maybe it would work with something like wait :for => '30s' |
| 2010-03-25 04:01:18 utc | gmcinnes | hmm. wait a mo. it just worked fine that time. |
| 2010-03-25 04:01:20 utc | gmcinnes | weird. |
| 2010-03-25 04:02:01 utc | gmcinnes | I sense some odd threading issues between cucumber and ruote maybe. I dunno. |
| 2010-03-25 04:02:06 utc | gmcinnes | Phase of the moon stuff :) |
| 2010-03-25 04:04:38 utc | jmettraux | ouch |
| 2010-03-25 04:05:15 utc | jmettraux | btw, there is that in the works : http://github.com/jmettraux/ruote-cukes |
| 2010-03-25 04:08:40 utc | gmcinnes | oh sweet. I'll try and jump in on that. |
| 2010-03-25 04:08:49 utc | jmettraux | it's 2.1.x ;) |
| 2010-03-25 04:09:03 utc | gmcinnes | yeah, I figured. |
| 2010-03-25 04:09:09 utc | jmettraux | feedback is welcome as my cucumber-fu is very low |
| 2010-03-25 04:10:26 utc | gmcinnes | I'll see what I can do. I have my own stuff here, but its a bit flaky and really domain specific to my app. |
| 2010-03-25 04:11:03 utc | jmettraux | patches, suggestions, critics, remarks, teachings, ... are welcome |
| 2010-03-25 04:12:07 utc | gmcinnes | i.e. its not focused on the workflows per se, but rather setting up pre-conditions firing off workflows and testing post-conditions |
| 2010-03-25 04:12:22 utc | jmettraux | aah |
| 2010-03-25 04:12:31 utc | jmettraux | ACTION take notes anyway |
| 2010-03-25 04:27:08 utc | gmcinnes | hmph. still having trouble with that 2nd wait statement, but its _sleep :for => '8h' gmcinnes now. |
| 2010-03-25 04:27:19 utc | jmettraux | ouch |
| 2010-03-25 04:27:21 utc | gmcinnes | thanks for your help again. talk to you soon I hope :) |
| 2010-03-25 04:27:29 utc | jmettraux | :) |
| 2010-03-25 15:34:27 utc | gmcinnes | Can anyone hit me with a cluestick about how the _listen expression is supposed to work? |