Define a decision logic
Decision logic specifies the details of a decision. This means you define rules in form of a decision table or literal expression to describe which combinations of data lead to certain results. In addition to the rules, you must define what happens when inputs meet multiple or no rules. This is done by specifying a hit policy.
In this section, the options for defining a decision logic are explained.
To learn how to specify the hit policy and set the completeness requirement, read more in section Define a hit policy and the completeness requirement.
Define a decision table
Decision logic can be presented as a table. A business rule that exists in your company is represented by a decision rule in the decision table. All cells in a table row form a decision rule.
Table inputs are specified in columns. Each input has a specific data type. The output column shows the result of the applied business rule. Like the inputs, each output also has a data type.
The decision rule then compares input data with the values in the cells.

Add rules to a decision table
To create decision rules, you must configure input data in the Inputs column and map them to output data in the Output column.
Any input data modeled on the canvas is already available when you open decision table. You can add missing input data by defining input columns in the table.
All input data defined via the table is added as input data elements to the canvas when the table is saved. You also need to define decision rules and map the outputs.
To define input data and add decision rules, follow these steps:
-
Open the decision table. To do so, select the decision to which you want to add rules and click
.The decision logic configuration dialog opens.
You can also open this dialog via the Decision logic attribute in the attribute panel.
-
Configure the input data. To do so, follow these steps:
-
Double-click New Input in the column header, and enter a name for the input data.
If a dictionary entry exists, you can select it.
-
Below the input data name, double-click Text, select the type of the input data, and define its options.
If you have chosen a dictionary entry as data input, it depends on the entry's configuration whether you need to specify the data type.
The following data types are available:
-
Enumeration
-
Text
-
Number
-
Boolean
-
Hierarchy
-
Date
-
-
-
In the same way, configure the output data in the Outputs column.
-
In the same way, you can configure the Annotations column to add information to the decision rules.
-
Define the first decision rule:
-
Double-click the left area of the first table cell. A list opens.
-
Select an operator to define the relation between the input and the output.
Read more on operators in section Decision table operators.
-
Double-click the right area of the same cell. Again, a list opens.
-
Select or enter an input value.
-
In the Outputs column, double-click the cell and enter an output value.
-
-
With the buttons at the top of the table, you can add more rules, input data, output data, and annotations.
-
To define more rules, you have the following options:
-
You can continue defining rules cell by cell as described above.
-
With Add rule > Duplicate rule, you can copy and paste existing rules.
-
With Import/Export > Text Import, you can add text-based decision rules instead of defining the rules cell by cell. Read more in section Import decision rules.
-
-
Select a hit policy for the decision table and specify the completeness requirement.
In case of a multi hit policy, you can also select an aggregation. Read more in section Define a hit policy and the completeness requirement.
-
With Verify, you can check the logic for completeness and consistency. Below the table, all combinations of input values are displayed that aren't covered by a decision rule.
-
Confirm with Apply.
Your decision logic is set up.
Decision table operators
|
Operator |
Symbol |
Description |
|---|---|---|
|
equal For dates: on |
|
Returns true if the input value equals the specified value. |
|
not equal For dates: not on |
|
Returns true if the input value doesn't equal the specified value. |
|
less For dates: before |
|
Returns true if the input value is less than the specified value. |
|
less or equal For dates: until |
|
Returns true if the input value is less than or equals the specified value. |
|
greater For dates: after |
|
Returns true if the input value is greater than the specified value. |
|
greater or equal For dates: from |
|
Returns true if the input value is greater or equal than the specified value. |
|
contains For numbers: included |
|
Returns true if the input value contains the specified value. |
|
not contains For numbers: not included |
|
Returns true if the input value doesn't contain the specified value. |
|
begins with |
|
Returns true if the input value begins with the specified value. |
|
ends with |
|
Returns true if the input value ends with the specified value. |
|
element of |
|
Returns true if the input value is also in the list of the decision table. |
|
not element of |
|
Returns true if the input value isn't in the list of the decision table. |
|
elements of and contains only |
|
Returns true if the input list contains only items the list in the decision table contains as well. |
|
contains any of |
|
Returns true if the input list contains at least one item the list in the decision table contains. |
|
contains none of |
|
Returns true if the input list doesn't contain any item the list in the decision table contains. |
|
valid |
|
Returns true if the input value is defined (not empty) and valid. For example, if you only consider numeric values equal or greater than zero, all numeric values less than zero and all non-numeric values aren't valid. |
|
not valid |
|
Returns true if the input value is defined (not empty), but invalid. For example, if you only consider numeric values equal or greater than zero, all numeric values less than zero and all non-numeric values are invalid. |
|
defined |
|
Returns true if the input value is defined (not empty). |
|
not defined |
|
Returns true if the input value isn't defined (empty). |
Import decision rules to the decision table
Instead of defining the decision rules cell by cell, you can import text-based decision rules into the table. The columns still need to be configured as described above. The individual rules can be in the form of a list, separated by the delimiters tab, semicolon, or comma.
The import function doesn't overwrite or delete existing rules. Imported rules are always added.
Text-based rules must have the following structure:
-
Relational operators like = and <= must be part of the field they relate to.
-
For each rule, you need to start a new line.
-
The import only supports the following literal expressions:
-
not(value)
-
not(value1, ..., valueN)
-
!=value
-
To add text-based decision rules, follow these steps:
-
Open the decision table and click Import/Export > Text Import in the top-right corner.
The text import dialog opens.
-
Select a delimiter.
-
Either enter the decision rules or copy them, for example from a text file or spreadsheet, to the editor field.
-
Click Import.
The rules are added to the table. You can add more by opening the text import dialog again.
Define a literal expression
As an alternative to the logic in the decision table, you can define logic via a literal expression.
Literal expressions represent predefined logical algorithms or rules that can be used to automatically create output results for decisions, often but not necessarily in a formal expression language. You can use literal expressions to add logic that can't be expressed in the decision table, for example, function calls, interim values, or list manipulation.
Literal expressions are written in FEEL, the 'friendly enough expression language' specified as part of the DMN standard. You can download the specification along with examples for literal expression use cases at https://www.omg.org/spec/DMN/1.1/
.
To define a literal expression, follow these steps:
-
Select a decision and click
.The decision logic editor opens.
-
Select the Expression tab on the left side and add the literal expression.
-
Confirm with Apply.
Read more about literal expressions in section Using advanced literal expressions (functions in DMN decision elements).
Define an informal expression
If decision logic can't be expressed formally, you can describe it with natural language. The description doesn't have to be formal or executable.
To define an informal expression, follow these steps:
-
Select a decision and click
.The decision logic editor opens.
-
Select the Informal expression tab on the left side and add the description of the decision.
-
Select the data type of the decision logic via the Value domain list in the upper right corner.
-
Confirm with Apply.












and 





