Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

This content has been archived and is no longer being updated.

Links may not function; however, this content may be relevant to outdated versions of the product.

Creating decision tables

Updated on April 5, 2022

To better adjust to the varied factors in your business processes, you can create a decision table. Decision tables test a series of property values to match conditions, so that your application performs a specific action under conditions that you define.

For example, you can define a decision table in your application to calculate a loan interest rate for a customer. The decision table evaluates the customer's credit score, type of account, and loan term, and then returns a result that matches values applicable to the customer.
  1. Create a rule to store the decision table:
    1. In the header of Dev Studio, click CreateDecisionDecision Table.
    2. In the Label field, enter a name that describes the purpose of the table.
    3. In the Apply to field, select the class in which you want to create the decision table.
    4. Click Create and open.
  2. Optional: To prepopulate the decision table with values, upload an .xls file that stores starting information:
    1. In the toolbar, click Import.
    2. In the Upload file dialog box, click Choose file.
    3. In the Open window, navigate to the file on your local machine, and then click Open.
    4. Click Upload file.
    For example: You can upload a decision table that stakeholders without access to Pega Platform prepare offline.
  3. On the Table tab, in the Conditions column, click the header cell.
  4. In the Decision table property chooser window, in the Property field, enter or select a property that you want to use as a condition.
    For example: Enter pyCreditScore.
  5. In the Label field, enter the name of the property that you want to display in the header of the decision table.
    For example: Enter Credit score.
  6. Select a comparison method:
    • To use a simple comparison, in the Use operator list, select the operator.

      For example, select >= to indicate that the value in the decision table must be equal to or greater than the value that the decision table evaluates at run time.

    • To specify a range for the condition property, select the Use range check box, and then define the start and end of a range.

      For example, you can configure a property value to be greater than and lower than certain amounts.

  7. Click Save.
  8. Optional: To consider additional factors in a decision, add more condition properties:
    1. In the Conditions column, click a cell.
    2. In the toolbar, click the Insert column after icon.
    3. Define the condition property by repeating steps 3 through 7.
    For example: Add more columns to evaluate the customer account type and the loan term, as shown in the following figure:
    Decision table with three columns
    Decision table with three columns for three conditions.
  9. In the if row, click the cell under a property, and then enter a value that the decision table evaluates at run time.
    If you configure two or more conditions, enter a value for at least one of the conditions. Your application ignores cells without values.
  10. In the Return column, enter a return result.
    For example: You can configure a condition that if a credit score is greater than 500, the return result is a loan interest rate of 3%.
  11. Optional: To insert an additional value in a cell, add an OR condition:
    • To insert the OR condition before the current value, on the toolbar, click the Insert OR before icon.
    • To insert the OR condition after the current value, on the toolbar, click the Insert OR after icon.
    When an application evaluates the cell at run time, the application starts with the value in the top part of the cell.
    For example: The following figure shows a decision table that returns the rate interest for a loan. If a customer's credit score is equal to or greater than 500, the customer account type is Standard or Gold, the loan term is 12 months, and the rate interest is 3%.
    Sample decision table
    A decision table with one row.
  12. Optional: To provide more outcomes, populate more rows with values:
    1. Click a cell in the if row.
    2. In the toolbar, click the Insert row after icon.
    3. Define the condition by repeating steps 3 through 10.
  13. In the otherwise row, in the Return column, select or enter a property that defines an application behavior when no condition in the table returns a true value.
    For example: Configure your application to reject a case.
  14. Optional: To ensure that your application can process the table, check the table for conflicts by clicking Show conflicts on the toolbar.
    For example: If two rows are identical, the second row never evaluates to true and is unreachable.
    Result: A warning icon appears in rows that are unreachable or empty.
  15. Optional: To increase the possibility of reaching a return value, improve the completeness of the table by clicking Show completeness on the toolbar.
    Result: The system automatically adds suggested rows to the decision table, that cover additional cases.
  16. Click Save.
  17. Optional: To import the decision table to an .xls file, for example to share with stakeholders offline, in the toolbar, click Export.
Result: At run time, your application processes rows in the table starting from the top row and returns a result for the row that is first to evaluate to true.
For example: The following figure shows a decision table that calculates the interest rate for a loan. The decision table evaluates rows that include values that define the customer's credit score, account type, and loan term. The application returns the result of the first row that evaluates to true. If all rows evaluate to false, the application returns the result that the interest rate is 10%.
Decision table to calculate interest rates
A sample decision table that evaluates conditions to calculate interest rates.
What to do next: Define additional options for the decision table. For example, decide whether an application continues evaluating the table after one row evaluates to true. For more information, see Configuring additional options for a decision table.

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

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.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us