Drools

For the tendency of saliva to flow out of the mouth, see drooling.
Drools
Developer(s) Red Hat
Stable release 6.3.0 / September 25, 2015 (2015-09-25)
Written in Java
Operating system Cross-platform
Type Rules engine
License ASL 2
Website http://www.drools.org/

Drools is a business rule management system (BRMS) with a forward and backward chaining inference based rules engine, more correctly known as a production rule system, using an enhanced implementation of the Rete algorithm.

KIE (Knowledge Is Everything) is the new umbrella name to drools, optaPlanner, jBPM, Guvnor, uberFire and related technologies.

Drools supports the JSR-94 standard for its business rule engine and enterprise framework for the construction, maintenance, and enforcement of business policies in an organization, application, or service.

JBoss Enterprise BRMS

JBoss Enterprise BRMS is a business rule management system and reasoning engine for business policy and rules development, access, and change management.[1] JBoss Enterprise BRMS is a productized version of Drools with enterprise-level support available. JBoss Rules is also a productized version of Drools, but JBoss Enterprise BRMS is the flagship product.[2]

Components of the enterprise version:[3]

Drools and Guvnor are JBoss Community open source projects. As they are mature, they are brought into the enterprise-ready product JBoss Enterprise BRMS.

Components of the JBoss Community version:[6]

Example

This example[7] illustrates a simple rule to print out information about a holiday in July. It checks a condition on an instance of the Holiday class, and executes Java code if that condition is true.

rule "validate holiday" 
dialect "mvel"
dialect "java"
when
    $h1 : Holiday( month == "july" )
then
    System.out.println($h1.name + ":" + $h1.month);
end

The purpose of dialect "mvel" is to point the Getter and Setters of the variables of your Plain Old Java Object (POJO) classes. Consider the above example, in which a Holiday class is used and inside the circular brackets (parentheses) "month" is used. So with the help dialect "mvel" the getter and setters of the variable "month" can be accessed.

Dialect "java" is used to help us write our Java code in our rules. There is one restriction or characteristic on this. We cannot use Java code inside "when" part of the rule but we can use Java code in "then" part.

We can also declare a Reference variable $h1 without the $ symbol. There is no restriction on this. The main purpose of putting the $ symbol before the variable is to mark the difference between variables of POJO classes and Rules.

Related systems

See also

References

External links

This article is issued from Wikipedia - version of the Saturday, April 23, 2016. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.