I want to check if a property is null in a filter condition. It might not exist in the context or it can be null as well. I want to cover both cases. How can I write a filter expression? I tried something like the code below, but it's not working
<filter xpath="(get-property('studentId')!=null)">
What is the correct way to achieve this?
Once an error occurs users can perform various actions on those using the following options. One of the first things that can be done when an error occurs is to log the full error. When an error occurs the mediation engine used by WSO2 ESB tries to give maximum information via couple of properties.
There are several ways to retrieve query parameters from an HTTP request using WSO2 ESB. There is an XPath variable $url which we can use to retrieve query parameters from an HTTP request. Following is an example using the $url. Note that you don’t have to mention the query params in the uri-template
… The ESB profile of WSO2 Enterprise Integrator (WSO2 EI) supports standard XPath functions and variables through its underlying XPath engine. The ESB profile also provides custom XPath functions and variables for accessing message properties.
Once a fault is detected a user can do various things such as log the full error, send a fault back to the client, send an alert email to the system administrator etc. WSO2 ESB's run time components such as sequences, proxy services can be equipped with a fault handler.
You can check the existence of property by using boolean XPath function as below
<filter source="boolean(get-property('yourProperty'))" regex="false">
<then>
<!-- NULL OR NON EXIST -->
</then>
<else>
<!-- EXIST -->
</else>
</filter>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With