A business rules engine is a
software system that executes one or more
business rules A business rule defines or constrains some aspect of business. It may be expressed to specify an action to be taken when certain conditions are true or may be phrased so it can only resolve to either true or false. Business rules are intended to as ...
in a runtime
production environment
In software deployment, an environment or tier is a computer system or set of systems in which a computer program or software component is deployed and executed. In simple cases, such as developing and immediately executing a program on the same m ...
. The rules might come from legal
regulation
Regulation is the management of complex systems according to a set of rules and trends. In systems theory, these types of rules exist in various fields of biology and society, but the term has slightly different meanings according to context. Fo ...
("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
This glossary of computer software terms lists the general terms related to computer software, and related fields, as commonly used in Wikipedia articles.
Glossary
See also
* Outline of computer programming
* Outline of soft ...
.
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 A BRMS or business rule management system is a software system used to define, deploy, execute, monitor and maintain the variety and complexity of decision logic that is used by operational systems within an organization or enterprise. This logic, a ...
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 applications that are affected or need to enforce one or more of the rules.
IT use
In any
IT application, business rules can change more frequently than other parts of the application code. Rules engines or
inference engine
In the field of artificial intelligence, an inference engine is a component of the system that applies logical rules to the knowledge base to deduce new information. The first inference engines were components of expert systems. The typical expert ...
s serve as pluggable
software component
Component-based software engineering (CBSE), also called component-based development (CBD), is a branch of software engineering that emphasizes the separation of concerns with respect to the wide-ranging functionality available throughout a give ...
s which execute business rules that a
business rules approach Business rules are abstractions of the policies and practices of a business organization. In computer software development, the business rules approach is a development methodology where rules are in a form that is used by, but does not have to be ...
has externalized or separated from application code. This externalization or separation allows business users to modify the rules without the need for IT
intervention. The system as a whole becomes more easily adaptable with such external business rules, but this does not preclude the usual requirements of
QA and other testing.
History
An article in ''
Computerworld'' traces rules engines to the early 1990s and to products from the likes of
Pegasystems
Pegasystems Inc. is an American software company based in Cambridge, Massachusetts. Founded in 1983, Pegasystems develops software for customer relationship management (CRM) and business process management (BPM). The company has been publicly tr ...
,
Fair Isaac
FICO (legal name: Fair Isaac Corporation), originally Fair, Isaac and Company, is a data analytics company based in Bozeman, Montana, focused on credit scoring services. It was founded by Bill Fair and Earl Isaac in 1956. Its FICO score, a me ...
Corp and
ILOG
ILOG S.A. was an international software company purchased and incorporated into IBM announced in January, 2009. It created enterprise software products for supply chain, business rule management, visualization and optimization. The main product ...
.
Design strategies
Many organizations' rules efforts combine aspects of what is generally considered
workflow
A workflow consists of an orchestrated and repeatable pattern of activity, enabled by the systematic organization of resources into processes that transform materials, provide services, or process information. It can be depicted as a sequence o ...
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 workflows as follows:
* Business rules produce knowledge;
* Workflows 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 workflow 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 workflows. 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) and a
BRM
British Racing Motors (BRM) was a British Formula One motor racing team. Founded in 1945 and based in the market town of Bourne in Lincolnshire, it participated from 1951 to 1977, competing in 197 grands prix and winning seventeen. BRM wo ...
(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 application programming interface (API) standard, in order to allow for integration with different applications, and many rule engines allow for
service-oriented integrations through Web-based standards such as
WSDL
The Web Services Description Language (WSDL ) is an XML-based interface description language that is used for describing the functionality offered by a web service. The acronym is also used for any specific WSDL description of a web service (also ...
and
SOAP
Soap is a salt of a fatty acid used in a variety of cleansing and lubricating products. In a domestic setting, soaps are surfactants usually used for washing, bathing, and other types of housekeeping. In industrial settings, soaps are use ...
.
Most rule engines provide the ability to develop a
data abstraction that represents the
business entities
In law, a legal person is any person or 'thing' (less ambiguously, any legal entity) that can do the things a human person is usually able to do in law – such as enter into contracts, sue and be sued, own property, and so on. The reason for ...
and relationships that rules should be written against. This business entity model can typically be populated from a variety of sources including
XML
Extensible Markup Language (XML) is a markup language and file format for storing, transmitting, and reconstructing arbitrary data. It defines a set of rules for encoding documents in a format that is both human-readable and machine-readable ...
,
POJOs,
flat file
A flat-file database is a database stored in a file called a flat file. Records follow a uniform format, and there are no structures for indexing or recognizing relationships between records. The file is simple. A flat file can be a plain ...
s, etc. There is no standard language for writing the rules themselves. Many engines use a
Java
Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's mos ...
-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 (or forward reasoning) is one of the two main methods of reasoning when using an inference engine and can be described logically as repeated application of ''modus ponens''. Forward chaining is a popular implementation strategy ...
, which can be further divided into two classes:
* The first class processes so-called production/
inference 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 (ECA) 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:
*The ''event'' part specifies the signal that t ...
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 Event processing is a method of tracking and analyzing (processing) streams of information (data) about things that happen (events), and deriving a conclusion from them. Complex event processing, or CEP, consists of a set of concepts and techniques ...
rules engines emphasize reaction rules.
In addition, some rules engines support
backward chaining. 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.
Another kind of rule engine automatically switches between back- and forward-chaining several times during a reasoning run, e.g. the Internet Business Logic system, which can be found by searching the web.
A fourth 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.
There are some circumstance where
Fuzzy Logic based inference may be more appropriate, where heuristics are used in rule processing, rather than Boolean rules. Examples might include customer classification, missing data inference, customer value calculations, etc. The DARL language
and the associated inference engine and editors is an example of this approach.
Rules engines for access control / authorization
One common use case for rules engines is standardized access control to applications.
OASIS defines a rules engine architecture and standard dedicated to access control called
XACML
XACML stands for "eXtensible Access Control Markup Language". The standard defines a declarative fine-grained, attribute-based access control policy language, an architecture, and a processing model describing how to evaluate access requests a ...
(eXtensible Access Control Markup Language).
One key difference between a XACML rule engine and a business rule engine is the fact that a XACML rule engine is stateless and cannot change the state of any data.
The XACML rule engine, called a
Policy Decision Point (PDP), expects a binary Yes/No question e.g. "Can Alice view document D?" and returns a decision e.g. Permit / deny.
See also
*
Business rule A business rule defines or constrains some aspect of business. It may be expressed to specify an action to be taken when certain conditions are true or may be phrased so it can only resolve to either true or false. Business rules are intended to as ...
*
Production system
*
Inference engine
In the field of artificial intelligence, an inference engine is a component of the system that applies logical rules to the knowledge base to deduce new information. The first inference engines were components of expert systems. The typical expert ...
*
Rete algorithm
The Rete algorithm ( , , rarely , ) is a pattern matching algorithm for implementing rule-based systems. The algorithm was developed to efficiently apply many rules or patterns to many objects, or facts, in a knowledge base. It is used to dete ...
*
Ripple-down rules
*
Business rule management system A BRMS or business rule management system is a software system used to define, deploy, execute, monitor and maintain the variety and complexity of decision logic that is used by operational systems within an organization or enterprise. This logic, a ...
*
Semantic reasoner
*
Workflow engine A workflow engine is a software application that manages business processes. It is a key component in workflow technology and typically makes use of a database server.
A workflow engine manages and monitors the state of activities in a workflow, su ...
*
Business Process Execution Language (BPEL)
*
List of BPEL engines
*
List of BPMN 2.0 engines
References
Bibliography
*Taylor, James; Raden, Neil (2007). Smart (Enough) Systems. Prentice Hall. {{ISBN, 0-13-234796-2.
*David Linthicum (2007-02-14). "Rules Engines and SOA". InfoWorld, 2007-02-14. Retrieved on 2009-09-23 from http://www.infoworld.com/d/architecture/rules-engines-and-soa-158.
External links
Guidelines for deciding whether to use a rules engine?
Rule engines
Decision support systems
Expert systems