Testing for a Null Value using the Message Filter Primitive
July 6, 2007 Leave a comment
If you’re creating a Message Filter primitive in a mediation flow using WebSphere Integration Developer, it may not be immediately obvious how to define a criterion that will fire when an element of the message is null. The following XPath expression should be sufficient:
count(/body/myOperation/myElement) = 0
Obviously, the expression inside the brackets should be replaced with the part of the message you wish to test. You can find this easily by using the regular XPath editor. Then click ‘Override’ and alter the expression so that it is of the form shown above.
Thanks to Ian for help with this tip.