You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Corneliu Chitic <co...@computaris.com.INVALID> on 2020/09/07 22:52:03 UTC

Usage of and, or - documentation vs api support

Hi,

I have two questions related to usage of AND & OR:
1. I found this statement in the Simple's language documentation: https://camel.apache.org/components/latest/languages/simple-language.html#_using_and_or
'Notice: Currently && or || can only be used once in a simple language expression. This might change in the future.
So you cannot do:
simple("${in.header.title} contains 'Camel' && ${in.header.type'} == 'gold' && ${in.header.number} range 100..200")'

However I found a unit test that suggest otherwise: SimpleOperatorTest.java (methods testThreeAnd, testThreeOr, etc).
Can you please clarify which one is correct? I found some source code which uses multiple operators and seem to work fine but I want to be aware of the possible consequences, now or in the near future.

2. Also, can you please state if there is any performance penalty in using the HTML equivalent code in XML: &amp;&amp; instead of && and the &#124;&#124; Instead of ||?

Thank you
This email is subject to Computaris email terms of use: https://www.computaris.com/email-terms-use/

Re: Usage of and, or - documentation vs api support

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

1)
Yeah that doc snippet is outdated, I am removing this.

2)
No performance overhead

On Tue, Sep 8, 2020 at 12:52 AM Corneliu Chitic
<co...@computaris.com.invalid> wrote:
>
> Hi,
>
> I have two questions related to usage of AND & OR:
> 1. I found this statement in the Simple's language documentation: https://camel.apache.org/components/latest/languages/simple-language.html#_using_and_or
> 'Notice: Currently && or || can only be used once in a simple language expression. This might change in the future.
> So you cannot do:
> simple("${in.header.title} contains 'Camel' && ${in.header.type'} == 'gold' && ${in.header.number} range 100..200")'
>
> However I found a unit test that suggest otherwise: SimpleOperatorTest.java (methods testThreeAnd, testThreeOr, etc).
> Can you please clarify which one is correct? I found some source code which uses multiple operators and seem to work fine but I want to be aware of the possible consequences, now or in the near future.
>
> 2. Also, can you please state if there is any performance penalty in using the HTML equivalent code in XML: &amp;&amp; instead of && and the &#124;&#124; Instead of ||?
>
> Thank you
> This email is subject to Computaris email terms of use: https://www.computaris.com/email-terms-use/



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2