You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Dale King <da...@gmail.com> on 2013/08/19 22:43:27 UTC

Nesting choices is broken!!

If I nest a CBR inside the when of an outer CBR where the outer when
condition is true and the inner CBR does not match any when condition then
the outer otherwise clause gets executed.

Here is the simplest route example to show this that I can come up with:

<route>
<from uri="timer://myTimer?period=1&amp;repeatCount=1" />
<setHeader headerName="test">
<constant>1</constant>
</setHeader>
<choice>
<when>
<simple>${header.test} &gt; 0</simple>
<choice>
<when>
<simple>${header.test} &gt; 5</simple>
<log message="Should not get here" />
</when>
<otherwise>
<log message="Should get here" />
</otherwise>
</choice>
</when>
<otherwise>
<log message="Why do I get here???" />
</otherwise>
</choice>
</route>

The output from this is:

    Should get here
    Why do I get here???

We should not hit the otherwise clause of the outer CBR based on the inner
CBR.

Tested with the 2.12-SNAPSHOT

Re: Nesting choices is broken!!

Posted by Dale King <da...@gmail.com>.
Yes, I had already added my post to the comments on that ticket.
On Aug 22, 2013 10:16 AM, "Claus Ibsen" <cl...@gmail.com> wrote:

> Hi
>
> Yeah its sorta logged in this ticket already
> https://issues.apache.org/jira/browse/CAMEL-6447
>
> On Mon, Aug 19, 2013 at 11:08 PM, dalewking <da...@gmail.com> wrote:
> > Here is the route with the formatting preserved. I realize in this case
> that
> > the 2 choices could have been flattened into one, but I actually
> discovered
> > this with the inner CBR inside a split!
> >
> >
> >
> >
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/Nesting-choices-is-broken-tp5737536p5737537.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> Email: cibsen@redhat.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
>

Re: Nesting choices is broken!!

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Yeah its sorta logged in this ticket already
https://issues.apache.org/jira/browse/CAMEL-6447

On Mon, Aug 19, 2013 at 11:08 PM, dalewking <da...@gmail.com> wrote:
> Here is the route with the formatting preserved. I realize in this case that
> the 2 choices could have been flattened into one, but I actually discovered
> this with the inner CBR inside a split!
>
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Nesting-choices-is-broken-tp5737536p5737537.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: Nesting choices is broken!!

Posted by dalewking <da...@gmail.com>.
Here is the route with the formatting preserved. I realize in this case that
the 2 choices could have been flattened into one, but I actually discovered
this with the inner CBR inside a split!

	




--
View this message in context: http://camel.465427.n5.nabble.com/Nesting-choices-is-broken-tp5737536p5737537.html
Sent from the Camel - Users mailing list archive at Nabble.com.