Recommended tutorial: java tutorial
Drools Introduction
Drools (JBoss Rules) has an open source business rules engine that is easy to access enterprise policies, easy to adjust, and easy to manage. It is in line with industry standards, fast, and efficient. It allows a business analyst or auditor to easily review business rules to verify that the coded rules enforce the required business rules.
JBoss Rules was formerly an open source project of Codehaus called Drools. It was recently brought under JBoss and renamed JBoss Rules, becoming the rules engine of JBoss application server.
Drools is an implementation of a rule engine based on Charles Forgy's RETE algorithm customized for Java. RETE with OO interface enables business rules to be expressed more naturally.
## Drools uses XML's
The Java code will be interpreted using Antlr, while Groovy and Python themselves are scripting languages and can be called directly.
The smart thing about Drools is that it uses XML nodes to standardize the definition of If--Then sentences and facts, making the engine very comfortable to work with.
The use of native languages such as Java and Groovy for judgment and execution statements makes it easy for programmers to transition and transplant, and the learning curve is very low.
Extended content: Rule engine
The rule engine originated from the rule-based expert system, and is based on Rule-based expert systems are one of the branches of expert systems. Expert system belongs to the category of artificial intelligence. It imitates human reasoning, uses heuristic methods to reason, and uses terms that humans can understand to explain and prove its reasoning conclusions
The rule engine generally consists of 3 parts: rule base (Knowledge base) Working Memory (Fact base) inference engine (rule engine).
The work of the rule engine: pattern matching, conflict resolution, execution engine.
Pattern matching algorithm: An algorithm that matches facts with rules. Common pattern matching algorithms include RETE, LFA, TREAI, and LEAPS. The matching algorithm used by Drools is RETE, which is considered to be the most advanced pattern matching algorithm in the world.
Supplement: There are many types of rule engines. Divided based on how the rules are enforced. Most rule engines used commercially are of the forward chaining type (I don’t know how to explain it in Chinese). There are two types of forward chaining: (1) production/inference rules (I don’t know how to explain it in Chinese), which drive the rule engine through conditional judgments such as IFconditionTHEN action. (2) reaction/Event Condition Action rules, this rule engine drives the rule engine through the event mechanism. This is what I learned from Wikipedia.
The above is the detailed content of What is drools rules engine. For more information, please follow other related articles on the PHP Chinese website!