ArticleslgStudy

computer science

Drools

Drools is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Drools rather than just read about it. In short: 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 busi…

Key takeaways

  • Drools belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Drools to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Drools from memory before moving on to harder problems.

Reference excerpt

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 has entered Apache Incubator in January, 2023.

Red Hat Decision Manager Red Hat Decision Manager (formerly Red Hat JBoss BRMS) is a business rule management system and reasoning engine for business policy and rules development, access, and change management. 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. Components of the enterprise version:

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) 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. 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:

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 example 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.

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

List of JBoss software Semantic reasoner WildFly

References

External links Official website incubator-kie-drools on GitHub

Worked examples

Example 1 — a first encounter with Drools

Start with the simplest possible case. Write down what Drools claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Drools before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Drools ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Drools

In research
Drools appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Drools in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Drools is common in secondary-school and first-year university syllabi. It links to neighbouring topics Apache Software Foundation projects, Free software programmed in Java, Rule engines, so understanding it makes those chapters shorter.
In everyday life
Look for Drools outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Drools” →

How to study Drools in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Drools means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Drools out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Drools in simple terms?

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) s…

Why does Drools matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Drools?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Drools.

Tags

  • Apache Software Foundation projects
  • Free software programmed in Java
  • Rule engines
  • Software using the Apache license

Keep exploring