FlexRule Designer > Validation of document
Validating rules would allow you to find possible potential problems with rules at design time. These problems include:
- Structural issues
- Missing values or elements
- Rules overlap
When the Validate command (which can be found on Rule->Validate from the menu bar) on any document is run:
Then the result of validation will appear on the Messages pane:
The message list then shows all of the related information regarding the rule document validation. There are couple of different message types:
- Information: Just information regarding the validation process
- Warning: There are some issues with document, but they are minor.
- Error: The document is invalid, and should be fixed.
- Conflicts: There are some conflicts on the document.
Finding the Issues
On the message list, when you double click on an error, it redirects you to the specific element in the document which is causing the problem, so you can find it easily. Then check the error message - it is probably referring to a missing property or invalid configuration of a set of properties. These can be fixed in the Properties window.
When modeling business rules, one of the ways to implement rules is by using Decision Tables. Decision Tables are a compact way of presenting a rules conditions and actions in tabular form.
In the Decision Table below we have organised the conditions, action and name of the rule in columns. Each row represents a business rule. When a column in a rule is empty, it means that the condition (in the column) does not participate in the rule (in the row).
Let’s see how we can translate row number 8:
Rule R5: IF Is Car New is false AND Car Age < 6 THEN Auto Premium += 400
In a Decision Table, identifying business rule conflict is not difficult if it is a small table, or the expression values are simple, but when it gets complex, finding business rule conflict is not that easy!
Validation on a Decision Table identifies any conflict of rules. In this example, three rule overlaps have been identified, and if you look at the values closely you notice for example that a ‘car age’ with value of ‘5’ will result the execution of all three rules: R5, R6 and R7 (i.e., row number #8 #9 #10).