Decision Table Hit Policies

The hit policy controls how many rules may match a given input and, if more than one matches, which output wins. Every decision table must declare a hit policy.

For background on how decision tables are structured in RASON, see Business Rules & Decision Tables.

U — Unique (the policy used in the Decision Tables example)

"hitPolicy": "U" is the strictest single-hit policy. Rules must not overlap — for any possible input, at most one rule can match. If two rules match the same input, the table is in error. Use Unique when your rules form a true partition of the input space and you want overlaps caught as errors.

All Hit Policies

Code Name Family Behavior
U Unique Single-hit Rules must not overlap; at most one rule may match. Overlap is a table error.
F First Single-hit Rules may overlap; the first matching rule wins.
A Any Single-hit Rules may overlap, but all matches must produce the same output. Disagreement is a table error.
P Priority Single-hit Rules may overlap; the match with the highest-priority output wins.
C Collect Multiple-hit All matching rules contribute their outputs, returned as a list.
C+ Collect / sum Multiple-hit Sums the outputs of all matching rules.
C< Collect / min Multiple-hit Returns the smallest output among all matching rules.
C> Collect / max Multiple-hit Returns the largest output among all matching rules.
C# Collect / count Multiple-hit Returns the number of rules that matched.
R Rule order Multiple-hit Returns outputs of all matching rules, in the order listed.
O Output order Multiple-hit Returns outputs of all matching rules, ordered by decreasing output priority.