Hit policy examples
The following examples show how applying a hit policy to a decision table determines its result.
Unique
In this example, the following decision table is set up to determine the specific type of loan to offer based on the current season.
|
Rule |
Input: Current season |
Output: Loan offer |
|---|---|---|
|
1 |
"AUTUMN" |
"CAR LOAN" |
|
2 |
"WINTER" |
"HOLIDAY LOAN" |
|
3 |
"SPRING" |
"HOME REPAIR LOAN" |
|
4 |
"SUMMER" |
"EDUCATION LOAN" |
Any input of season can satisfy only one rule in this decision table, because there can only be one season at a time in a location. Based on a Unique hit policy, the decision table returns a single type of loan corresponding with the season, such as an education loan during summer.
First
In this example, the decision table determines the car rental type based on different age thresholds, with a luxury car offer being at the highest priority, followed by mid-range cars, and lastly, economy cars.
|
Rule |
Input: Age |
Output: Car rental type |
|---|---|---|
|
1 |
> 28 |
"LUXURY CAR" |
|
2 |
> 22 |
"MID-RANGE CAR" |
|
3 |
> 18 |
"ECONOMY CAR" |
For an input age of 35 years old, all the rules in the decision table are satisfied, because 35 exceeds the age specified in each rule. However with a First hit policy, the decision table only returns the luxury car offer, because it stops evaluating the remaining rules as soon as it encounters the first satisfied rule.
Any
The following example shows a decision table that calculates the discount awarded to guests based on their age and how long they have been a member of the loyalty program. A hyphen indicates that the input value is ignored by a certain rule.
|
Rule |
Input: Age |
Input: Membership years |
Output: Loyalty discount percent |
|---|---|---|---|
|
1 |
- |
>=5 |
15 |
|
2 |
>=35 |
- |
15 |
|
3 |
<35 |
<5 |
10 |
Here, an input age of 35 years old and a loyalty program membership of 5 years satisfies the first two rules. Because these rules both generate the same 15% discount output and each depends on a different input, both of them can be satisfied simultaneously using an Any hit policy.
Collect List
The following example shows a decision table that returns relevant offers in an advertisement carousel according to the customer's gender and whether they are a member of the loyalty program. A hyphen indicates that the input value is ignored by a certain rule.
|
Rule |
Input: Gender |
Input: Loyalty member |
Output: Offer |
|---|---|---|---|
|
1 |
"FEMALE" |
- |
"SPA" |
|
2 |
"MALE" |
- |
"GOLF" |
|
3 |
"UNKNOWN" |
- |
"WINERY TOUR" |
|
4 |
- |
true |
"CABIN UPGRADE" |
|
5 |
- |
false |
"COMPLIMENTARY MEMBERSHIP" |
In this example, for an input of a female loyalty program member, both the first and fourth rules are satisfied. That is, if the input for gender is female, the output is a spa offer, regardless of the loyalty membership. Similarly, if the input for loyalty membership is true, the output is a cabin upgrade, regardless of the gender. When you use a Collect List hit policy, the decision table returns a list that includes both the spa offer and the cabin upgrade.
Collect Sum
In this example, the decision table determines which loyalty tiers a guest has reached based on the length of their membership, and allocates loyalty points to them based on each tier.
|
Rule |
Input: Loyalty member years |
Output: Loyalty points bonus |
|---|---|---|
|
1 |
>=1 |
1000 |
|
2 |
>=2 |
2000 |
|
3 |
>=3 |
3000 |
|
4 |
>=5 |
5000 |
Here, the first two rules are satisfied for an input of 2 loyalty member years. With a Collect Sum hit policy, the decision table returns the sum of loyalty points bonus values of the two satisfied rules. That is, a sum of 3,000 loyalty points bonus.
Collect Min
The following example shows a decision table that determines the lowest car insurance discount for which a car insurance applicant qualifies.
|
Rule |
Input: Discount types |
Output: Discount percent |
|---|---|---|
|
1 |
"NO CLAIMS" |
15 |
|
2 |
"GOOD STUDENT" |
5 |
|
3 |
"NO PENALTY POINTS" |
10 |
In this example, the last two rules are satisfied for an input based on a young driver who performs well academically and does not have any traffic penalties. However, with a Collect Min hit policy, the decision table only returns 5%, which is the lowest discount percent between the two satisfied two rules.
Collect Max
The following example shows a decision table that determines the highest car insurance discount for which a car insurance applicant qualifies.
|
Rule |
Input: Discount types |
Output: Discount percent |
|---|---|---|
|
1 |
"NO CLAIMS" |
15 |
|
2 |
"GOOD STUDENT" |
5 |
|
3 |
"NO PENALTY POINTS" |
10 |
For an input based on a young driver who performs well academically and does not have any traffic penalties, the last two rules are both satisfied. When you use a Collect Max hit policy, the decision table only returns 10%, which is the highest discount percent between the two satisfied rules.
Collect Count
The following decision table shows how to return the total number of discounts for which a car insurance applicant qualifies, which can then be input into another decision table.
|
Rule |
Input: Discount types |
Output: Discount percent |
|---|---|---|
|
1 |
"NO CLAIMS" |
15 |
|
2 |
"GOOD STUDENT" |
5 |
|
3 |
"NO PENALTY POINTS" |
10 |
In this example, for an input based on a young driver who performs well academically and does not have any traffic penalties, the last two rules are satisfied. With a Collect Count hit policy, the decision table returns a number, in this case 2, because this is the total count of the satisfied rules.
Rule Order
In the following example, the decision table returns the corresponding product advertisements based on different age thresholds.
|
Rule |
Input: Age |
Output: Advertised product |
|---|---|---|
|
1 |
>25 |
"CARS" |
|
2 |
>18 |
"GADGETS" |
|
3 |
>12 |
"VIDEO GAMES" |
In this example, an input of age of 26 years old satisfies all three rules simultaneously. A Rule Order hit policy enables this decision table to return the outputs of all these satisfied rules in the order they appear in the table, so car advertisements appear first, followed by gadgets, and then video games.