Drools#JBoss Enterprise BRMS

{{Short description|Business rule management system}}

{{for|the tendency of saliva to flow out of the mouth|drooling}}

{{Multiple issues|

{{Advert|date=July 2020}}

{{Cleanup rewrite|date=December 2021}}

}}

{{Infobox software

| name = Drools

| logo =

| caption =

| author = Bob McWhirte, Mark Proctor

| developer = The Apache Software Foundation

| released = {{Start date and age|2005|08|01}}

| latest release version = 10.0.0

| latest release date = {{release date and age|2024|12|11}}{{cite web|url=https://github.com/apache/incubator-kie-drools/releases/tag/10.0.0|title=Drools - Releases|access-date=2025-04-11}}

| operating system = Cross-platform

| repo = https://github.com/apache/incubator-kie-drools

| programming language = Java

| genre = Rules engine, Decision management

| license = ASL 2

| website = https://kie.apache.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.

Drools supports the Java Rules Engine API (Java Specification Request 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.

Drools in Apache Kie

Drools, as part of the Kie Community{{cite web |title=KIE Community |url=https://www.kie.org/about/ |archiveurl=http://web.archive.org/web/20240117205431/https://www.kie.org/about/ |archivedate=2024-01-17 }} has entered Apache Incubator in January, 2023.{{cite web |title=KIE Status |url=https://incubator.apache.org/projects/kie.html |archiveurl=http://web.archive.org/web/20231225000354/https://incubator.apache.org/projects/kie.html |archivedate=2023-12-25 }}

Red Hat Decision Manager

Red Hat Decision Manager (formerly Red Hat JBoss BRMS{{cite web |title=JBoss Enterprise BRMS|url=https://www.redhat.com/en/technologies/jboss-middleware/decision-manager |publisher=Red Hat }}) is a business rule management system and reasoning engine for business policy and rules development, access, and change management.{{cite web|title=JBoss Enterprise BRMS|url=http://www.jboss.com/products/platforms/brms/|publisher=Red Hat}} 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.{{cite web|title=JBoss Enterprise BRMS: Answers to frequently asked questions|url=http://www.jboss.com/pdf/brms-faq.pdf|publisher=JBoss Community}}

Components of the enterprise version:{{cite web |title=JBoss Enterprise BRMS Platform 5.1 |url=http://www.jboss.com/products/platforms/brms/components/ |publisher=Red Hat |url-status=dead |archiveurl=https://web.archive.org/web/20110318221503/http://www.jboss.com/products/platforms/brms/components/ |archivedate=2011-03-18 }}

  • JBoss Enterprise Web Platform – the software infrastructure, supported to run the BRMS components only
  • JBoss Enterprise Application Platform or JBoss Enterprise SOA Platform – the software infrastructure, supported to run the BRMS components only
  • Business Rules Engine – Drools Expert using the Rete algorithm and the Drools Rule Language (DRL){{cite web|title=JBoss Enterprise BRMS datasheet|url=http://www.jboss.com/pdf/JBossBRMSFactSheetWebPDF.pdf|publisher=Red Hat|page=4}}
  • Business Rules Manager – Drools Guvnor - Guvnor is a centralized repository for Drools Knowledge Bases, with rich web-based GUIs, editors, and tools to aid in the management of large numbers of rules.{{Cite web|url=http://www.jboss.org/drools/drools-guvnor|title = Drools - Business Rules Management System (Java™, Open Source)}}
  • Business Rules Repository – Drools Guvnor

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:{{cite web|title=Drools 5 - The Business Logic integration Platform|url=http://www.jboss.org/drools|publisher=JBoss Community}}

  • Drools Guvnor (Business Rules Manager) – a centralized repository for Drools Knowledge Bases
  • Drools Expert (rule engine) – uses the rules to perform reasoning
  • Drools Flow (process/workflow), or jBPM 5 – provides for workflow and business processes
  • Drools Fusion (event processing/temporal reasoning) – provides for complex event processing
  • Drools Planner/OptaPlanner (automated planning) – optimizes automated planning, including NP-hard planning problems

Example

This examplehttp://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-expert/html_single/index.html#d0e2676{{dead link|date=December 2016 |bot=InternetArchiveBot |fix-attempted=yes }} 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"

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 of 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 the "when" part of the rule but we can use Java code in the "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.

See also

{{Portal|Free Software|Computer programming}}

References

{{Reflist|30em}}