Decision Table Builder
Last updated
Last updated
Decision table is one of the asset types that are available in the platform. It is designed to manage potentially large number of similar business rules in an easy to use tabular format.
Each column in such table represents either a condition check or an assignment of some property in the decision result. Each row represents an individual business rule, which tests for the condition, and if they are satisfied, produces a result and populates its property accordingly to the rule's settings.
To work with decision tables, you need to go to the Explorer panel and open the Assets section. Double-click on any decision table entry in it to open a tab with the Decision table builder panel.
In the table creation pop-up window, enter the decision table name and click the CREATE button.
The decision table’s name should be longer than 1 character and shorter than 100. It can contain the letters (Latin a-z A-Z), numbers 0-9, $, and an underscore. Beginning from a letter or underscore character. The name of the decision table must be unique in the folder where it was created.
After creation of the table, two new backing data structures will be generated automatically to represent the table's request and result parameters. They can later be found in the Structures section of the Explorer panel.
The fields in these data structures will be added automatically, as you edit condition and result parameters in the decision table's configuration panel on the right.
Alternatively after creation you can pick any other existing data structure to pass to the decision table as a request or return from it as a result.
The first configuration setting is how the decision table must behave after a row with all satisfying conditions is found. There are 2 types of execution break condition available:
First match - applies condition checks until a first matching row is found. Then it executes the actions set in this row and stops further checks, immediately exiting the decision table. With this strategy, only the first matching rule controls the result.
No break - checks for conditions set in every row, and applies actions from each matching row without stopping. With this strategy, every matching rule contributes to the final result.
To continue working with a specific type of break condition, select the type in the decision table section. By default, it is the first match.
To add a description to the decision table, click on the description section and enter the value.
All changes are saved automatically when closing the editor tab for this entity or switching to another one.
Configuring Decision Table Condition and Result Properties
You can define the table's condition and result properties by editing content of the Conditions and Results sections in the configuration panel. They will automatically be added as properties to the backing data structure specified in the Structure parameter above them.
Once such properties are defined, you will be able to select them in the table as column types.
The Property’s name should be longer than 1 character and shorter than 255. It can contain letters (Latin a-z A-Z), numbers 0-9, $, and an underscore. Beginning from a letter or underscore character.
Supported data types for condition and result:
Boolean — value “true” or “false”
String — text, for example, “Peter Peterson”
Integer — number, for example, “22”
Float — floating-point or decimal number, for example, “0.1234”
Date — specify the date value in the format yyyy-mm-dd, for example, ‘’1993-05-31’’.
After changing the composition of the parameters or changing their type, the same changes are applied to the auto-generated structure.
It is possible to change the use of an auto-generated structure in the decision table to another one in the Structure drop-down list at the top of the Parameters section in the decision table builder.
After cloning a decision table, it will refer to the same structure as the main decision table. You can change the structure used if necessary.
In the central part of the Decision table builder, you can enter the necessary data into the table according to the types of parameters.
You can add any operator to the data in the cell corresponding to the cell structure.
Possible formats depending on data types:
Integer Format : =, !=, >,<,<=,>=,< <,< <=,<= <,<= <=, n/a
Float Format : =, !=, >,<,<=,>=,< <,< <=,<= <,<= <=, n/a
Date Format : =, !=, >,<,<=,>=,< <,< <=,<= <,<= <=, n/a
String Format : =, !=, Contains, StartWith, EndWith, Regexp, n/a
Boolean Format : =, !=, n/a
n/a means that the value is not available and the condition will be ignored during processing, if the value is n/a, then such a condition will always work as True.
By default, the value of conditions and results in the decision table is null. Operators available for null are =, !=. For example, the user has indicated that the condition is != null, and the result is null. After that, in the Decision table node, specify the value of the condition. After deploying the project, the user can see the execution result as null because the condition worked as true.
Select the condition or result in the Decision table section. By clicking the right mouse button, a context menu opens through which a number of operations are available.
Let’s see what operations are possible:
Add — allows you to add a new parameter.
Clone — allows you to create a clone of the parameter. The cloned flow will have the same name as the Name of the parent parameter + Clone(n).
Delete — allows you to delete the parameter.
To create a decision table, first open the Assets section by clicking on an icon located on the left-hand side of the Explorer panel. Next, create a decision table by clicking the Add button in the and selecting the New Decision Table command from the list.
If you want to create it in a specific folder, first you need to create or open the desired folder, and then click the Add icon.
To add a new condition or result parameter, click the Add button in the corresponding section to add a new element. Then click the field on the left to edit the parameter name, and pick a desired data type from the dropdown next to it.
To add an additional row above, click on the Add Row Above icon in the panel above the table.
To add an additional row below, click on the Add Row Below icon in the panel above the table.
To Remove a row, select a row and click on the Remove Row icon in the panel above the table.
To Cut a row, select a row and click on the Cut Row icon in the panel above the table.
To Paste a row, select a row and click on the Paste Row icon in the panel above the table. Is not available unless you have previously used the Cut options.
To Add a column before, select the column and click on the Add column before icon in the panel above the table. Then create a new parameter and select its type.
To Add a column after, select the column and click on the Add column after icon in the panel above the table. Then create a new parameter and select its type.
To Remove a column, select the column and click on the Remove Column icon in the panel above the table.