Creating decision tables
Better adjust to the varied factors in your business processes by creating 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
information:
- 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.
- 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.
- In the Label field, enter the name of the property that you want to display in the header of the decision table.
- 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 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.
- 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. - 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.
- Optional: To ensure that your application can process the table, check the table for conflicts by clicking Show conflicts on the toolbar.
- Optional: To increase the possibility of reaching a return value, improve the completeness of the table by clicking Show completeness on the toolbar.
- 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