Home / Flowable / Lesson 20

Hit policies

DMN. A free Flowable lesson in simple English (2:31 minutes).

Open in the academy (practice, progress and notes)

Chapters

Lesson text

0:00 What you will learn

Welcome to lesson twenty. What happens when more than one rule in a decision table matches? The hit policy decides. Hit policies are a favourite exam topic. Let's make them simple. This is an independent course. It is not made or approved by Flowable.

0:17 What is a hit policy?

A hit is a rule that matches. The hit policy controls how the table gives its result when one or more rules match. A table has one hit policy. It is shown by a letter in the top left corner. In Flowable Design, the default is F, for First.

0:34 One result

Four hit policies give one result. Unique: only one rule may match. If more than one matches, the result is not valid. First: the rules are checked in order, and the first match wins. Any: several rules may match, but they must all give the same output. Priority: the output with the highest priority is chosen.

0:58 A list

Three hit policies can give a list of results. Collect: all matching outputs, in any order. It can also add them up, count them, or find the smallest or largest. Rule order: all matching outputs, in the order of the rules. Output order: all matching outputs, sorted by priority.

1:21 Practice question 1

Question one. A table uses the hit policy First. Rule two and rule four both match. What is the result? A, rule two. B, rule four. C, both. Or D, an error.

The answer is A, rule two. With First, the first matching rule wins.

1:47 Practice question 2

Question two. A table uses the hit policy Unique, and two rules match. What happens? A, the first rule wins. B, both results are returned. C, the result is not valid. Or D, the last rule wins.

The answer is C. With Unique, only one rule may match.

2:13 Summary

Let's review. Unique, First, Any and Priority give one result. Collect, Rule order and Output order can give a list. And in Flowable Design, the default hit policy is First. In the next lesson, we will learn about forms. Thank you for learning with us.

Practice questions

A table uses the hit policy FIRST. Rules 2 and 4 both match. What is the result?

Answer: Rule 2. With First, the first matching rule wins.

A table uses the hit policy UNIQUE, and two rules match. What happens?

Answer: The result is not valid. With Unique, only one rule may match.

Sources