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 ( “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 allows 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, mutual exclusion, preconditions, and other functions.
(“Gold-level customers are”), which includes all the rules, rules, and regulations. 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 More of the rules.
In any IT application, business rules can change more frequently than other parts of the application code. Rules engines or inference engines serve as pluggable software components qui execute business rules That a business rules approach HAS externalized gold separated from application code. This externalization or separation allows 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.
An article in Computerworld traces rules engines to the early 1990s and to products from the likes of Pegasystems , Fair Isaac Corp and ILOG . 
Many organizations’ rules efforts combine aspects of what is considered workflow design with traditional rule design. This problem can be solved with the help of two different methods. Design approaches that avoid this kind of business rules and workflows as follows: 
- Business rules produce knowledge;
- Workflows perform business work.
(Eg, evaluating the series of organizational, product, and so on). Regulatory-based rules regarding whether or not a loan meets underwriting criteria. On the other hand, a workflow would respond to an event that would indicate 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 in 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 employees have business rules engine it is essential to suit les the integration entre a BPM (Business Process Management) and a BRM (Business Rules Management) platform That Is based upon processes Responding to events gold 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 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 and SOAP .
Most rule engines provide the ability to develop a data abstraction that represents the business entities and relationships that should be written against. This business entity model can typically be populated from a variety of sources including XML , POJOs , flat files , etc. There is no standard language for writing the rules themselves. Many engines use Java -like syntax, while some allow the definition of custom-friendly languages.
Most rules engines function as a callable library. However, it is becoming more popular for them to run as a generic process as the RDBMSs behave. Most engines treat rules as a procedure to be loaded into their process, although some of them are generic for the whole process.
Types of rule engines
There are a number of different types of rule engines. These types are generally scheduled for execution.
Most rules engines used by businesses are forward chaining , which can be further divided into two classes:
- The first class processes are so-called production / inference rules. These types of rules are used to represent behaviors of the type IF condition THEN action. For example, “Should this customer be allowed a mortgage?” By executing rules of the form “IF some-condition THEN allow-customer-a-mortgage”.
- The other kind of rule engine processes so-called reaction / Event Condition Action rules. The reactive rule engines detect and react to incoming events and process event patterns. For example, a reactive rule could be used to alert a manager when certain items are out of stock.
The biggest difference between these two types of production is the rule of engines executed when a user 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 producing Primarily rules engines, whereas complex event processing rules engines EMPHASIZE reaction rules.
In addition, some rules engines support backward chaining . In this case, we have to solve the problem. It is often referred to as being goal driven because it tries to determine if something exists on existing information.
Another kind of rule engine switches between back- and forward-chaining several times during a reasoning run, eg the Internet Business Logic system, which can be found by searching the web.
A fourth class of rules could be called a deterministic engine. These rules engines may forgo both forward 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.
Rules Engines for Access Control / Authorization
One common use case for rules engines is standardized access control to applications. OASIS defines the XACML (eXtensible Access Control Markup Language). One key difference between a XACML rule and a business rule is the fact that XACML rule engine is stateless and can not change the state of any data. The XACML rule engine, called Policy Decision Point (PDP), expects a binary Yes / No question eg “Can Alice view document D?” And returns a decision eg Permit / deny.
- Business rule
- Production system
- Inference engine
- Rete algorithm
- Ripple down rules
- Business Rule Management System
- Semantic reasoner
- Java Rules Engine API
- Workflow engine
- Business Process Execution Language
- Comparison of BPEL engines
- Comparison of BPMN 2.0 Engines
- Jump up^ “Do you know where your company’s business rules are?” . Computerworld . IDG Enterprise. 39 (21): 25. 2005-05-23. ISSN 0010-4841 . Retrieved 2014-02-02 . Pegasystems Inc. in Cambridge, Mass., Fair Isaac Corp. In Minneapolis and ILOG in Mountain View, Calif., Sold them. They were typically used in heavy industries such as finance and insurance. Over the past few years, however, many vendors have entered the market, and more companies are looking at rules engines as a way to gain greater flexibility in business operations.
- Jump up^ Is Your Rules Engine Event-Driven? Retrieved fromhttp://www.sapiens-tech.com/iDuneDownload.dll?GetFile?AppId=225&FileID=216581&Anchor=&ext=.pdf [ dead link ] .