Part 2: Adding Decision Rules
This part of the tutorial show how a Decision Rules Object can be used to apply a checklist of "alert" rules which, if fired, would signal that the claim is to be referred and the reasons for the referral.
- Decision Rules is an alternative knowledge representation Object where multiple independent rules, leading to multiple outcomes (or no outcome), can result when fired at runtime. Although this type of knowledge can also be represented by creating a separate Decision Tree for each rule, Decision Rules offers a more compact and transparent alternative.
2.1 Creating a Decision Rules Object
2.1.1 From the "Main_Decision_Flow" decision tree editor, right-click on the Pass_Report object and select Add Knowledge
- Name: "Special_Authorisation_Rules"
- Knowledge Representation: "Decision Rules"
- Category: "Knowledge"
- Outcome Values: "High cost hotel claim", "Too many hotel nights" & "Claim for hotel with no travel"
- Type of split: "Multi-way Split"
2.1.2 Double click on "Special_Authorisation_Rules" to open its editor and add the following rules:
- At the bottom of the Object Palette (right-hand section of the Decision Rules editor) use Add an Existing Object to add "Number_Nights_Stay" and "Total_Hotel_Cost" to the Object Palette
- Click Add New Rule
- Drag & drop "Total_Hotel_Cost" from the Object Palette onto Rule#1 where it indicates 'Click to extend condition'
- Edit Rule #1
- If Total_Hotel_Cost > 1000.00
- Then Special_Authorisation_Rules = "High cost hotel claim"
- Click Add New Rule
- Drag & drop "Number_Nights_Stay" from the Object Palette onto Rule#2
- Edit Rule #2
- If "Number_Nights_Stay" > 5
- Then Special_Authorisation_Rules = "Too many hotel nights stay"
- Use Add a New Question to add a question to the Object Palette for Rule#3
- Name: "Claim_Items"
- Description: "Please select the items you are claiming for..."
- Category: Questions & Attributes
- Type: List
- Values: "Travel", "Hotel" & "Food"
- Multi-select: checked
- Click Add New Rule
- Drag & drop "Total_Hotel_Cost" from the Object Palette onto Rule#3 then drag & drop "Claim_Items" to extend condition
- Edit Rule#3
- If Total_Hotel_Cost > 0.00
- And Claim_Items Does not Overlap with Travel
- Then Special_Authorisation_Rules = "Claim for hotel with no travel"
- Click Save
2.2 Adding a Referred Claims Report
Move back to the Main_Decision_Flow Decision Tree editor
Select Add a Report to the end of the "Otherwise" branch by right-clicking the "Empty" leaf node and selecting Add a New User Interface Object...
- Name: "Special_Authorisation_Report"
- Category: Dialogs & Reports
- Type text: "This claim requires special authorisation for the following reasons: {Special_Authorisation_Rules}"
To avoid mistyping object names the toolbar has a green triangle icon for selecting objects from the Catalog and inserting them in the text surrounded by "{}"
- Set the Outcome Leaf after the "Special_Authorisation_Report" to "Done"
- Save and Run
Select different combination of values for "Employment_Grade", "Total_Hotel_Cost", "Number_Nights_Stay", "Central_London_Hotel", "Department" & "Claim_Items" to test for Pass, Reject and Special Authorisations.