Skip to main content
Verify the version tags to ensure you are consuming the intended content or, complete the latest version.

Decision tree or Decision table

Both decision tables and decision trees evaluate properties or conditions to return results when a comparison evaluates to true. While decision tables evaluate against the same set of properties or conditions, decision trees evaluate against different properties or conditions.

Decision tables

In a decision table, the values in a column evaluate against the same property/operator pair, such as Account type =, to return a value or property. Developers can use a decision table when they have to evaluate many combinations of the same set of properties or conditions to return one value or property. For example, a company uses the number of years at the company and ratings on five employee evaluation metrics to determine bonus eligibility.

Decision trees

Each branch in a decision tree evaluates the property/operator pair against a single value to perform an action, such as return a value or evaluate a nested condition. Developers can use a decision tree to evaluate conditions on different properties that might depend on other conditions. Each branch in a decision tree is evaluated, and all branches that evaluate to true perform the action that is described afterward, such as continuing the evaluation to the nested condition. For example, a language learning app runs extensive A/B testing, where some users receive hearts, and other users receive stars for their efforts. The values for hearts and stars are collected in separate properties. A decision tree evaluates the different rewards for which users are eligible based on the number of hearts or stars that are associated with the account.

In the center of the following image, slide the vertical line to compare the interface for setting up a decision table and a decision tree:

Considerations for use and configuration

Decision trees and decision tables perform similar functions. However, you cannot always use decision tables and decision trees interchangeably within Pega Platform™ applications. To select which logic to configure, consider what conditions you want to evaluate and where you need to use the decision table or decision tree.

For example, you can reference a decision table or decision tree on flow rules, declare expressions, activities, or routers. Some configurations, such as cascading approvals with an authority matrix, support only evaluation of decision tables.

The line-by-line structure of the decision tree provides an simple interface for a business stakeholder or low-code developer to configure and update dependent conditions that evaluate against different properties. If you use a decision table in a situation where a few conditions evaluate against the same property, the decision table has empty boxes where a value is not needed for the decision.

With the straightforward table structure of the decision table, a business stakeholder or low-code developer can configure and update a decision that evaluates against many of the same properties.

Consider a wizard that guides bank customers through a set of questions and returns the account type that best fits their needs. You can configure the decision with a decision table or a decision tree. Using a decision table to select an account type results in empty boxes, while using a decision tree results in duplicate conditions. 

In the center of the following image, slide the vertical line to compare the decision table and the decision tree for an account type decision:

Check your knowledge with the following interaction:

This Topic is available in the following Module:

If you are having problems with your training, please review the Pega Academy Support FAQs.

Did you find this content helpful?

100% found this content useful

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