Decision Table Analyzer

This topic explains how to use the Decision Table Analyzer, which you use to analyze the rules file currently loaded in the Decision Table Editor.

Using the Table Analyzer

Use the Table Analyzer to examine .sbdt format decision table files to report logic problems with the specified rules, such as different sets of actions for identical conditions. The Table Analyzer validates decision tables by checking them at design time. You can also use the Table Analyzer's Show Coverage feature to simulate an incoming tuple to see how the current rules file handles the fields in that tuple.

Design time validation consists of:

  1. Expression validation

    1. This validates whether expressions in the Condition or Action columns are valid.

    2. Invalid expressions are marked as errors.

  2. Condition validation

    1. This validates whether the expression can represent a meaningful condition.

    2. Any expression that eventually evaluates to "always true" or "always false" is considered invalid.

      Simple example 1: > 10 && < 5, is always false no matter what the incoming data is.

      Simple example 2: > 50 || < 100 is always true no matter what the incoming data is.

      The Table Analyzer is able to detect more complex expressions such as: (> 100 || < 50) && (>60 && < 80).

Rule analysis consists of:

  1. Overlap: rules that have overlapping region. A region covered by both rules is reported.

    1. For example, given two rules (conditions are merged for convenience): rule1: (i >10 && i <= 20) && (j > 100 && j < 200), rule2: (i > 15) && (j < 150), then the overlapping region (i > 15 && i <= 20) && (j > 100 && j < 150) is reported.

  2. Duplication: rules that have same conditions and actions. This is a special case of overlap.

    1. Even when conditions are different literally, as long as they evaluate to the same, semantically, the Analyzer reports them as duplicates.

    2. Simple example: (> 10 && <= 200) and (>10 && < 200 || 200) will be reported as duplicates, if they are the only condition in each rule.

  3. Ambiguity: rules have same conditions but different actions.

  4. Superset: one rule's region completely covers another rule's. This is also a special case of overlap.

To use the Table Analyzer, do the following:

  1. Open an .sbdt decision table on the Studio canvas and make sure the Table Analyzer tab is active.

  2. Click the Analyze button. A message appears indicating whether rules are valid. The Table Analyzer displays invalid rules in the Problems view, including a description, the decision table file name, project folder, problem source, and problem type.

Using the Show Coverage Feature

Rules will run regardless of whether warnings appear in the Problems tab. Another useful Table Analyzer feature to troubleshoot rule issues or encourage rule creation best practice is Show Coverage. Show Coverage highlights rules that share predicates in common, based on rule creation. This is particularly useful to eliminate duplication, especially when editing large rule sets.

In the example below, two conditions and their ranges or values appear in the Table Analyzer, Age and Name. Adjust the upper and lower Age ranges (by adjusting the slider or entering values), select Names and click the Show Coverage button to display the result. Four rules, highlighted in green, meet the selected criteria.