A decision table organizes if/then rules into a spreadsheet-like format, in which rows represent conditions and actions, and columns match condition values to action alternatives.
- In the Business Rules Editor, click Rules.
- Click Decision Table in the canvas or select Decision Table from the Add drop-down list in the left pane.An empty decision table appears. The default name is Decision Table 1.
- Optional: To change the decision table name, click Properties next to the name, edit the name, and click OK.
- For each condition you want to add:
- In the decision table toolbar, select Add Condition from the Add drop-down list.The Add/Modify Condition dialog box opens.
- Type a condition value in the Condition field or expand the folders in the Name column to browse for functions and decision data objects.To find the input data objects you already specified (see Creating a Decision), expand decision-name.in.
- Click Select or Edit Value Set.If the data object for this condition is boolean (true or false), you can skip this step and the next.The value set page of the Add/Modify Condition dialog box opens.
- Select an existing value set from the list on the left, or select Local Value Set or Local Range Value Set to create a new value set that applies only to this condition.
- Click Done.The Add/Modify Condition dialog box closes.
- If this is the first condition, select Add Rule from the Add drop-down list repeatedly, until you see an Rn column for each value or value combination you need.For subsequent conditions, you might need to add additional columns to account for more condition combinations.
- Click each table cell and select one or more values from the drop-down list that appears.If the value in a cell doesn’t matter, select All from the list. A dash appears in the cell.
- In the decision table toolbar, select Add Condition from the Add drop-down list.
- To add conditions that apply to all rules or to create variables to make rules more readable, expand Tests and Variables.For example, if all rules in your decision table apply only to legal adults, you can add a condition such as
Duration.years between(Person.birthdate,CurrentDate.date) same or more than 18.
- In the decision table toolbar, select one of the Add Action commands from the Add drop-down list:
For descriptions of other actions, see Using Advanced Actions.An output data object can only be created once. Therefore, if multiple rules and decision tables affect the same output data object, use create in an initial action, then use modify in the rules and decision tables. Want to learn more about initial actions? See Editing Decision Properties.The Action Editor dialog box opens.
- create — Creates a new data object and assigns a value to it. Use this action for an output data object, unless it's also an input data object.
- call function — Calls a function.
- modify — Modifies the value of an existing data object.
- Select a function or decision from the data objects list.You can find the output data objects you specified in Creating a Decision by selecting decision-name.out.
- To use different action values for different conditions, select the Parameterized check box for each function or decision argument.
- Click OK.
- For each action cell:
You can't create a local value set for an action. You must use an existing value set.
- Click the cell and click Select Value.The Condition Browser appears.
- Expand the desired value set and select a value.
- Click OK.
- Click the cell and click Select Value.
- Add more actions if necessary.All actions are applied, in order.
- If conflicts occur, see Adding Conflict Resolutions to Decision Tables.
- Use these commands on the Tools menu to clean up or rearrange the decision table:
Identify Possible Missing Rules: Checks for condition combinations you might have missed.
Order Rules by Value: Orders condition combinations by value from left to right and merges cells with the same value where possible.
Generate Unique Rules: Displays all condition value combinations by eliminating merged and all-value (dash) cells.
Switch Rows to Columns: Pivots the table so that rules are rows and conditions and actions are columns.
- When you’re done creating the decision table, click Save and Publish.Here’s an example of a decision table with two conditions:
Description of the illustration decision-table-example.png