Pages

Sunday, September 10, 2017

Role of Business Rules in Enterprise Integration space

Every organization depends on decision making to reach its objectives. We can categorise those decisions into different types: Strategic decisions, Operational decisions, repetitive/routine decisions, etc.


For small scale businesses, decisions may make on the fly. But when an organization grows up, an increase of customer base, decisions made on the fly will cause inconsistent decisions and slow decision-making process, which may lead quality issues of provided services and even losing customers. Therefore well defined, documented set of rules/policies are required.

What is business rules?

According to Wikipedia:
“Business rules tell an organization what it can do in detail, while strategy tells it how to focus the business at a macro level to optimize results. Put differently, a strategy provides high-level direction about what an organization should do. Business rules provide detailed guidance about how a strategy can be translated to action.” [https://en.wikipedia.org/wiki/Business_rule]


According to Ronald G. Ross:
"… a discrete operational business policy or practice. A business rule may be considered a user requirement that is expressed in non-procedural and non-technical form (usually textual statements) …A business rule represents a statement about business behavior …"
[The Business Rule Book (First Edition), by Ronald G. Ross, 1994]


We can define business rules in many different ways. Literally, they are used to run the business. Business rules can be considered as a guide to execute day-to-day operations of an organization.


Rules can be used in different ways, for example,
  • Access control: Clearly defining what are the requirements need to meet to grant clearance for a particular resource of an organization.
  • Business calculations: Salary increment calculation
  • Rules focusing on policies: Government approval for new building
Likewise you are may be using business rules even without knowing that using it.


When creating business rules, there are basic principles to follow (some rules to create better rules). If I extract the entire list, listed in “Principles of the Business Rule Approach” by Ronald Ross:
  1. Rules should be written and made explicit.
  2. Rules should be expressed in plain language.
  3. Rules should exist independent of procedures and workflows.
  4. Rules should build on facts, and facts should build on concepts as represented by terms.
  5. Rules should guide or influence behavior in desired ways.
  6. Rules should be motivated by identifiable and important business factors.
  7. Rules should be accessible to authorized parties (e.g. collective ownership).
  8. Rules should be single sourced.
  9. Rules should be specified directly by those people who have relevant knowledge (e.g. active stakeholder participation).
  10. Rules should be managed.


At this point sometimes, you might be confused and mix business rules with business processes/workflows. To be clear, business rules are not business processes, they are two separate entities, which can be used together (since they are closely related, more often used together in the real world). Business rules can be a part of a business process.  Actually, business processes depend on business rules for decision making.


Model

When using defined rules we have to collect Facts (AKA Knowledge, Information, Data) that expected/required by the rule. A well-defined rule will include what information is needed to process it. The person (in case if automated the software/rule engine) process that Facts against the rule set and produce the result as defined in the rule.


If we try to model above:


Model.png
In real world, the processing is done by a person or a software. That software is known as “Rule Engine”.

Business Rules in real world

Let’s start with real world example: Loan approval process of a bank


Example.png


First, the client comes to account manager and discusses possibilities and available loan schemes etc. The client provides applications and required documents to process. Account manager verifies provided documents and transfers them to loan department. Then someone from that department will process. In exceptional cases, he/she takes consult his/her manager and approve or reject the loan application.


Now let's identify business rules in above process:


Example_highlightRules.png


As shown in the above image, each person does take the decision by referring documents provided to them by the bank administration or some decision-making body. We can consider those documents as business rules. The information provided by the applicant verbally/Documented, and information produced by each person in the process are Facts/Knowledge that is applied against documented rules.

Business Rules in Digital world

With organizations adhere digital transformation, printed documents are no longer useful for business rules. Actually, people referring those documents and manually processing facts against those business rules are highly inefficient and ungovernable with organization growth. For example, if the bank in above example decides to change some policies, they have to format documents, print them, deliver and employees have to read it.


By digitizing those rules to executable scripts and using rule engines to evaluate Facts against those rule, allow upper management to make their strategic decisions into actions, in split seconds.


To adhere with digital transformation, most organizations use enterprise integration platform (AKA Enterprise Service Bus) to adopt new technology with their existing legacy systems. That allows them to use Rule Engines to process Facts over rules without changing their existing IT system. Also, they model their business processes and use workflow execution engines to execute them. With the help of the integration layer, those systems can interconnect each other. Some enterprise integration platforms provide all of those functionalities OOTB, for example, WSO2 Enterprise Integrator (Consist of an ESB profile, a Business process profile for workflow execution and Business rule execution facilities using rule engine).


Development of Business Rules scripts

Development of business rules in the corporate world is a never ending cycle.
Rule Cycle.png

Step 0
First of all, initial discussion to introduce new policy/rule to a particular business process or to digitize existing policy or rule.


Step 1
Based on the discussion, document the policies with details. If it is a modification to an existing policy, update the relevant document reflecting changes.


Step 2
Transform the policy/rule document to rule script for the rule engine in the integration platform. Or update existing rule to reflect new changes


Step 3
Deploy the rule script in the QA environment and test for bugs and loopholes.


Step 4
After satisfied with test results deploy the rule in production integration platform. If it is a new rule to the system update relevant business process/ mediation flows to use the newly deployed rule.


Step 5
Monitor and collect data of the business process or mediation flow and analyze to detect bottlenecks.


Step 6
Discuss and make decisions to improve current processes or mediation flows based on the analytics. And update policy/rule documents and start the cycle again.

Business Rules within enterprise integration environment



Business rules are mainly used for decision making in Business processes (Workflows) and message mediation flows in enterprise integration. When the decision-making conditions are too complex to model in a workflow or mediation flow,  integration experts tend to use rules to perform decision making.


Benefits of using Business Rules



  1. Easy to model complex decision-making conditions.
  2. Logic and data separation.
  3. Easier to Understand:
By creating object model or with the support of Domain Specific Languages, rules looks close to natural languages. So easier to understand for a business analyst or a new developer or even nontechnical person that can lead to domain experts of the business, to create the rules by themselves.
  1. Improved maintainability:
When policy changes of the organization, do not need to change existing system in code level. Just need to deploy the updated version of the rules script.
  1. Reusability:
Rules are normally kept in repository separated from business logic which allows reusing.

As the finale, if we design the above-mentioned loan approval example within integration platform, it will be as follows:


Conclusion

Every organization depends on decision making. Some of them are repetitive and able to automate to provide better service to the customers by increasing productivity. Also, as a by product some reduction of operational cost and other benefits by using business rules. To achieve this availability of business rule engine in the integration platform is a huge advantage.

Reference


  1. The Business Rule Book (First Edition), by Ronald G. Ross, 1994
  2. Principles of the Business Rule Approach by Ronald Ross, 2003

No comments:

Post a Comment