BRE: validating message with not presenting elements

Editorial architecture visual showing system boundaries, service interaction, and technical tradeoffs

One of the business rule I am facing is to validate the message upon business rules. The problem being the rules engine when tries to evaluate the if a certain string from an element of the message, if that element is not presenting, the rule engine will get an error. i.e. if my element name is firstname, one of business rule is to check if firstname length >10 while the firstname element is not there in the message, the rules engine will throw exception.

To fix this problem, it turns out, needs to include an AND predicate for an exist statement  together with the string length checking condition. The exist statement has to define as “xpath field exists xpath selector”.

Another note is, regardless of if I suppress the empty node, if the field is set to be padded with 0, even if the field is empty, the empty node will be passed rather then removed after disassemble.

This costs me almost half a day..

Next step

Need this reviewed in a real system?

Use the article as a starting point, then bring the actual decision, constraints, and failure paths into an architecture review.

Join the discussion

Sign in to comment. Signed-in comments appear immediately.

Join the discussion