I have the following problem. I want to execute a policy that checks for existance of a node and after that it should check if the value is greater than 0.
So lets say we have "xmlDoc" and I want to check if the node "test" exists and if the value of "test" is greater than 0.
<xmlDoc>
<test>5</test>
</xmlDoc>
When the node exists, there is no problem. When the node is missing though, all hell breaks lose.. It is obvious why he crashes. He can't find the node "test" so he can't check its value.
My question: is it possible in the BizTalk BRE to check on existance and on value of a node without it crashes?
There is the 'exists' Predicate on the list of Conditions, however, this doesn't always work since value fact is also evaluated.
One way I've found to address this is by creating a Vocabulary item and adjusting the Selector to point to the Element that may not exist, "text" in your case.
Then the XPath field would be the /text() node.
This way, if the Selector path returns null, the BRE knows the fact doesn't exist so no Rule that requires it will be evaluated.