[ 
https://issues.apache.org/jira/browse/CAMEL-16082?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Frank Wippermüller updated CAMEL-16082:
---------------------------------------
    Description: 
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*.



  was:
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*.




> 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
>            Priority: Critical
>         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)

Reply via email to