Friday, June 27, 2014

Compare the values of property in WSO2 ESB

Most of the time i use to get question on "How to compare the values of the property in WSO2 EBS" from most of the wso2 ESB users. WSO2 ESB give a adequate support for value comparison for properties.

I have created simple configuration to demonstrate that functionality.
<property name="propertyA" value="'abc'"/>
<log level="custom">
<property name="propertyA" expression="get-property('propertyA')"/>
</log>
<property name="propertyB" value="'abc'"/>
<log level="custom">
<property name="propertyB" expression="get-property('propertyB')"/>
</log>
<property name="propertyCompare" expression="get-property('propertyA') = get-property('propertyB')"/>
<log level="custom">
<property name="propertyCompare" expression="get-property('propertyCompare')"/>
</log>
<filter source="get-property('propertyCompare')" regex="true">
<then>
<log level="custom">
<property name="filterA" expression="'worked'"/>
</log>
</then>
</filter>
<filter xpath="get-property('propertyA') = get-property('propertyB')">
<then>
<log level="custom">
<property name="filterB" expression="'worked'"/>
</log>
</then>
</filter>
view raw propertyCompare hosted with ❤ by GitHub
 

No comments:

Post a Comment