Applying a hit policy to a decision table
When a decision table is called, Sitecore Personalize evaluates each rule in that table. A rule is considered hit when its condition is satisfied by the provided input. However, whether a satisfied rule's output contributes to the decision table's result depends on the hit policy.
Every decision table must have a hit policy. A hit policy determines how many decision table rules can be simultaneously satisfied, and which satisfied rules are included in the decision table result.
When you create a decision table, it defaults to a Unique hit policy. To change the policy, click the arrow and select an option from the Hit Policy drop-down list.
There are two categories of hit policy: single-hit and multi-hit. With a single-hit policy, the decision table evaluates the rules and finds one rule that satisfies the conditions, returning only that rule's output. With a multi-hit policy, the decision table can find several rules that satisfy the conditions simultaneously during evaluation. The decision table then returns the result based on the outputs of all satisfied rules.
The following tables detail the behavior of each type of hit policy. See hit policy examples to understand how each type evaluates the rules in the decision table to generate the result.
Single hit policy
Policy name |
Description |
---|---|
Unique |
Returns the output of a single satisfied rule. If more than one rule in the decision table can be satisfied, all of the rules will fail when the table runs, or when you test it on the canvas. |
First |
Evaluates one or more rules in sequence, and when then current rule is satisfied, returns the output of that rule without evaluating the remainder. You can change the order of rules to ensure they are given proper priority. |
Any |
Returns the output of the satisfied rule. Multiple rules can be satisfied simultaneously, provided that they have the same output. If there are overlapping rules with different outputs in the decision table, all of the rules will fail when the table runs, or when you test it on the canvas. |
Multi-hit policy
Policy name |
Description |
---|---|
Collect List |
Returns the outputs of all satisfied rules in an arbitrarily-ordered list. |
Collect Sum |
Returns the sum of the outputs of all satisfied rules. Each rule's output should either be a number or a duration. |
Collect Min |
Returns the smallest output value among all satisfied rules. Each rule's output should be comparable, such as numeric values, durations, strings, dates, or times. |
Collect Max |
Returns the largest output value among all satisfied rules. Similar to Collect Min, each rule's output should be comparable. |
Collect Count |
Returns the total count of outputs of all satisfied rules. Each rule's output can be of any type, but the decision table always returns a number. |
Rule Order |
Returns the outputs of all satisfied rules in an ordered list, in the same order they appear in the decision table. |