Automating Decisions with Decision trees
2 Tasks
10 mins
Beginner
Pega Platform '24.2
Case Management
English
Scenario
GoGoRoad is expanding its services and providing towing requests to its customers. Customers initiate a towing request and enter their vehicle type and miles to be covered. Configure a Decision tree and Declare Expression so that the towing cost is determined automatically based on the vehicle type and miles entered.
The following table provides the credentials you need to complete the challenge.
Role | User name | Password |
---|---|---|
Application Developer | author@gogoroad | pega123! |
Note: The challenge walkthrough video is coming soon.
Detailed Tasks
1 Configure the Towing cost calculation Decision tree
- In the Pega instance for the challenge, enter the following credentials:
- In the User name field, enter author@gogoroad.
- In the Password field, enter pega123!.
- From the navigation pane of Dev Studio, click App.
- Right-click Create > Decision > Decision Tree. and click
- In the Label field, enter Towing cost calculation tree.
- Click Create and open to create the Decision tree.
- Click <click here to add a Condition> to add a Condition.
- In the first empty field, enter or select .Miles.
- Change the operator value to >.
- In the second empty field, enter 20.
- Click the return drop-down and select continue. An indented, nested Condition is displayed.
Note: If the Conditions do not display, save and refresh the Decision tree.
- Click the nested Condition and repeat steps 6-9 to specify the Condition if .VehicleType = "Sedan" return 80.
- With the nested Condition selected, click Add Row twice to add two additional nested Conditions.
- Repeat steps 6-9 to define all the following Conditions:
Miles > Vehicle type = Return if 20 Sedan 80 if 20 Crossover 88 if 20 Truck 96 - Select the first top-level Condition and click Add Row two times to add two additional top-level Conditions.
- Repeat steps 6-12 to define the following Conditions:
Miles > Vehicle type = Return if 10 Sedan 40 if 10 Crossover 44 if 10 Truck 48 if 0 Sedan 20 if 0 Crossover 22 if 0 Truck 24 - In the otherwise row, enter the default return value of 0.
- Click Save to save the Decision tree.
2 Configure Towing cost Declare Expression
- From the navigation pane, right-click AssistanceRequest and click Create > Decision > Declare Expression.
- In the Target Property field, enter or select .TowCost.
- Click Create and open.
- In the Build Expressions section, in the Value of drop-down, select Result of Decision Tree.
- In the empty field to the right, enter or select TowingCostCalculationTree.
- Click Save.
Confirm your work
- Switch to and click .
- Click Create > Assistance Request to create a new Assistance Request Case instance.
- In the View, select Service type as Tow vehicle.
- In the[email protected], which is enrolled in Standard Coverage level.
Note: Selecting a user with Gold coverage does not display the Enter Payment Information View during Case processing and selecting a user with no Enrollment and Coverage level will prompt for enrollment.
View, in the Customer ID field, select
- Advance the Case past the View to display the View.
- Select a Service provider from the list of Service providers and Submit.
- Advance the Case to the View.
- In Tow vehicle check box. View, click the
- In the type list, select Sedan.
- In the
- Click Submit.
- In the Tow cost is $80.00.
- Create an additional Case instance, selecting a customer enrolled in Standard Coverage, and advancing the Case to the Select Services View.
- In the field, select Crossover.
- In the Miles field, enter 5.
- Click Submit.
- Verify that the Tow cost is now $22.00.
- Optional: Create additional Case instances and enter different Vehicle type and Miles values. Verify that the Tow cost is consistent with the values specified in the TowingCostCalculationTree decision tree.
This Challenge is to practice what you learned in the following Module:
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?