Skip to main content

Automating Decisions with Decision trees

2 Aufgaben

10 Min.

Visible to: All users
Anfänger
Pega Platform '24.2
Case Management
Englisch
Prüfen Sie die Version, um sicherzustellen, dass Sie mit dem richtigen Inhalt arbeiten, oder schließen Sie die neueste Version ab.

Szenario

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!

Sie müssen zum Abschließen dieser Challenge Ihre eigene Pega-Instanz starten.

Die Initialisierung kann bis zu 5 Minuten dauern, bitte haben Sie Geduld.

Challenge-Schritte

Genaue Übungsschritte

1 Configure the Towing cost calculation Decision tree

  1. In the Pega instance for the challenge, enter the following credentials:
    1. In the User name field, enter author@gogoroad.
    2. In the Password field, enter pega123!.
  2. From the navigation pane of Dev Studio, click App.
  3. Right-click Assistance Request and click Create > Decision > Decision Tree.
  4. In the Label field, enter Towing cost calculation tree.
  5. Click Create and open to create the Decision tree.
  6. Click <click here to add a Condition> to add a Condition. 
    Click to add a condition link when configuring a decision tree
  7. In the first empty field, enter or select .Miles.
  8. Change the operator value to  >.
  9. In the second empty field, enter 20.
  10. Click the return drop-down and select continue. An indented, nested Condition is displayed.
    Condition if miles is 20 then continue
    Hinweis: If the Conditions do not display, save and refresh the Decision tree.
  11. Click the nested Condition and repeat steps 6-9 to specify the Condition if .VehicleType = "Sedan" return 80.
    Nested condition if vehicle type is Sedan
  12. With the nested Condition selected, click Add Row twice to add two additional nested Conditions.
    Add row button
  13. 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
    Nested condition first
  14. Select the first top-level Condition and click Add Row two times to add two additional top-level Conditions.
  15. 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
    Decision tree towing cost nested conditions
  16. In the otherwise row, enter the default return value of 0.
  17. Click Save to save the Decision tree.

2 Configure Towing cost Declare Expression

  1. From the navigation pane, right-click AssistanceRequest and click Create > Decision > Declare Expression.
  2. In the Target Property field, enter or select .TowCost.
    Declare expression configuration
  3. Click Create and open.
  4. In the Build Expressions section, in the Value of drop-down, select Result of Decision Tree.
  5. In the empty field to the right, enter or select TowingCostCalculationTree.
    Buidling expression Configuration in Declare Expression
  6. Click Save.

Arbeit überprüfen

  1. Switch to App Studio and click Preview.
  2. Click Create > Assistance Request to create a new Assistance Request Case instance.
  3. In the Identify issue View, select Service type as Tow vehicle.
  4. In the Enter customer information View, in the Customer ID field, select [email protected], which is enrolled in Standard Coverage level.
    Hinweis: 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. 
  5. Advance the Case past the Enter payment information View to display the Select service provider View.
  6. Select a Service provider from the list of Service providers and Submit.
    Service providers list with one selected
  7. Advance the Case to the Select services View. 
  8. In Select services View, click the Tow vehicle check box.
  9. In the Vehicle type list, select Sedan.
  10. In the Miles field, enter 30.
    Tow vehicle selected in the Select services view
  11. Click Submit.
  12. In the Review service summary View, verify that the Tow cost is $80.00.
    Review service summary view with the Sedan, 30 miles, and Tow Cost of USD80.
  13. Create an additional Assistance Request Case instance, selecting a customer enrolled in Standard Coverage, and advancing the Case to the Select Services View.
  14. In the Vehicle type field, select Crossover.
  15. In the Miles field, enter 5.
  16. Click Submit.
  17. Verify that the Tow cost is now $22.00.
    Review service summary view with Crossover, 5 miles, and USD22
  18. 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.

In dieser Challenge üben Sie, was Sie im folgenden Modul gelernt haben:


In der folgenden Mission verfügbar:

Wenn Probleme mit den Lerninhalten auftreten, lesen Sie bitte die Pega Academy Support FAQs.

Fanden Sie diesen Inhalt hilfreich?

Möchten Sie uns dabei helfen, diesen Inhalt zu verbessern?

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