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

Reply via email to