Skip to main content

Automating Decisions with Decision trees

2 Tasks

10 mins

Visible to: All users
Beginner Pega Platform 8.8 Case Management English
Verify the version tags to ensure you are consuming the intended content or, complete the latest version.


An organization is launching an application that facilitates loan requests. Customers initiate a loan request and enter their credit score, loan amount, and country. Configure a decision tree and declare expression so that the loan rate is determined automatically based on the credit score, loan amount, and country the customer enters. For this challenge, if the customer specifies Canada as the country, the loan amount does not affect the loan rate. 

The following table provides the credentials you need to complete the challenge.

Role User name Password
Application Developer author@loans pega123!
Note: Your practice environment may support the completion of multiple challenges. As a result, the configuration shown in the challenge walkthrough may not match your environment exactly.

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

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

Challenge Walkthrough

Detailed Tasks

1 Configure the Borrower risk adjustment decision tree

  1. In the Pega instance for the challenge, enter the following credentials:
    1. In the User name field, enter author@loans.
    2. In the Password field, enter pega123!.
  2. From the navigation pane of Dev Studio, click App.
  3. Right-click LoanRequest and click Create > Decision > Decision Tree.
  4. In the Label field, enter Borrower risk adjustment 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 .Country.
  8. Keep the operator value as =.
  9. In the second empty field, enter Canada.
  10. Click the return drop-down and select continue. An indented, nested condition is displayed.
    Condition if Country = Canada then continue
    Note: 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 .CreditScore > 800 then return .0200.
    First nested condition, if Credit Score is greater than 800 then return .0200
  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 the following conditions:
      Country Credit score > Return
    if Canada 800 .0200
    if Canada 700 .0275
    if Canada 200 .0425
    Nested conditions if the country is Canada
  14. Select the first top-level condition and click Add Row three times to add three additional top-level conditions.
  15. Repeat steps 6-12 to define the following conditions:
      Credit score > Loan amount > Return
    if 800 50000 .0225
    if 800 0 .0200
    if 700 50000 .0325
    if 700 0 .0275
    if 200 50000 .045
    if 200 0 .0425
    Decision tree
  16. In the otherwise row, enter the default return value of .07.
  17. Click Save to save the decision tree.

2 Configure the Loan rate declare expression

  1. From the navigation pane, right-click LoanRequest and click Create > Decision > Declare Expression.
  2. In the Target Property field, enter or select .LoanRate.
    Declare expression for Loan rate property
  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 BorrowerRiskAdjustmentTree.
    Loan rate declare expression set by BorrowerRiskAdjustmentTree
  6. Click Save.

Confirm your work

  1. In the header of Dev Studio, click Create > New > Loan Request to create a new Loan Request case instance.
  2. In the Loan amount field, enter 5000.
  3. In the Credit score field, enter 600.
  4. In the Country drop-down, select Canada.
  5. Click Submit.
  6. Verify that the Loan rate is 4.25%.
    Verify loan rate is 4.25% with loan amount $5000
  7. Create an additional Loan Request case instance.
  8. In the Loan amount field, enter 50000.
  9. In the Credit score field, enter 600.
  10. In the Country drop-down, select Canada.
  11. Click Submit.
  12. Verify that the Loan rate is 4.25%.
    Verify loan rate is 4.25% with loan amount $50000
  13. Optional: Create additional case instances and enter different Credit score, Loan amount, and Country values. Verify that the Loan rate is consistent with the values specified in the Borrower risk adjustment 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.

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