| 2010-11-29 11:39:14 utc | gonzalo | hi, i got a question about :iterator expression |
| 2010-11-29 11:39:51 utc | jmettraux | gonzalo: hello |
| 2010-11-29 11:39:56 utc | gonzalo | hi john |
| 2010-11-29 11:40:11 utc | gonzalo | i found a strange behaviour with :iterator |
| 2010-11-29 11:40:21 utc | gonzalo | here is the description |
| 2010-11-29 11:40:55 utc | gonzalo | i have a :iterator and inside it a sequence with an amqp participant |
| 2010-11-29 11:41:21 utc | gonzalo | when iterator gets executed the amqp send a message but replys inmediately |
| 2010-11-29 11:41:29 utc | gonzalo | doesn't wait for the message back |
| 2010-11-29 11:41:33 utc | jmettraux | do you have a https://gist.github.com/ ? |
| 2010-11-29 11:41:48 utc | jmettraux | have you tried with the iterator ? |
| 2010-11-29 11:42:01 utc | jmettraux | could it be simply that the participant is tuned to emit the message and go on ? |
| 2010-11-29 11:42:23 utc | gonzalo | i'll post the process in gist |
| 2010-11-29 11:42:26 utc | gonzalo | just a second |
| 2010-11-29 11:42:27 utc | gonzalo | :P |
| 2010-11-29 11:43:18 utc | gonzalo | https://gist.github.com/719867 |
| 2010-11-29 11:43:37 utc | gonzalo | i even force the amqp to wait for a reply |
| 2010-11-29 11:43:58 utc | gonzalo | the review participant is invoked inmediately |
| 2010-11-29 11:44:14 utc | gonzalo | i don't know if i'm doing something wrong... |
| 2010-11-29 11:45:21 utc | jmettraux | you should test at first without the iterator |
| 2010-11-29 11:45:37 utc | jmettraux | how do you register the amqp participant ? |
| 2010-11-29 11:45:41 utc | gonzalo | without iterator it's working fine |
| 2010-11-29 11:46:03 utc | gonzalo | i register with this: |
| 2010-11-29 11:46:07 utc | gonzalo | [ 'amqp', 'RuoteAMQP::Participant', { :queue => 'gateway'} ], |
| 2010-11-29 11:46:13 utc | gonzalo | using participant_list method |
| 2010-11-29 11:46:34 utc | gonzalo | as far as i know, :forget => 'false' in participant amqp is a default |
| 2010-11-29 11:46:55 utc | gonzalo | i only set :forget param when I want it to reply inmediately |
| 2010-11-29 11:47:35 utc | jmettraux | hardcore |
| 2010-11-29 11:48:13 utc | gonzalo | i'm going to try the code without the iterator just to make sure, but i've been using amqp participant fine before |
| 2010-11-29 11:52:02 utc | jmettraux | https://gist.github.com/719873 maybe |
| 2010-11-29 11:53:03 utc | jmettraux | I have the impression |
| 2010-11-29 11:53:04 utc | jmettraux | https://github.com/jmettraux/ruote-amqp/blob/ruote2.1/lib/ruote-amqp/participant.rb#L163 |
| 2010-11-29 11:53:51 utc | jmettraux | ruby-1.8.7-p299 > puts "Gonzalo" if 'false' |
| 2010-11-29 11:53:51 utc | jmettraux | (irb):2: warning: string literal in condition |
| 2010-11-29 11:53:51 utc | jmettraux | Gonzalo |
| 2010-11-29 11:53:52 utc | jmettraux | => nil |
| 2010-11-29 11:54:05 utc | jmettraux | 'false' evaluates to true |
| 2010-11-29 11:54:13 utc | gonzalo | ummm |
| 2010-11-29 11:54:20 utc | jmettraux | sorry about that |
| 2010-11-29 11:54:29 utc | gonzalo | ohh your right |
| 2010-11-29 11:54:42 utc | gonzalo | it should be :forget => false |
| 2010-11-29 11:54:46 utc | gonzalo | not 'false' |
| 2010-11-29 11:55:01 utc | gonzalo | i missed that |
| 2010-11-29 11:55:39 utc | gonzalo | thanks for the tip, i usually don't make this mistakes |
| 2010-11-29 11:55:42 utc | jmettraux | I'll fix that soon https://github.com/jmettraux/ruote-amqp/issues/issue/1 |
| 2010-11-29 11:55:52 utc | jmettraux | it's rather my mistake, don't worry |
| 2010-11-29 11:56:24 utc | gonzalo | thanks for the tip, let's see if that fixes the problem... :P |
| 2010-11-29 11:56:38 utc | jmettraux | if the process definition is in XML, it will be 'false' and not false, so I have to be prepared |
| 2010-11-29 11:57:31 utc | gonzalo | umm yes, if xml it would fail |
| 2010-11-29 12:03:53 utc | gonzalo | i've just tried a simple example with iterator and amqp and seems to be working fine |
| 2010-11-29 12:04:12 utc | gonzalo | i'll check my code, probably I have some mistakes |
| 2010-11-29 12:04:22 utc | gonzalo | many thanks for the help |
| 2010-11-29 12:04:23 utc | gonzalo | :P |
| 2010-11-29 12:04:24 utc | jmettraux | ok |
| 2010-11-29 12:04:28 utc | jmettraux | you're welcome |
| 2010-11-29 15:52:05 utc | gonzalo | maybe this is an stupid question... i have a workitem key that hold a number as a string |
| 2010-11-29 15:52:16 utc | gonzalo | is the a way to convert it to an integer |
| 2010-11-29 15:52:33 utc | gonzalo | echo '${f:item}.to_i prints always a 0 |
| 2010-11-29 15:52:39 utc | gonzalo | thanks for the help |
| 2010-11-29 15:54:29 utc | tosch_le | ruby code is not allowed in the process definition expressions |
| 2010-11-29 15:54:41 utc | tosch_le | there is an exception, though: http://ruote.rubyforge.org/dollar.html |
| 2010-11-29 15:55:01 utc | tosch_le | have a look at the end of the document, the ruby_eval_allowed section |
| 2010-11-29 15:55:17 utc | gonzalo | ok thanks tosch_le |
| 2010-11-29 15:55:49 utc | tosch_le | but i'm unsure if you may access workitem fields that way |
| 2010-11-29 15:56:24 utc | tosch_le | why do you save the number as string if you need is as integer? |
| 2010-11-29 15:57:11 utc | gonzalo | well, i just start the process with a variable station_id that holds ids |
| 2010-11-29 15:57:22 utc | gonzalo | with an iterator i traverse the variable |
| 2010-11-29 15:57:32 utc | gonzalo | but the variables should be integer |
| 2010-11-29 15:57:34 utc | gonzalo | not string |
| 2010-11-29 15:58:03 utc | gonzalo | they are db indexes |
| 2010-11-29 15:58:26 utc | gonzalo | the easy way to fix this is to convert the string to int in the participant |
| 2010-11-29 15:58:36 utc | gonzalo | that is probably what i finally will do |
| 2010-11-29 15:58:43 utc | gonzalo | it is easier |
| 2010-11-29 15:59:38 utc | tosch_le | i'd suggested that next |
| 2010-11-29 16:00:04 utc | gonzalo | yeah, I think that is the best option |
| 2010-11-29 16:00:40 utc | tosch_le | Ruote.narrow_to_number may be interesting: https://github.com/jmettraux/ruote/blob/ruote2.1/lib/ruote/util/misc.rb#L109-118 |
| 2010-11-29 16:00:43 utc | gonzalo | anyway thanks for pointing out that page of ruote documentation about dollar |
| 2010-11-29 16:01:15 utc | gonzalo | ummm interesting |
| 2010-11-29 16:04:18 utc | tosch_le | ${r:workitem.fields['toto'].to_i} should work, btw. |
| 2010-11-29 16:04:33 utc | tosch_le | (if ruby_eval_allowed is set to true) |
| 2010-11-29 16:05:13 utc | gonzalo | many thanks for the info |
| 2010-11-29 16:05:21 utc | gonzalo | i may try that to |
| 2010-11-29 16:05:28 utc | gonzalo | too |
| 2010-11-29 16:05:30 utc | gonzalo | :P |
| 2010-11-29 16:06:59 utc | tosch_le | you should read https://github.com/jmettraux/ruote/blob/ruote2.1/test/functional/ft_10_dollar.rb, it's highly educating |
| 2010-11-29 16:10:29 utc | gonzalo | your right, there's no better place to look for the info, the tests!! |
| 2010-11-29 16:10:33 utc | gonzalo | :) |
| 2010-11-29 16:10:40 utc | gonzalo | thank you much |
| 2010-11-29 16:11:19 utc | tosch_le | perhaps not better, but none the less informative: the code at https://github.com/jmettraux/ruote/blob/ruote2.1/lib/ruote/svc/dollar_sub.rb |
| 2010-11-29 16:12:55 utc | tosch_le | thank you for your questions, i'm learning a lot! |
| 2010-11-29 16:13:11 utc | gonzalo | no problem :) |
| 2010-11-29 16:33:07 utc | gonzalo | tosch_le: umm I tried ${r:workitem.fields['toto'].to_i} but still returning a String |
| 2010-11-29 16:33:23 utc | gonzalo | anyway, I did a .to_i in the participant and soved |
| 2010-11-29 16:33:25 utc | gonzalo | solved |
| 2010-11-29 16:33:29 utc | gonzalo | easier |
| 2010-11-29 16:33:38 utc | tosch_le | :-) |
| 2010-11-29 16:33:45 utc | tosch_le | and better placed, anyway |
| 2010-11-29 16:34:11 utc | gonzalo | yes thanks for all the info and links anyway :) |
| 2010-11-29 16:34:19 utc | tosch_le | it was a pleasure |