-
1. Re: message routing with choice option within choice option
davsclaus Nov 21, 2009 2:00 AM (in response to lyfe)choice
when
when
otherwise
is just like a regular java
if
else if
else is
else
So no surprise that if the first when is evaluated to true then its executed. And if its evaluated to false then the next when is evaluated and so on.
What do you use in the when as predicate? Maybe its being evaluated to true all the time.
-
2. Re: message routing with choice option within choice option
lyfe Nov 21, 2009 11:38 AM (in response to davsclaus)I'm using a bean. I take the exchange as an xml string and set variables while I parse it. Then I pass back a true or false based on what I want to know.
I'm a little confused on your last sentence: Maybe its being evaluated to true all the time. Can you elaborate?
From my testing, all when statements (except the one in question) is evaluating correctly. I actually have 5 when statements. 4 of the 5 when statement's predicates are being evaluated against tags that only appear in a request. The last when statement's predicate is being evaluated against tags that only appear in a response.
Also, for additional clarity, I want to achieve:
if {...}
else if {... if {...}}
else if {...}
else {...}
..based on what is returned from first if else, I want to execute the embedded if.
I apologize in advance for rehashing if you understood the situation.
-
3. Re: message routing with choice option within choice option
davsclaus Nov 22, 2009 2:50 AM (in response to lyfe)You can do nested choices but then remember to end it with an end(). Its however often most easier to use direct to link to another route with has the nested route
from foo
choice
when bar to bar
when baz to baz
end
from bar
choice
when a
when b
-
4. Re: message routing with choice option within choice option
lyfe Nov 24, 2009 7:49 AM (in response to davsclaus)worked beautifully...thanks