In earlier posts, we discussed that there are many ways of modeling business rules. If you do it in a decision table form, the benefit is that you can check for correctness and completeness of the business rules within the table, which would be a way of validating business rules.

Let’s consider the following decision table:

decision table sample family discount

This is a very simple table that calculates the discount percentage for a person based on their family status:

  1. The age range of the person (Child, Adult)
  2. Whether they have kids or not? (Married, Single)
  3. If they are married or not (Kids, No Kids)

As you see in the above table, all the possible values are shown in the table header (3rd line of the table).

This decision table is very simple and just looks fine, right? Well, let’s try to run validation and examine the results.

After running validation you get the following results:

business rules validation errors

More Complex Conditions

Business rules conditions are not always options from lists or simple values. They might be partial expressions. For example, checking for value ranges as part of the rule conditions.

The validation should also be able to validate these complex expressions:

decision table validation complex business rules

We had couple of requests in LinkedIn discussion groups to provide more complex rulesets (i.e., decision table in this case). So, we updated this post to provide a more complex example that involves partial expressions and range values validation.

Conclusion

As you see the decision table is not as innocent as is it looked! Validating the decision table reveals all these issues.

From now on, make sure you don’t forget to validate business rules in order to identify missing and conflicting issues. Correctness and completeness are important and these ensure you have covered all possible scenarios in your decision table when it comes to all of the possible combinations of business rules conditions.

Learn Decision Table

To learn more about how to model decision tables in detail, please download our paper at https://www.flexrule.com/resources/decision-table/

Read More

  1. Test Business Rules in JavaScript
  2. JavaScript Rules Engine
  3. XBRL and Standard Business Reporting
  4. Import DMN models – XML 1.1
  5. Edit Business Rules on Web
  6. Validating Business Rules
  7. Decision model and Notation – Policy Example
  8. Decision Table Web Component
  9. Reuse Business Decision
  10. Business Rule to Identify Duplicates