Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The decision table shows the rules in a shorthand notation by arranging the entries in table cells. This shorthand notation shows all the all inputs in the same order in every rule and therefore has a number of readability and verification advantages.

For example;

Customer CategoryOrder sizeDiscount
"Business"<100.10

read as;

Code Block
If CustomerCategory = "Business" and OrderSize < 10 then Discount = 0.10

...

In general table expressed as;

Input expression 1Input expression 2Output expression
input entry ainput entry boutput entry c

If input entry is "-" (meaning irrelevant), every value of input expression satisfies the input entry.

...

Input expressions are usually simple FEEL expressions. Order of input expressions is not related to any execution order.

Every input expression has following properties;

Expression

Specifies the input value expression. (Example: Name, BirthDate or Person.Name)

Label

Optionally specifies the display label of input, if not specified expression is used to display input.

Input Values

Optionally specifies the valid range of input. Given inputs are validated by this expression before decision table is executed. For example a "Status" input may use the "VALID", "INVALID" as input values. All of the other values are rejected by decision table.

Also range comparison expressions can be used like "<10" to accept values smaller than 10.

Type

Optionally specifies the type of input expression. When type is specified, some of decision table editor features are enabled by input type.

Output expressions

A rule output entry is a also FEEL expression. Output expressions also have default value if no output entry is specified.

Name

Specifies the name of output value.

Label

Optionally specifies the display label of output. If not specified, expression is used to display output.

Default

Optionally specifies the default value of output if decision table rule does not specify a value.

Type

Optionally specifies the type of input expression. When type is specified, some of decision table editor features are enabled by input type.

Hit Policy

The hit policy specifies the what the result of decision table is in cases of overlapping rules, ie. when more than one rule matches the input data. For clarity, the hit policy is summarized with using single first character of policy name.

...

  • Unique: no overlap possible and rules are disjoint. Only a single rule can be matched. This is the default value of hit policy. If given input matches the multiple rules, hit policy is incorrect and MultipleHitViolation error is thrown.
  • Any: there may be overlap, but all of the matching rules must have equal output entry values for each output so any match can be used. If output entries are non-equal, the hit policy is incorrect and result is undefined.
  • Priority: multiple rules can match, with different output entries. This policy returns the matching rule with the highest output priority. Priorities are independent from rule sequence.
  • First: Multiple (overlapping) rules can match, with different output entries. The first hit by rule order is returned and evaluation halthalts. First hit tables are not considered as a good practice because they do not offer a clear overview of the decision logic. 

Multi hit policies

  • Output Order: returns all of the all hits in decreasing output priority order.
  • Rule Order: returns all of the all hits in rule order. Therefore may depend on the sequence of rules.
  • Collect: returns all of the all hits in arbitrary order. An operator can be added to apply simple function to outputs. If no operator specified, result is a list of the all output entries.

Collect operators are;

      1. Sum sum (+): sum of all the distinct outputs.
      2. Min min (<): smallest value of the all the outputs.
      3. Max max (>): largest value of the al the all outputs.
      4. Count count (#): number of the distinct outputs.

For the Priority and Output Order order hit policies, priority is decided in compound output tables over all the outputs for which output values have been provided. The priority for each output is specified in the ordered list of output values in decreasing order of priority, and the overall priority is established by considering the from matching input columns order. Columns at ordered outputs from left to right in horizontal tables (i.e., columns to the left take precedence over columns to the right), or from top to bottom in vertical tables. Outputs for which no output values are provided are not taken into account in the ordering, although their output entries are included in the ordered compound output.

For example; If if called with Age=17, Risk Category="HIGH" and Dept Review=true, the following table outputs of all four rules, in the order 2,4,3,1.

OAge

Risk Category

(Low, Medium, High)

Dept Review

Routing

(DECLINE,REFER,ACCEPT)

Review Level

(LEVEL2,LEVEL1,NONE)

1---"ACCEPT""NONE"
2<18--"DECLINE""NONE"
3-"HIGH"-"REFER"

"LEVEL 1"

4--true"REFER""LEVEL 2"