Search code examples
registrywso2esb

wso2 - how to check if a registry key exist or not into esb


is possible in ESB check if a registry key exist or not, and get back a value like TRUE or FALSE?

here is my key:

<?xml version="1.0"?> 
<soap:Envelope xmlns:soap="w3.org/2001/12/soap-envelope" soap:encodingStyle="w3.org/2001/12/soap-encoding"> 
<soap:Body xmlns:m="example.org/stock">
<localEntry xmlns:local="ws.apache.org/ns/synapse" key="myVersion2">1</localEntry> 
</soap:Body> 
</soap:Envelope>

I would try to check if the key "myVersion2" exist Thank you

Regards Claudio


Solution

  • fixed it by my self..

    it's enough to get the "key" value and add a filter

             <property name="registryKey"
                   expression="$ctx:myProp//localEntry/@key"
                   scope="default"
                   type="STRING"/>
     ...
         <filter source="get-property('registryKey')"
                 regex="myVersion2"
                 description="filter">
    

    I hope this could help someone else Regards Claudio