Using decision tables

Objective

After completing this lesson, you will be able to apply Decision Tables

Decision Tables

Apply your rules to decision tables.

Business rules

Decision logic is presented in a decision table, which is built from different components. In the decision table, each row is a business rule. Examples of business rules are the following:

  • 'People who have had more than two accidents are denied insurance.'
  • 'People who are younger than 18 are denied insurance.'
  • 'People who have more than four traffic points are denied insurance.'

Decision table components

Accidents in the past 3 years: Inputs are contained in input columns. In this example, there are three input columns (Accidents in the past three years, Age and Points).Age: Each input is a certain data type. These inputs are all of the data type Number. Insurability: The output column presents the result of the business rule. Like inputs, each output has a date type.

Decision table structure

Each business rule is presented as a row in the table. Here there are four business rules. The rules engine compares input values t other cells in the table. You fill these cells when constructing the table. You can add documentation to the table.

Check out this example of components and structure. Here are four rules expressed in the decision table. Every set of inputs must match one rule, which results in an output. Below are four rules expressed in the decision table. Every set of inputs must match one rule, which results in an output.

Accidents in the past 3 years: People who have had more than two accidents are denied insurance. Age: People younger than 18 are denied insurance. Points: People who have more than four traffic points are denied insurance.

Operators are used to create business rules in decision tables. There are many different types of operators.

List of operators: equal to, not equal to, element of, not an element of, greater than, less than, less than or equal to, and greater than or equal to.

Log in to track your progress & complete quizzes