◷ Reading Time: 7 minutes
Decision Table is a way to model business rules in a tabular form. Each business rules consists of
- Conditions (inputs)
- Actions (outputs)
New project and decision table
The first step is to create a new project and add a decision/validation document as a table using the
Document --> New menu.
Then open that table document.
When the editor is a Table editor then all the techniques we described for building trees are applicable. However, creating a diagram using the keyboard may not be as easy as the ‘tree’ approach. Also, please keep in mind that positioning an item is not valid in a table.
Add two parameters below:
- Input parameter: parcel weight
- Output parameter: delivery cost
To learn more about parameters follow Define and Manage Parameters.
If you have a look at the complete table below:
You see that the table is divided into two sections:
- Signature – the top part
- Values (expressions) – bottom part
In a table editor, three types of columns can be created:
To add a column, you can simply drag and drop from the toolbox or use the keyboard.
Adding Condition by dragging from the toolbox
Then drop into the decision table.
For moving columns, you need to select and drag them to the desired position.
Select the column.
Hover over the column and the cursor will be changed.
Press the left mouse button and drag the column to the right position. A vertical indicator will show you where is it going to be dropped.
Release the mouse button.
To delete a column you can use the toolbar button named ‘Delete Column’.
There are several ways to add a new row to the table:
- Drag and Drop from the toolbox
- Using keyboard
- Using toolbar:
- New Row After
- New Row Before
- Using the buttons
Drag and drop Row from the toolbox
To add values into the table cell, you can simply:
- Double click on a cell and start typing
- Select a cell and use the value bar on top of the table
Values In Cell
Double click on a cell. A text box will appear and start typing in the in-place text box. Once finished, press ‘Enter’.
Alternatively, you can just select a cell and start typing.
Select a cell and then go to the value bar. Start typing and then press ‘Enter’.
You can move a row Up and down.
Select, drag and drop to the location you want to move the row
By default, the rules will run from top to bottom. However, you can set the priority manually as well.