Skip to main content

Configuring a decision tree

Configuring a decision tree

Create a decision tree to use if...then...else decision logic that calculates a value from a set of test conditions organized as a tree structure.

Follow these steps to create and configure a decision tree for automating a decision:

  1. Create the decision tree.
  2. Add a condition and result.
  3. Optionally, nest the conditions

Create the decision tree

  1. Open the Application Explorer.
  2. Select the class in which you want to create the decision tree.
  3. Right-click and select Create > Decision > Decision Tree. The New Record form opens.
  4. In the Label field, enter a name that describes the purpose of the tree.
  5. Click Create and open. The decision tree rule form opens.

    Blank decision tree no call outs

Add a condition and the result

  1. On the form, select the branch to display the columns.

    Decision tree no call outs
  2. In the first field, enter a property or a literal value.
  3. In the drop-down to the right of the field, select a comparison operator.
  4. In the next field, enter a property or literal value used in the comparison.
  5. In the then drop-down, select the action you want the system to perform when the condition evaluates to true. To return a result when the condition evaluates to true, select return.
  6. In the field to the right of the then drop-down, enter a property or value result that you want the system to return. The following shows a completed condition.
    Decision Tree 9

    When you click out of the branch, the condition is displayed on the form.

    Decision Tree 10

Nest the conditions

  1. When you create a condition, in the then drop-down, select continue to create a nested branch. The return field to the right of the drop-down is removed. An indented condition branch is displayed under the first row.
    Nested 1A
  2. Select the second branch to display the columns.
  3. Specify a condition and result in this branch. The following condition is an example of an indented branch.

    Decision tree 8
  4. To add an otherwise condition to the indented branch, select the Plus icon.
    Decision  tree 3A
  5. In the second branch, select otherwisein the then drop-down. The system changes the branch to otherwise.

    Otherwise row
  6. Select the otherwise row to display the result field and to enter a value.

    otherwise work manager
  7. Enter a value in the otherwise field at the bottom of the table. This is the result when neither of the nested conditions evaluate to true. The following image provides an example of a completed decision tree.

    Decision tree 11
  8. Click Save.
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