Business rules engine
Encyclopedia
A business rules engine is a software system that executes one or more business rules in a runtime production environment. The rules might come from legal regulation
Regulation
Regulation is administrative legislation that constitutes or constrains rights and allocates responsibilities. It can be distinguished from primary legislation on the one hand and judge-made law on the other...

 ("An employee can be fired for any reason or no reason but not for an illegal reason"), company policy ("All customers that spend more than $100 at one time will receive a 10% discount"), or other sources. A business rule system enables these company policies and other operational decisions to be defined, tested, executed and maintained separately from application code.

Rule engines typically support rules, facts, priority (score), mutual exclusion, preconditions, and other functions.

Rule engine software is commonly provided as a component of a business rule management system which, among other functions, provides the ability to: register, define, classify, and manage all the rules, verify consistency of rules definitions (”Gold-level customers are eligible for free shipping when order quantity > 10” and “maximum order quantity for Silver-level customers = 15” ), define the relationships between different rules, and relate some of these rules to IT
Information technology
Information technology is the acquisition, processing, storage and dissemination of vocal, pictorial, textual and numerical information by a microelectronics-based combination of computing and telecommunications...

 applications that are affected or need to enforce one or more of the rules.

IT use

In any IT
Information technology
Information technology is the acquisition, processing, storage and dissemination of vocal, pictorial, textual and numerical information by a microelectronics-based combination of computing and telecommunications...

 application, business rules change more frequently than the rest of the application code. Rules engines or inference engine
Inference engine
In computer science, and specifically the branches of knowledge engineering and artificial intelligence, an inference engine is a computer program that tries to derive answers from a knowledge base. It is the "brain" that expert systems use to reason about the information in the knowledge base for...

s are the pluggable software components that execute business rules that have been externalized from application code as part of a business rules approach
Business rules approach
Business rules are abstractions of the policies and practices of a business organization. The Business Rules Approach is a development methodology where rules are in a form that is used by, but does not have to be embedded in, business process management systems.The Business Rules Approach...

. This externalization of business rules allows the business users to modify the rules frequently without the need of IT intervention. The system as a whole becomes more adaptable with business rules that can be changed dynamically, although QA
Software quality assurance
Software quality assurance consists of a means of monitoring the software engineering processes and methods used to ensure quality. The methods by which this is accomplished are many and varied, and may include ensuring conformance to one or more standards, such as ISO 9000 or a model such as...

 and other testing would still be required.

Design strategies

Many organizations' rules efforts combine aspects of what is generally considered work-flow design with traditional rule design. This failure to separate the two approaches can lead to problems with the ability to re-use and control both business rules and workflows. Design approaches that avoid this quandary separate the role of business rules and work flows as follows:

Business rules produce knowledge; work flows perform business work. Concretely, that means that a business rule may do things like detect that a business situation has occurred and raise a business event (typically carried via a messaging infrastructure) or create higher level business knowledge (e.g., evaluating the series of organizational, product, and regulatory-based rules concerning whether or not a loan meets underwriting criteria). On the other hand, a work flow would respond to an event that indicated something such as the overloading of a routing point by initiating a series of activities.

This separation is important because the same business judgment (mortgage meets underwriting criteria) or business event (router is overloaded) can be reacted to by many different work flows. Embedding the work done in response to rule-driven knowledge creation into the rule itself greatly reduces the ability of business rules to be reused across an organization because it makes them work-flow specific.

To create an architecture that employs a business rules engine it is essential to establish the integration between a BPM
Business process management
Business process management is a holistic management approach focused on aligning all aspects of an organization with the wants and needs of clients. It promotes business effectiveness and efficiency while striving for innovation, flexibility, and integration with technology. BPM attempts to...

 (Business Process Management) and a BRM (Business Rules Management) platform that is based upon processes responding to events or examining business judgments that are defined by business rules. There are some products in the marketplace that provide this integration natively. In other situations this type of abstraction and integration will have to be developed within a particular project or organization.

Most Java-based rules engines provide a technical call-level interface, based on the JSR-94
JSR-94
JSR-94 is the Java Specification Request for a Java Rules Engine API. The specification for the Java Rule Engine API , developed through the Java Community Process program, defines a Java runtime API for rule engines by providing a simple API to access a rule engine from a Java Platform, Standard...

 application programming interface
Application programming interface
An application programming interface is a source code based specification intended to be used as an interface by software components to communicate with each other...

 (API) standard, in order to allow for integration with different applications, and many rule engines allow for service-oriented
Service-oriented
In human sexuality, Service-oriented is a term used in the BDSM community to refer relationship dynamic.In a service-oriented relationship, the focus is on how the submissive can contribute resources to the dominant partner, provide for some of their needs or advance their goals...

 integrations through Web-based standards such as WSDL
Web Services Description Language
The Web Services Description Language is an XML-based language that is used for describing the functionality offered by a Web service. A WSDL description of a web service provides a machine-readable description of how the service can be called, what parameters it expects and what data structures...

 and SOAP
SOAP
SOAP, originally defined as Simple Object Access Protocol, is a protocol specification for exchanging structured information in the implementation of Web Services in computer networks...

.

Most rule engines supply the ability to develop a data abstraction that represents the business entities and relationships that rules should be written against. This business entity model can typically be populated from a variety of sources including XML
XML
Extensible Markup Language is a set of rules for encoding documents in machine-readable form. It is defined in the XML 1.0 Specification produced by the W3C, and several other related specifications, all gratis open standards....

, POJO
Pojo
Pojo may refer to:* Pohja, the Swedish name for the Finnish municipality* POJO, abbreviation of Plain Old Java Object in computer programming...

s, flat files, etc. There is no standard language for writing the rules themselves. Many engines use a Java-like syntax, while some allow the definition of custom business friendly languages.

Most rules engines function as a callable library. However, it is becoming more popular for them to run as a generic process akin to the way that RDBMSs behave. Most engines treat rules as a configuration to be loaded into their process instance, although some are actually code generators for the whole rule execution instance and others allow the user to choose.

Types of rule engines

There are a number of different types of rule engines. These types (generally) differ in how Rules are scheduled for execution.

Most Rules Engines used by businesses are forward chaining
Forward chaining
Forward chaining is one of the two main methods of reasoning when using inference rules and can be described logically as repeated application of modus ponens. Forward chaining is a popular implementation strategy for expert systems, business and production rule systems...

, which can be further divided into two classes:
  • The first class processes so-called production/inference
    Inference
    Inference is the act or process of deriving logical conclusions from premises known or assumed to be true. The conclusion drawn is also called an idiomatic. The laws of valid inference are studied in the field of logic.Human inference Inference is the act or process of deriving logical conclusions...

     rules. These types of rules are used to represent behaviors of the type IF condition THEN action. For example, such a rule could answer the question: "Should this customer be allowed a mortgage?" by executing rules of the form "IF some-condition THEN allow-customer-a-mortgage".
  • The other type of rule engine processes so-called reaction/Event Condition Action
    Event condition action
    Event Condition Action is a short-cut for referring to the structure of active rules in event driven architecture and active database systems.Such a rule traditionally consisted of three parts:...

     rules. The reactive rule engines detect and react to incoming events and process event patterns. For example, a reactive rule engine could be used to alert a manager when certain items are out of stock.

The biggest difference between these types is that production rule engines execute when a user or application invokes them, usually in a stateless manner. A reactive rule engine reacts automatically when events occur, usually in a stateful manner. Many (and indeed most) popular commercial rule engines have both production and reaction rule capabilities, although they might emphasize one class over another. For example, most business rules engines are primarily production rules engines, whereas complex event processing
Complex Event Processing
Complex event processing consists of processing many events happening across all the layers of an organization, identifying the most meaningful events within the event cloud, analyzing their impact, and taking subsequent action in real time....

 rules engines emphasize reaction rules.

In addition, some Rules Engines support backward chaining
Backward chaining
Backward chaining is an inference method that can be described as working backward from the goal...

. In this case a Rules Engine seeks to resolve the facts to fit a particular goal. It is often referred to as being goal driven because it tries to determine if something exists based on existing information.

A third class of Rules Engine might be called a deterministic engine. These Rules Engines may forgo both forward chaining and backward chaining, and instead utilize Domain-specific language approaches to better describe policy. This approach is often easier to implement and maintain, and provides performance advantages over forward or backward chaining systems.

Resources

  • TAYLOR, James with RADEN, Neil (2007). Smart (Enough) Systems. Prentice Hall. ISBN 0-13-234796-2.
  • David Linthicum. “Rules Engines and SOA”, InfoWorld, 02-14-2007. Retrieved on 23-09-2009.

See also

  • Business rule
    Business rule
    A Business rule is a statement that defines or constrains some aspect of the business and always resolves to either true or false. Business rules are intended to assert business structure or to control or influence the behavior of the business. Business rules describe the operations, definitions...

  • Production system
    Production system
    A production system is a computer program typically used to provide some form of artificial intelligence, which consists primarily of a set of rules about behavior. These rules, termed productions, are a basic representation found useful in automated planning, expert systems and action selection...

  • Inference engine
    Inference engine
    In computer science, and specifically the branches of knowledge engineering and artificial intelligence, an inference engine is a computer program that tries to derive answers from a knowledge base. It is the "brain" that expert systems use to reason about the information in the knowledge base for...

  • Rete algorithm
    Rete algorithm
    The Rete algorithm is an efficient pattern matching algorithm for implementing production rule systems. The Rete algorithm was designed by Dr Charles L. Forgy of Carnegie Mellon University, first published in a working paper in 1974, and later elaborated in his 1979 Ph.D. thesis and a 1982 paper...

  • Ripple down rules
    Ripple down rules
    Ripple Down Rules is a way of approaching knowledge acquisition. Knowledge acquisition refers to the transfer knowledge from human experts to knowledge based systems.- Introductory material :...

  • Business Rule Management System
  • Semantic reasoner
    Semantic reasoner
    A semantic reasoner, reasoning engine, rules engine, or simply a reasoner, is a piece of software able to infer logical consequences from a set of asserted facts or axioms. The notion of a semantic reasoner generalizes that of an inference engine, by providing a richer set of mechanisms to work with...

  • Java Rules Engine API

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK