DMN decision table
Decision Model and Notation Decision Table
A DMN decision table consists of:
- set of inputs, each input optionally associated with a type and list of input values,
- set of outputs, each output optionally associated with a type and list of output values,
- list of rules in rows or columns of the table, where each rule is composed of the specific input entries and output entries of the table row (or column),
- hit policy,
- Aggregation - only applicable in decision table with multiple hits policy. (by setting 'processAll' or Process All Rows to true) Check API
Multiple Hits Policy for Single Output Decision Table
There are three types of multiple hits policies for a single output Decision Table. (Multiple Hits Policies for Single Output)
- No order: Returns all hits in a unique list in arbitrary order.
- Output order: Returns all hits in decreasing priority order. Output priorities are specified in an ordered list of values.
- Rule order: Returns all hits in rule order, i.e. dependency on the order of the rules.
When a multiple hits table returns output entries from multiple rules, the output entries have to be aggregated into a singe result. An Aggregation specifies the function to handle the multiple output entries.
- Collect: The result of the decision table is the list of all the outputs, ordered or unordered per the hit policy.
- Sum: The result of the decision table is the sum of all the outputs.
- Min: The result of the decision table is the smallest value of all the outputs.
- Max: The result of the decision table is the largest value of all the outputs.
- Count: The result of the decision table is the number of outputs.
- Average: The result of the decision table is the average value of all the outputs, defined as the sum divided by the count.
In a Multiple Hits Policies for Single Output the expression for the action can be left empty. Decision table automatically creates a collection for the output parameter and you can collect the result later. This collection is a generic 'List' and the results will be added to this list and then aggregate function will be ran on top of it when the decision table execution is finished. For more example please have a look at: http://www.flexrule.com/archives/decision-table-aggregation/
- Introduction to decision table
- Preparing decision table
- Modeling decision table
- Decision Model and Notation - decision table
- Check overlaps
- Decision Table final logic
- Multilingual decision table
- Decision Table 101