There are many different ways to write business rules. You can write them in a Decision Table format, natural language, or tree and sub-tree form. In this post we are going to discuss writing business rules in Natural Language. We will cover other types of business rules entry in future posts.

Generally we write business rules via a data structure. This is not always the case, but it is a very common practice. The data structure can be referenced from a file (i.e., coded class, type from a DLL or .Net Assembly, XML Schema, etc.). For more flexibility it can be modeled using fact concept. So let's go ahead and create a fact model, as shown below:

Writing Business Rules- fact-concept - Person information, including the Address and its Type. Person has Address, and Address has an AddressType

Person information, including the Address and its Type. Person has Address, and Address has an AddressType

Natural Language

Today we are seeing an increased interest in writing business rules using Natural Language. At FlexRule, we have a very flexible and adaptable Natural Language. It allows you to write business rules by defining your own ubiquitous language using business glossary, terms and fact concepts to guide you while writing the rules:

Writing Business Rules - Natural Language - Business Glossary - Fact Concept


Writing business rules in Natural Language is a matter of point and click with the help of the following:

  1. Business glossary: allows you to define the reusable terms of your business rules language
  2. Fact concept: allows you to define the fields of information and the relationship between these

Reusability and Testability

In Natural Language, you can start combining different conditions by Boolean operators (i.e., and, or, etc.). Also, you can create reusable rules and call them from within other business rules. For example, in the picture shown above, “Value of {value} is blank” is defined as a rule and is used inside the “fullname is required” business rule.

Once you have finished writing business rules, you can simply provide sample data from from any data source (i.e., JSON, XML, Excel, REST API, Database, etc.). Or you can manually create sample data and then start testing your business rules individually or in a set. Not only that, you can automate the testing so you don't need to test these when you change something.

Book a Custom Demo

First or last name is too short


Natural Language is an efficient way of writing business rules. Although this is not the only way, it is a very popular approach because you can write executable, testable business rules using the ubiquitous language of the domain (i.e., insurance, health, etc.) with our advanced Domain Specific Language module. And you can also expose that to users using our web widget for Natural Language.

Last updated September 22nd, 2020 at 11:25 am Published April 10th, 2018 at 08:31 am