List of Rule Engines in Java

Sheeraz Gul May 31, 2022
List of Rule Engines in Java

The Rule engines separate the business logic from the source code. This tutorial describes some of the most popular rule engines of Java.

List of Rule Engines in Java

The Rule Engines make it easy to separate the business logic from the code. Most of the popular rule engines in Java implement the JSR94.

We can see the rule engines as a sophisticated if/then statement. Here are some advantages of rule engines in Java:

  1. The rule engines provide great reusability when we keep them separate.
  2. The rule engines reduce the complexity because we don’t need to develop the source code.
  3. The rule engines provide flexibility where we can change the rules without changing anything in the source code.

Here are some famous rule engines in Java:


Drools, also known as business rules management system BRMS, provide a core business rule engine with a web authoring and rules management application. It also provides full runtime support for the decision model with notation (DMN) and a plugin for Eclipse IDE.

Rule Book

The RuleBook provides a simple DSL that is flexible; if we have a larger collection of rules, we can build them into annotated POJOs, and the RuleBook will transform the package into a rule book. It is easy to use lambda-enabled specific language.

Let’s try a simple rule definition using the RuleBook:

The maven dependency for the rule book is:


Now let’s see the rule book example. Let’s first create a rule:

public class DelftstackRule {
    public RuleBook<Object> defineDelftstackRules() {
        return RuleBookBuilder
            .addRule(rule -> rule.withNoSpecifiedFactType()
              .then(f -> System.out.print("Delftstack")))
            .addRule(rule -> rule.withNoSpecifiedFactType()
              .then(f -> System.out.println("The Best Tutorial Site")))

The main method for the above rule will be:

public static void main(String[] args) {
    DelftstackRule ruleBook = new DelftstackRule();
      .run(new FactMap<>());

Easy Rules

Easy Rules, a lightweight rule engine API, provides the rule abstraction to create rules based on actions and conditions. The EasyRule RulesEngine API runs through a set of rules to execute actions and test conditions.

It is also annotation and POJO based also supports composite rule constructions; it supports expression languages like SpEL and MVEL. Here is an example for EasyRule:

The Maven Dependency;


The example can be:

@Rule(name = "Delftstack rule", description = "Always say Delftstack The Best Tutorial Site")
public class DelftstackRule {

    public boolean when() {
        return true;

    public void then() throws Exception {
        System.out.println("Delftstack The Best Tutorial Site");

The code above creates a rule that every time it prints Delftstack The Best Tutorial Site. To launch this code use the code below with the main function:

public class Launch {
    public static void main(String... args) {
        Facts facts = new Facts();

        // create rules
        Rules rules = new Rules();
        rules.register(new DelftstackRule());

        // create a rules engine and fire rules on known facts
        RulesEngine Rules_Engine = new DefaultRulesEngine();, facts);

OpenL Tablets

The OpenL Tablets is a business rule engine and a business rule management system. It contains Webstudio, Web services, rule repository, and Business Rules Engines.

Let’s see an example:

The Maven Dependency for OpenL Tablets:


The example can be:

public class Main {
    private DelftstackRules instance;

    public static void main(String[] args) {
        Main rules = new Main();


    public void process(Case aCase) {
        EngineFactory Engine_Factory = new RulesEngineFactory(
            .getResource("rules.xls"), DelftstackRules.class);
        instance = Engine_Factory.newEngineInstance();
        instance.executePromotion(aCase, new Response());

The code above creates the delftstack rules from the Xls file.

These were a few popular rule engines. To download or for more info, please visit the links below:

  1. Drools
  2. Rule Book
  3. Easy Rules
  4. OpenL Tablets
Author: Sheeraz Gul
Sheeraz Gul avatar Sheeraz Gul avatar

Sheeraz is a Doctorate fellow in Computer Science at Northwestern Polytechnical University, Xian, China. He has 7 years of Software Development experience in AI, Web, Database, and Desktop technologies. He writes tutorials in Java, PHP, Python, GoLang, R, etc., to help beginners learn the field of Computer Science.

LinkedIn Facebook