Skip to main content

Using Decision tables and Decision trees

1 Task

45 mins

Pega Platform '24.2
Visible to: All users
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!

You must initiate your own Pega instance to complete this Challenge.

Initialization may take up to 5 minutes so please be patient.

Detailed Tasks

1 Use Decision tables and Decision trees

Using decision tables and decision trees Journey Map.

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

  1. In the Pega instance for the challenge, log in as an Application Developer.
    1. In the Username field, enter author@gogoroad.
    2. In the Password field, enter pega123!.
  2. 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.
  3. 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.
  4. 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.
  5. In the Service Case Type Data Model, create a field called Service credit using the information detailed in the Acceptance criteria.
  6. In the Service Case Type Data Model, create a field called Invoice total using the expression detailed in the Acceptance criteria.
  7. In the Service Case Type, update the View associated with the Calculate invoice total Step as detailed in the Acceptance criteria.

Confirm your work

  1. In the header of App Studio, click the Preview button.
  2. Create an  Assistance Request Case, and navigate to the Service Case Type. 
  3. In the Calculate invoice total Assignment, and then verify the following information:
    1. When you select the  Tow vehicle field, the Cost of towing Field Group is visible.
    2. 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.
    3. Confirm that Service credit calculated field works as expected when an On-time performance value is selected.
    4. Confirm that the Invoice total calculated expression works as expected.

Following is an example of the Towing cost calculation tree Decision tree:

A screenshot of the Towing cost calculation Decision tree.

Following is an example of the Service credit Decision table:

A screenshot of the Service cost Decision Table.

Following is an example of the Calculate invoice total View:

The fields associated with 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.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Academy has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice