Conducting completeness analysis
About this task
In this example, a decision service is created and a completeness analysis is conducted to evaluate the decision logic of the decision model.
Procedure
-
Create a decision service with the necessary specifications. For example, define the following specifications:
- An input data node called
customerof typecustomer. - A decision node called
categoryof type string that depends on thecustomernode. - The
customertype withageandcart valueattributes.
- An input data node called
- Define the decision logic by providing the rules in the rule editor.
For more information, see Rule structure.if < condition > then < action >In this example, the following rules are defined. These rules define thecustomerby specifying theageandcart value. The rules set the category value toGold,Silver, orPlatinumbased on theageandcart valueconditions.Rule 1
if the age of customer is at least 30 and the cart value of customer is at most 20 then set decision to "Gold" ;Rule 2
if the age of customer is more than 5 and the age of customer is less than 20 and the cart value of customer is more than 10 and the cart value of customer is less than 35 then set decision to "Gold" ;Rule 3
if the age of customer is at most 15 and the cart value of customer is at most 15 then set decision to "Silver" ;Rule 4
if the age of customer is at least 20 and the cart value of customer is at least 35 then set decision to "Platinum" ;Rule 5
if the age of customer is at most 10 and the cart value of customer is at least 30 then set decision to "Gold" ; -
In the Modeling tab, click the
customernode. -
To conduct the completeness analysis and generate missing rules, click the Analyze
the decision logic icon
, in the Logic tab.
The time taken to generate missing rules depends on various factors. These factors might include the number of variable bindings of a rule, the number of logical tests in the rule conditions, and the mathematical operations that are used in the logical rules.The analyzer might take longer than usual to generate missing rules for a complicated decision logic. - Optional:
If missing rules are generated, review them, define meaningful actions
and approve the rules.
If your decision logic is incomplete, the completeness analyzer identifies any missing rules that can be added to the decision logic to improve it. These missing rules are rule skeletons and provide only meaningful conditions. The actions consist of generic default decisions.
Missing rules are formulated with the help of logical tests that occur in the original rules. Their conditions are logical conjunctions that are formulated with those logical tests or their negations. If completeness analysis terminates without reaching a timeout, missing rules do not overlap with the original rules and thus cover only cases that are not already covered by the original rules. However, missing rules may overlap with other missing rules, which can cause multiple missing rules to cover the same case.
The generated missing rules are in their most general form, which limits the number of missing rules that are generated. A maximum of 10 missing rules is generated in one request.
-
Review the missing rules.
Newly generated missing rules are not active and are highlighted in the UI. The following rule is an example of a generated missing rule.
if the age of customer is less than 20 and the age of customer is more than 10 and the cart value of customer is more than 35 then -- This is a generated rule. Choose a meaningful value for the decision variable. set decision to "" ; -
Edit the missing rules to define the actions that are to be taken, based on your decision
logic. Parsing errors appear only in the editor and not in the error report.
For example, set the decision variable of the following missing rule to
Gold.if the age of customer is less than 20 and the age of customer is more than 10 and the cart value of customer is more than 35 then set decision to "Gold" ; -
Approve the missing rule by clicking the overflow menu
of the rule and selecting Approve. When you approve a missing rule, it becomes a regular rule and is no longer highlighted. When you run a model, all active rules are used. Potential errors appear in the error report. You can undo the approval of a missing rule by clicking the Undo icon
.
- Generate more missing rules if necessary, by repeating the actions from step 4. If extra missing rules are generated, they might overlap with other missing rules, but they do not overlap with the missing rules that were approved. The generation of missing rules cannot be undone.
-
Review the missing rules.