Creating decision tables
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.
- Create a rule to store the decision table:
- In the header of Dev Studio, click .
- In the Label field, enter a name that describes the purpose of the table.
- In the Apply to field, select the class in which you want to create the decision table.
- Click Create and open.
- Optional: To prepopulate the decision table with values, upload an .xls file that stores starting
- In the toolbar, click Import.
- In the Upload file dialog box, click Choose file.
- In the Open window, navigate to the file on your local machine, and then click Open.
- Click Upload file.
For example: You can upload a decision table that stakeholders without access to Pega Platform prepare offline.
- On the Table tab, in the Conditions column, click the header cell.
- 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.
- 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.
- 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.
- To use a simple comparison, in the Use operator list, select the operator.
- Click Save.
- Optional: To consider additional factors in a decision, add more condition properties:
- In the Conditions column, click a cell.
- In the toolbar, click the Insert column after icon.
- 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:
- 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.
- 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%.
- Optional: To insert an additional value in a cell, add an OR condition:
When an application evaluates the cell at run time, the application starts with the value in the top part of the cell.
- 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.
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%.
- Optional: To provide more outcomes, populate more rows with values:
- 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.
- 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.
- 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.
- Click Save.
- Optional: To import the decision table to an .xls file, for example to share with stakeholders offline, in the toolbar, click Export.
Previous topic Decision tables Next topic Specifying pages and classes of a decision table rule