Skip to main content


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

Authoring decision tables in App Studio

Updated on March 29, 2022

Respond to dynamically changing business situations by calculating values in your business processes automatically. With decision tables, you can define conditions that include multiple elements and result in different outcomes. Consequently, you deliver an application that helps users successfully resolve business processes in various and dynamic scenarios.

For example, you can create a decision table that calculates the type of account based on the monthly income of a customer. You can add additional variables to the calculation, such as the loan or mortgage history of the customer. To ensure that a business process can reach its goal even in an unexpected scenario, you define a value that the decision table returns if all of the calculations evaluate to false.
Before you begin: Create a calculated field for which you want to return values, and then configure the field to use a decision table. For more information, see Calculating values with decision tables.

When you create a decision table, you select a field that you want to compare against specific values, and then you define a method of comparison. You can compare one field against multiple values to find the result that best fits your business needs. Each column includes a field to evaluate, and each row includes values that an application uses to compare against the field. At run time, the application evaluates a decision table from top to bottom, starting with the row at the top of the table.

  1. Navigate to the place in your application where you want to use a decision table.
  2. In the Evaluate dialog box for a calculated field, click Add column.
  3. In the Column list, select the field that you want to evaluate at run time.
    For example: To include a monthly income of the customer in the calculation of the best account type to offer to the customer, select Monthly income.
  4. In the Comparator list, select a comparator to use for evaluation.
    A list of comparators depends on the type of the calculated field that you want to edit.
    For example: For a calculated field of an integer type, select Between > and < to indicate that a field in the Column list needs to be in a range of values at run time. In a sample scenario, a monthly income of a customer needs to be between 2,000 and 4,000 dollars.
  5. Optional: To add more fields to compare at run time, repeat steps 2 through 4.
    For example: Apart from the monthly income of a customer, you can add columns to check whether the customer has loans or mortgages.
  6. Click Submit.
  7. Click a cell in the column that you want to edit, and then enter a value to compare against the field at run time.
    For example: In the Monthly income column, enter 2000 and 4000 to indicate that a monthly income of a customer needs to be between 2,000 and 4,000 dollars.
    If you have multiple columns, provide values for every column.
  8. In the Return column, click a cell, and then enter a value that the decision table returns if the condition in the row that you want to edit evaluates to true.
    For example: To return a Standard account type for customers whose monthly income is between 2,000 and 4,000 dollars, in the Return column, in the row with the 2000 and 4000 values, enter Standard.
  9. Optional: To provide more values against the field to evaluate at run time, click the Add icon, and then repeat steps 7 through 8.
    For example: You can provide more values of monthly income and then associate them with different types of accounts.
  10. In the Otherwise row, in the Return column, click the cell, and then enter a value that the decision table returns if none of the rows evaluates to true.
    For example: To assign an account of a Custom type to a customer whose income is different than options in the decision table, enter Custom.
  11. Optional: To reuse the configured logic in the future, save the decision table:
    1. Above the header of the decision table, click Add to decision table library.
    2. Optional: To provide your custom name for the decision table, in the Add to library for reuse dialog box, in the Name field, enter the label for the decision table.
      By default, the system uses Evaluatecalculated field name as the name for a decision table.
    3. Click Submit.
  12. Close the dialog box with decision table configurations by clicking Submit.
For example: The following figure shows a decision table that calculates an account type based on a customer monthly income. The decision table also checks whether the customer has any loans or mortgages. If the monthly income fits any of the provided ranges, and if the customer does not have any loans or mortgages, the decision table returns an appropriate account type. If all the rows evaluate to false, the decision table returns the Custom account type.
Decision table that returns an account type
A decision table authored in App Studio that returns an account type by evaluating provided values

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