Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Rule Composer – Getting the xpath from a typed node
- This topic has 0 replies, 1 voice, and was last updated 9 years, 2 months ago by
community-content.
-
AuthorPosts
-
-
July 4, 2014 at 1:31 AM #26388
Hi
I’m new here and to BizTalk. In the rule composer I’ve setup my vocabularies and have started implementing rules.
When a rule is evaluated to false I have a custom function called AddValidationError which is attached to the Action section. This method accepts three parameters, a TTypedXmlDocument containing the validation errors node, an xpath to the node that was validated and an error code. AddValidationErrors will append a new ValidationError node to the validation errors node containing the error code, error message, severity, and the xpath of the node that was validated.
The issue is that I can’t figure out how to get the xpath to the node being validated so that I can pass it to the AddValidationError function. I have tried defining the xpath parameter as a TTypedXmlDocument which allows me to pass nodes of type TTypedXmlDocument, from there i can working the xpath but this doesn’t allow me to pass nodes of other types, such as String, Int, DateTime, etc.
Basically I want to be able to add the xpath to the node being validated into the validation errors. I noticed that the Predicate function Exists cal accepts any node from which it resolves the xpath however I can’t figure out how it does this.
Anyway I was hoping that someone could point me in the right direction. How can I pass a node of any type to a function, or get the xpath to node being validated which I can then simply pass as a string.
Note that I am aware that I can simply type the xpath or copy it from the node properties window but the rule will be managed by people who are not developers, e.g. BA’s or system administrators. I don’t really want to expect them to write an xpath query or piece one together from the node properties. I also thought that I could add two definition’s for each node, one of the value type (String, decimal, DateTime) and another of type TTypedXmlDocument and pass the TTypedXmlDocument one to the AddValidationError method, which works but its not really ideal.
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.