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 2026/09/23 11:33:00 UTC
[jira] [Updated] (CAMEL-24920) camel-core: the ternary operator cannot take a compound condition (&& or || inside ${ })
[ https://issues.apache.org/jira/browse/CAMEL-24920?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen updated CAMEL-24920:
--------------------------------
Fix Version/s: 4.23.0
> camel-core: the ternary operator cannot take a compound condition (&& or || inside ${ })
> ----------------------------------------------------------------------------------------
>
> Key: CAMEL-24920
> URL: https://issues.apache.org/jira/browse/CAMEL-24920
> Project: Camel
> Issue Type: Improvement
> Components: camel-core
> Reporter: Claus Ibsen
> Assignee: Claus Ibsen
> Priority: Major
> Fix For: 4.23.0
>
>
> {{$\{a > 0 && b < 10 ? 'x' : 'y'\}}} is refused:
> {noformat}
> Logical operator && needs a predicate on the right hand side, e.g. ${header.foo} == 'bar'
> {noformat}
> Parentheses do not help either - {{$\{(a > 0 && b < 10) ? 'x' : 'y'\}}} is refused the same way. A single comparison is fine, so {{$\{header.n > 0 ? 'positive' : 'negative'\}}} works.
> So the ternary accepts a condition, but only a comparison: any real condition has to be lifted out of the braces, and outside the braces a {{?}} and a {{:}} are literal text, so the ternary cannot be written at all. The only way out is a choice EIP or a bean.
> That is hard to defend on its own terms, and it is a small gap next to the larger question of operators inside {{$\{ \}}} in general (a separate issue, with the analysis behind it).
> Tested on 4.23.0-SNAPSHOT.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)