According to the following ticket: https://www.mulesoft.org/jira/browse/MULE-6427 For NullPayload I should be able to use :
<when expression="#[payload == null]">
but that fails. So instead I have to use:
<when expression="#[payload is NullPayload]">
Am I doing something wrong? Or is this the correct way for checking for null or NullPayload?
In theory, this should be fixed, but it doesn't looks like so. I'm using CE 3.4.0 and the expression #[payload == null] doesn't work for NullPayload.
I've found this link that shows how to check if payload is NullPayload correctly:
#[payload is org.mule.transport.NullPayload]
I actually needed to know if payload was not NullPayload, so my expression was:
#[!(payload is org.mule.transport.NullPayload)]
Works like a charm. :)
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