Apache camel 如何将多个语句放入camel blueprint选择块中的逻辑表达式中?

Apache camel 如何将多个语句放入camel blueprint选择块中的逻辑表达式中?,apache-camel,blueprint-osgi,Apache Camel,Blueprint Osgi,在camel blueprint选项块中,我们有以下内容: <when id='foo' <simple><![CDATA[ ${header.SrcSys} == 'System_A' and ${header.DestSys} == 'System_B' ]]></simple> <!-- do something great --> </when> 我知道这段代码不

在camel blueprint选项块中,我们有以下内容:

<when id='foo'
    <simple><![CDATA[
        ${header.SrcSys} == 'System_A' and
        ${header.DestSys} == 'System_B'
    ]]></simple>

    <!-- do something great -->
</when>
我知道这段代码不起作用,也知道这段代码已被弃用。但是我想你知道我想做什么,也许你可以告诉我将这样一个简单的表达式实现为xml的最佳方法


我找到了。也许我可以在BlueprintXML中使用PredicateBuilder。但是我试图找到一个没有Java代码的解决方案。

我想你就快到了。这对我很有用:

<choice>
    <when>
        <!-- Do not break up the following simple expression over multiple lines. It won't work. -->
        <simple>${exchangeProperty.prop1} == 'A' &amp;&amp; ${exchangeProperty.prop2} == 'B'</simple>
        <!-- Do something great... -->
    </when>
</choice>

关键是不要将表达式拆分为多行。我无法使其正常工作。

我试图用camel 2.24.2重新构建此错误,但问题中的代码片段可以正常工作。可能是因为我以前使用过camel 2.17.0,所以camel有所改变@拉尔夫我检查你的答案是否被接受,因为它是有效的,但是你可以在最新的驼峰版本中使用换行符。