In order to compare the value of two properties in WSO2 ESB, for example to do a filter operation based in the result of a comparision, you can do as follows:

Note: First filter use a regex to check if the “propertyCompare” is true. The second one uses xPath.

<property name="propertyA" value="'codertechblog.com'"/>
<property name="propertyB" value="'codertechblog.com'"/>
<property name="propertyCompare" expression="get-property('propertyA') = get-property('propertyB')"/>
<filter source="get-property('propertyCompare')" regex="true">

<then>
<log level="custom">
<property name="filterA" expression="'Strings are equal'"/>
</log>
</then>

</filter>
<filter xpath="get-property('propertyA') = get-property('propertyB')">

<then>
<log level="custom">
<property name="filterB" expression="'Strings are equal'"/>
</log>
</then>

</filter>

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>