Quantcast
Channel: Apache Timeline
Viewing all articles
Browse latest Browse all 5648

Nesting choices is broken!!

$
0
0
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橪;repeatCount=1" />
<setHeader headerName="test">
<constant>1</constant>
</setHeader>
<choice>
<when>
<simple>${header.test} ; 0</simple>
<choice>
<when>
<simple>${header.test} ; 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

Viewing all articles
Browse latest Browse all 5648

Trending Articles