Rules Engine
by krishna
Sustaining changing business environment and remaining competitive is one of the biggest challenges faced by organizations today. Changes in competitive factors ultimately result in changes in business rules. Frequent changes to business rules increase the cost of maintenance, enhancement and customization: a problem seen across verticals. This calls for flexibility in administration and maintenance of applications and real-time responsiveness to changes in business requirements.
- Definition: The well-known Business Rules Group published two definitions for business rules.
- Business perspective: A business rule is ‘a directive, intended to influence or guide business behavior, in support of business policy that has been formulated in response to an opportunity, threat, strength, or weakness’.
- IT perspective: A business rule is ‘a statement that defines or constrains an aspect of the business. It is intended to assert business structure, or to control or influence the behavior of the business’.
- What are Business Rules?
A statement that defines or constrains some aspect of the business which is intended to assert business structure or to control or influence the behavior or the business. - Why use a Business Rule Engine?
- Separation of business rules from the applications that use them allows non-programmers to maintain business logic without modifying software.
- Reduces development time and significantly reduces maintenance and enhancement cost. Studies show that 15 to 50% of a typical annual IT budget is spent on making, testing, and implementing rule changes in applications.
- Increases flexibility and reduces time-to-market.
- Promotes visibility and understanding of business policies and procedures.
- Promotes consistent decision making.
- Forces order to the rules and policies that govern business.
- Categories of Business Rule: A statement of a business rule falls into one of four categories
- Definitions of business terms The most basic element of a business rule is the language used to express it. The very definition of a term is itself a business rule that describes how people think and talk about things. Thus, defining a term is establishing a category of business rule. Terms have traditionally been documented in glossaries or as entities in a conceptual model.
- Facts relating terms to each other The nature or operating structure of an organization can be described in terms of the facts that relate terms to each other. To say that a customer can place an order is a business rule. Facts can be documented as natural language sentences or as relationships, attributes, and generalization structures in a graphical model
- Constraints or Action assertions Every enterprise constrains behavior in some way, and this is closely related to constraints on what data may or may not be updated. To prevent a record from being made is, in many cases, to prevent an action from taking place.
- Derivations Business rules (including laws of nature) define how knowledge in one form may be transformed into other knowledge, possibly in a different form.
- Examples: The definition of a business rule applies to many statements used in a company. Giving examples of business rules can therefore result in a long list.
- A typical example of a business rules from legislation. All states except Montana, an employer can fire any worker for any reason, or for no reason, as long as it is not for an illegal reason.
- A typical example of a sales / marketing rule that may be implemented in an IT system. Every visitor of the conference gets a 20% discount on the first product purchase.
- A typical example of a rule that will never be implemented in an IT system but probably be stated as a reminder by entering a building Nobody is allowed to smoke inside the company building.
- Workflow vs Rules Engine
Wokflow Rules Engine Workflow is concerned with the application-specific sequencing of activities via predefined instruction sets, involving either or both automated procedures (software-based) and manual activities (people work). BPM (Business Process Management) is concerned with the definition, execution and management of business processes defined independently of any single application. BPM is a superset of workflow, further differentiated by the ability to coordinate activities across multiple applications with fine grain control. Integration between workflow systems and externalities are comparatively limited, often only allowing the retrieval of documents or data variables and only as a pass-through with no awareness of content. BPM systems allow both the capture and introspection of external documents and data, presenting a closed-loop process for validating the integrity of transactions, data and content, as well as the initiation of compensating activities when necessary. BPM processes separate execution instructions from process flows; thus, routing can be tied to process outcomes and milestones. - Advantages of a rule engine
- Rule englines allow you to say “What to do” not “How to do it”.
- Rule systems are capable of solving very very hard problems, yet providing a solution that is able to explain why a “decision” was made (not so easy with other types of AI systems like neural networks, or say, my brain – I have no idea why I scratched the side of the car).
- Logic and Data Separation Your data is in your domain objects, the logic is in the rules. This is fundamentally breaking the OO coupling of data and logic (this can be an advantage as well as a disadvantage depending on your point of view). The upshot is that the logic can be much easier to maintain as there are changes in the future, as the logic is all layed out in rules.
- Speed and Scalability The Rete algorithm, Leaps algorithm, and its descendents such as Drools’ Reteoo (and Leaps), provide very efficient ways of matching rule patterns to your domain object data. These are especially efficient when you have datasets that do not change entirely (as the rule engine can remember past matches). These algorithms are battle proven.
- When should you use a rule engine
It is a complex problem to solve, there are no obvious traditional solutions or basically the problem isn’t fully understood
The logic changes often - When not to use a rule engine
It seems to me that in the excitement of working with rules engines, that people forget that a rules engine is only one piece of a complex application or solution. Rules engines are not really intended to handle workflow or process executions nor are workflow engines or process management tools designed to do rules. Use the right tool for the job. Sure, a pair of pliers can be used as a hammering tool in a pinch, but that’s not what it’s designed for.
Sustaining changing business environment and remaining competitive is one of the biggest challenges faced by organizations today. Changes in competitive factors ultimately result in changes in business rules. Frequent changes to business rules increase the cost of maintenance, enhancement and customization: a problem seen across verticals. This calls for flexibility in administration and maintenance of…
Recent Comments
Archives
- August 2025
- July 2025
- June 2025
- May 2025
- April 2025
- March 2025
- November 2024
- October 2024
- September 2024
- August 2024
- July 2024
- June 2024
- May 2024
- April 2024
- March 2024
- February 2024
- January 2024
- December 2023
- November 2023
- February 2012
- January 2012
- December 2011
- October 2011
- August 2011
- July 2011
- May 2011
- January 2011
- November 2010
- October 2010
- September 2010
- July 2010
- April 2010
- March 2010
- February 2010
- January 2010
- December 2009
- October 2009
- September 2009
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- August 2008
- July 2008
- June 2008
- December 2007
- April 2007
- January 2007