Introduction to Business Rules

A Business Rule defines a logical (true or false) condition consisting of one or more conditions calculated from fields of a business entity (business process or entity registry).

When to use business rules?

Business rules can be used to:

  • Make a field visible or active in a form.
  • Create a validation in the flow to monitor the progress of the work item through the process.
  • Automate a gateway so that the decision is made without human action.

How to access business rules?

  • In forms
  1. Choose the relevant form.

  2. Click on the relevant field.
  3. Click on “enabling rule” or “visibility rule”.

You are then redirected to the dialog box that allows you to create the business rules.

Configuration of Business Rules

  • Flow validation
  1. Go to the process editor and choose the concerned process.
  2. Make your process automatable if the option is not yet enabled.

  3. Click on the sequence flow you want to control.

  4. Go to properties and click on “Validation”.

  5. If no validation exists, then click on “Add validation”.

  6. Choose a business rule to edit or click on the “+” icon to create one.

You will then be redirected to the business rules configuration screen, as seen above.

  • Automate a gateway
  1. Go to the process editor and choose the concerned process.
  2. Make your process automatable if the option is not yet enabled.

  3. Click on the gateway concerned.
  4. Go to the “properties”, in the “execution” section and activate the option: “Is Automatic”.

  5. Click on the output flow that will be associated with a business rule.

  6. Go to the “properties” then to the “execution” section. If you want to edit an existing rule, then choose it and click on the pencil icon.
    If you want to create one, then click on the “+” icon.

You will then be redirected to the business rules configuration screen, as seen above.

Creating a Business Rule

First, choose a form field in the first column, which has a textual search.

Select field for business rule

Then, select in the second column a condition operator. Operator options vary depending on the data type of the previously selected field.

Operator of a business rule

Finally, select a value for comparison. This value can be constant as in the figure below.
Value of a business rule

To compare with another field, then click the two arrow icon. In this way, the value field is toggled by a field selection box similar to the first column.

Field for comparison on a business rule

It is important to give a precise name to this rule, because it is reusable. The name given to it must allow process editors to be able to choose it by understanding its logic. The purpose of this is to avoid the user having to return to the business rules editor to check its composition.

Adding conditions

After adding one or more conditions, it is possible to accumulate new ones with a click on the “Add Rule” button.

Composite Rule

If the logical operator “ALL (AND)” is used, then all conditions must return “true” so that the final rule is also “true.”

Using the “ANY (OR)” operator, if at least one of the conditions is true, then rule returns the “true” value.

The “NONE (NOT)” operator is usually used with only one condition to invert the configured condition. When used in a compound rule it returns the negation for the condition “ALL (AND)”.

Nesting conditions

Nesting business rules allows the creation of sub-conditions within a rule. In the following example the final rule will return true if the Final Price value is greater than 1000 and if the Request type is equal to “Internet” or “Wireline TV”.

Business Rules and new versions of processes

Whenever you generate a new version of a process, all business rules are cloned, and any maintenance performed on the new version will not affect the previous version.

Business rules based on dates

If you choose a date or date/time type field, you will then have additional comparison functions:
It will be possible to compare this field to a fixed date:
To another date or date/time type field:
And also at the current date if you choose the condition operator: “before” or “after”:
The “before” condition operator allows you to define a retroactive period from the specified day.

Example: If I choose the “Delivery date” field and put the “before” operator by choosing the value of 2 days from the current date. My rule will return the true value if the date selected in the “Delivery date” field is less than or equal to 2 days before the current date.

The “after” condition operator allows you to define a period from the specified day.

Example: If I choose the “Delivery date” field and put the “after” operator, choosing the value of 2 days from the current date. My rule will return the true value if the date selected in the “Delivery date” field is greater than or equal to 2 days after the current date.
This type of condition operator allows you to create intervals.

Example: I want my rule to be valid only if the date indicated in the “Delivery date” field is between 2 days before the current date and 2 days after it.

It is then necessary to create a business rule composed of 2 conditions.

  • The first: I choose the “Delivery date” field, I put the “after” operator by choosing the value of – 2 days from the current date. This rule will return the true value if the date selected in the “Delivery date” field is greater than or equal to 2 days before the current date.
  • The second: I choose the “Delivery date” field, I put the “before” operator by choosing the value of – 2 days from the current date. This rule will return the true value if the date selected in the “Delivery date” field is less than or equal to 2 days after the current date.

This rule composition must be associated with the “ALL (AND)” operator. This operator makes it possible to take into account only the cases which satisfy the two conditions. The first condition gives a result of -2 to positive infinity and the second of +2 to negative infinity. The range -2 to +2 is the only combination that fulfills both conditions of the established rule.

Was this article helpful?

Related Articles