Please note : This help page is not for the latest version of Enterprise Architect. The latest help can be found here.
Prev | Next |
DecisionTable
A Decision table is a tabular representation of a set of related input and output expressions, organized into rules indicating which output entry applies to a specific set of input entries.
Access
Ribbon |
Simulate > Decision Analysis > DMN > DMN Expression, then select or create a Decision or BusinessKnowledgeModel |
Other |
Double-click on a DMN Decision or BusinessKnowledgeModel |
Toolbar Options
Option |
Description |
See also |
---|---|---|
Click on this button to save the configuration to the current Decision or BusinessKnowledgeModel. |
||
Click on this button to switch between Rule-as-row and Rule-as-column for the Decision table. |
||
Click on 'Sort By Input' to sort the rules by input columns; click on 'Sort By Output' to sort the rules by output columns. The columns can be dragged and dropped to organize the sorting order. |
||
Click on this button to merge adjacent input entry cells from different rules with the same content. |
||
Click on this button to split entry cells that have been merged. |
||
Click on this button to edit parameters for the Business Knowledge Model. |
||
Click on this button to append an input column for the Decision table. |
||
Click on this button to append an output column for the Decision table. |
||
Click on this button to append a rule for the Decision table. |
||
Click on this button to show or hide the allowed values fields for the 'Input' and 'Output' columns. The allowed value defined for an input or output will be used for validation and auto completion editing. |
DMN Expression Auto Completion | |
Click on this button to validate the Decision table. Enterprise Architect will perform a series of validations to help the you locate errors in the Decision table. |
DMN Expression Validation | |
This button is enabled when a Decision table is defined for a BusinessKnowledgeModel. Select the 'Input Parameter Values for Simulation' tab, complete the fields and click on this button. The test result will be presented on the Decision table, with the runtime values of inputs and outputs displayed and valid rule(s) highlighted. You can use this functionality to unit test a BusinessKnowledgeModel without knowing the context and later on invoked by a Decision or other BusinessKnowledgeModel. Menu options are available for this tool bar button. For more information, see the Business Knowledge Model and Test Harness Help topic. |
BusinessKnowledgeModel & Test Harness |
Decision Table Hit Policy
The Hit Policy specifies the result of the Decision table in cases of overlapping rules. The single character in a particular Decision table cell indicates the table type and unambiguously reflects the decision logic.
Single Hit Policies:
- Unique: no overlap is possible and all rules are disjoint; only a single rule can be matched (this is the default)
- Any: there might be overlap, but all the matching rules show equal output entries for each output, so any match can be used
- Priority: multiple rules can match, with different output entries; this policy returns the matching rule with the highest output priority
- First: multiple (overlapping) rules can match, with different output entries; the first hit by rule order is returned
Multiple Hit Policies:
- Output order: returns all hits in decreasing output priority order
- Rule order: returns all hits in rule order
- Collect: returns all hits in arbitrary order; an operator (‘+’, ‘<’, ‘>’, ‘#’) can be added to apply a simple function to the outputs
Collect operators are:
- + (sum): the result of the Decision table is the sum of all the distinct 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 distinct outputs
Example of Unique hit policy
The 'Unique' hit policy is the most popular type of Decision table and all rules are disjoint.
Example of Priority hit policy
In a table with the 'Priority' hit policy, multiple rules can match, with different output entries. This policy returns the matching rule with the highest output priority.
Note: The output order is defined as INELIGIBLE, ELIGIBLE; which means INELIGIBLE has higher priority than ELIGIBLE.
One possible simulation result might resemble this:
The matching rules are highlighted, but output with INELIGIBLE is the pick based on output order.
Example of Collection-Sum hit policy
For a Decision table with the 'Collect-Sum' (C+) hit policy, the result of the Decision table is the sum of all the distinct outputs.
In this example, the output Partial Score is calculated as 43 + 45 + 45 = 133
Set type for Input/Output Clause
You have to set the type for Input Clause or Output Clause for these reasons:
- Display: The string will be shown in Italic font (otherwise, each string literal must be inside quotes)
- Validation: The range, gap and overlap validations are supported only on numbers
- Code Generation for typed languages such as C++, C# and Java
You might ask: since the BKM parameter already has types defined, why do we need to define types for the Input Clauses?
The answer is: the Input Clause could be an expression. For example, a parameter 'Credit Score' is a number type, but the Input Clause could be 'Credit Score > 500?', which is a boolean type.
Right-click on the Input Clause or Output Clause and select the appropriate type for it.