Using Decision tables and Decision trees
1 Task
45 mins
Pega Platform '24.2
Beginner
Pega Platform '24.2
Case Management
English
Scenario
GoGoRoad stakeholders need to improve the pricing system around towing services. The cost of towing a vehicle is increasing for service providers. To support the service providers while still accommodating customers, GoGoRoad is introducing a tiered-system for calculating the cost of towing a vehicle. The new system calculates the cost of towing based on the distance (miles) and the type of vehicle. To help offset the higher cost of towing, GoGoRoad is also introducing an On-time performance discount that can be applied to the cost of towing based on the number of minutes that the service provider was past the expected arrival time.
As a System Architect on the GoGoRoad project, you have been tasked with automating the process of calculating the cost of towing on the Identify services performed Step for the Service Case Type. Use the information in the following tables to configure your calculations:
The following table contains the information for determining the cost for towing a vehicle using a Decision tree:
Miles > | Vehicle type = | Return |
---|---|---|
20 | Sedan | 200 |
20 | Crossover | 225 |
20 | Truck | 250 |
10 | Sedan | 150 |
10 | Crossover | 160 |
10 | Truck | 170 |
0 | Sedan | 120 |
0 | Crossover | 130 |
0 | Truck | 140 |
The following table contains the information for determining the service credit applied to the cost of towing a vehicle using a Decision table:
On-time performance | Return |
---|---|
Up to 15 minutes late | .TowCost * .05 |
Up to 30 minutes late | .TowCost * .1 |
More than 30 minutes late | .TowCost * .25 |
Otherwise | 0 |
As a new System Architect, your Lead System Architect provides you with a collection of technical documentation links to help you get started.
The following table provides the credentials you need to complete the challenge:
Role | User name | Password |
---|---|---|
Application Developer | author@gogoroad | pega123! |
Detailed Tasks
1 Use Decision tables and Decision trees
Read the technical documentation provided to complete the assigned tasks. The technical documentation might have more information than you need.
Acceptance criteria
- A Decision tree called Towing cost calculation tree is used to determine the cost of towing a vehicle based on the distance (miles) and the type of vehicle. The Decision tree is associated with the Service Case Type.
Miles > Vehicle type = Return 20 Sedan 200 20 Crossover 225 20 Truck 250 10 Sedan 150 10 Crossover 160 10 Truck 170 0 Sedan 120 0 Crossover 130 0 Truck 140 - For the Service Case Type, the field named Tow cost is the Target property of a declare expression. The value of the Tow cost property is built using the result of Towing cost calculation tree.
- The Service Case Type Data Model has field named On-time performance with a Field Type of Picklist. The four choices for the Picklist are: On time, Up to 15 minutes late, Up to 30 minutes late, and More than 30 minutes late.
- The Service Case Type Data Model has a field named Service credit with a Field Type of Currency. The Service credit field is a calculated field that uses a custom Decision table to calculate the discount applied to the Tow cost field. The Decision table associated with the Service credit field is configured as follows:
On-time performance Return Up to 15 minutes late .TowCost * .05 Up to 30 minutes late .TowCost * .1 More than 30 minutes late .TowCost * .25 Otherwise 0 - In the Service Case Type Data Model, has a field named Invoice total with a Field Type of Currency. Invoice total uses the following calculated expression: .ServicesTotal + .TowCost - .ServiceCredit.
- In the Service Case Type, in the Calculate invoice total Step, the View is updated to include the On-time performance, Service credit, and Invoice total fields. The Cost of towing Field Group is visible only when the Tow vehicle field is true.
Directions
- In the Pega instance for the challenge, log in as an Application Developer.
- In the Username field, enter author@gogoroad.
- In the Password field, enter pega123!.
- In Dev Studio, for the Service Case Type, create a Decision tree called Towing cost calculation tree using the information detailed in the Acceptance criteria.
- In Dev Studio, for the Service Case Type, create a Declare Expression for the Tow cost Property using the information detailed in the Acceptance criteria.
- In App Studio, in the Service Case Type Data Model, create a field called On-time performance using the information detailed in the Acceptance criteria.
- In the Service Case Type Data Model, create a field called Service credit using the information detailed in the Acceptance criteria.
- In the Service Case Type Data Model, create a field called Invoice total using the expression detailed in the Acceptance criteria.
- In the Service Case Type, update the View associated with the Calculate invoice total Step as detailed in the Acceptance criteria.
Confirm your work
- In the header of App Studio, click the button.
- Create an Assistance Request Case, and navigate to the Service Case Type.
- In the Calculate invoice total Assignment, and then verify the following information:
- When you select the Tow vehicle field, the Cost of towing Field Group is visible.
- Confirm that the combination of the Towing cost calculation tree Decision tree and the Tow cost Declare Expression work as expected when the Miles and Vehicle type are completed.
- Confirm that Service credit calculated field works as expected when an On-time performance value is selected.
- Confirm that the Invoice total calculated expression works as expected.
Following is an example of the Towing cost calculation tree Decision tree:
Following is an example of the Service credit Decision table:
Following is an example of the Calculate invoice total View:
To see a suggested solution, initialize an instance in the Using Insights challenge.
Available in the following mission:
If you are having problems with your training, please review the Pega Academy Support FAQs.
Want to help us improve this content?