Designer:Model Validation

From FlexRule Wiki
Jump to: navigation, search

FlexRule Designer > Validation of document


Validation

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

Result Panel

When the Validate command (which can be found on Rule->Validate from the menu bar) on any document is run:

Validate-menu.png

Then the result of validation will appear on the Messages pane:

Validate-messages.png

The message list then shows all of the related information regarding the rule document validation. There are couple of different message types:

  1. Information: Just information regarding the validation process
  2. Warning: There are some issues with document, but they are minor.
  3. Error: The document is invalid, and should be fixed.
  4. 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.

Decision Table

Overlaps

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).

Business-rule-conflict-decision-table2.png

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).

Dt-Business-rule-conflicts.png