如何更新camel属性值?

时间:2017-10-25 11:46:58

标签: properties routes

我的路线中有一个属性。我想在选择/何时更改此属性的值。我怎么能在我的路线上这样做?

<route>
    <setProperty propertyName="UpdateORInsert">
        <constant>INSERT</constant>
    </setProperty>

    <choice>
    <when>
       ------Change value of UpdateORInsert-------
    </when>
    </choice>

</route>

1 个答案:

答案 0 :(得分:0)

It can be done using simple component in your route inside `when`:

    <route>
        <setProperty propertyName="UpdateORInsert">
            <constant>INSERT</constant>
        </setProperty>
        <choice>
        <when>
          <simple>${Yourspecificcondition}</simple>
         <setProperty propertyName="UpdateORInsert">
            <constant>UPDATE</constant>
        </setProperty>
        </when>
        </choice>
    </route>