You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2021/01/27 10:25:00 UTC
[jira] [Resolved] (CAMEL-16082) Single choice() without otherwise()
always executed
[ https://issues.apache.org/jira/browse/CAMEL-16082?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen resolved CAMEL-16082.
---------------------------------
Resolution: Fixed
Thanks for reporting and the test case
> Single choice() without otherwise() always executed
> ---------------------------------------------------
>
> Key: CAMEL-16082
> URL: https://issues.apache.org/jira/browse/CAMEL-16082
> Project: Camel
> Issue Type: Bug
> Components: came-core
> Affects Versions: 3.7.0, 3.7.1
> Reporter: Frank Wippermüller
> Assignee: Claus Ibsen
> Priority: Major
> Fix For: 3.7.2, 3.8.0
>
> Attachments: SimpleChoiceTest.java
>
>
> When building a route including a choice with a single {{when()}} and without an {{otherwise()}}, the first {{SimpleExpression}}-{{when()}} is always satisfied:
> {code:java}
> from("direct:start")
> .choice()
> .when().simple(expression)
> // always routed to
> .to(whenTarget)
> .end()
> .to(end)
> {code}
> An empty {{otherwise()}} restores choice logic:
> {code:java}
> from("direct:start")
> .choice()
> .when().simple(expression).to(whenTarget)
> .otherwise()
> .end()
> .to(end)
> {code}
> I included a simple Test-Case that *fails with Camel 3.7.x* and *passes with Camel 3.6.x*.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)