[ 
https://issues.apache.org/jira/browse/CAMEL-17755?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17503036#comment-17503036
 ] 

Claus Ibsen commented on CAMEL-17755:
-------------------------------------

Yeah the pro with doSwitch is that it seperates it from choice. But we may in 
the future find a few other EIPs where precondition makes sense.

So it can be something like (precondition should just be turned on, and then 
use the when predicates as today)

{code}
.choice().precondition()
.when(simple("{{?red}}")).to("mock:red")
.when(simple("{{?blue}}")).to("mock:blue")
.end()
{code}

And in XML
{code}
<choice precondition="true">
 ...
{code}

Then precondition is a boolean type on this EIP to enable this mode.
Then the choice reifier can check which mode it uses, and then do as 
DoSwitchReifier does when its true.

And then move the docs from DoSwitch to Choice EIP in a new section about the 
precondition mode

> camel-core - DoSwitch can be Choice with precondition set
> ---------------------------------------------------------
>
>                 Key: CAMEL-17755
>                 URL: https://issues.apache.org/jira/browse/CAMEL-17755
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>            Reporter: Claus Ibsen
>            Assignee: Nicolas Filotto
>            Priority: Major
>             Fix For: 3.17.0
>
>
> With CAMEL-17555 we use the term "precondition" to filter whether the 
> route/EIP should be included or not (eager).
> To standardize on precondition then we can remove DoSwitch and use Choice 
> instead and add precondition to choice.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to