Search code examples
droolsactivitirule-enginebpmn

Activiti and Drools ... is one enough?


I have been asked to start exploring a Activiti tool for some client demo. The demo will also have JBoss Drools with which Activiti will be integrated. I am new to both of these tools and business process world, so excuse me if the question is dumb.

The question is why do you need Drools? Isn't Activiti enough for the job? Both of them have conditional elements so why do you need Activiti on top of drools?


Solution

  • This question doesn't quite fit the purpose of StackOverflow, so don't be surprised if you get a few flags. But I'll try to give a short answer.

    Activity is a workflow engine, Drools is a business rules engine. They serve two different purposes.

    • Workflow engines are useful when you have a flow of actions of different actors that need to be controlled programmatically.

    • Rules engines are useful when you have business rules for executing some task automatically that you want to describe in a declarative way.

    Both purposes are orthogonal to each other, meaning that the problem you have to solve may require none, just one, or both of them.

    Imagine a workflow where a customer reports an incident, some experts have to work on it, and finally a bill gets produced, but no heavy algorithms are behind those tasks. That might be supported by a workflow engine without a rules engine.

    Imagine a complex price model for a product, like cars having all sorts of special features that may be ordered. (Hifi speakers cost 400 €, except if the executive version of the car is ordered, where they only cost 200 € if ordered in combination with smartphone adapter...) Here a rules engine may be useful, although nobody talked about a workflow, so no workflow engine is needed.

    Imagine the first example (incident workflow) together with a complex billing scheme. Here both tools may be used.

    I wonder why these two types of tools are in some places described as perfectly fitting together. (Maybe this kind of claim motivated your question.) They serve two different purposes, and whether you need them both depends on the problem you have to solve.