I am looking into learning more about Drools, but so far I am having trouble finding a reason to use it in any of my current apps. I am hoping to get some guidance on how it has been used in real enterprise applications.
I guess you looked at the examples and asked why, so do I
Anyway I found this reading helpful Does your project need a rule engine?
I don't know about Drools itself, because an open source rules engine suffers from that open source stigma in the minds of Fortune 500 companies.
But rules engines like ILOG from IBM and Blaze from Fair Isaac are used for problems like rating, underwriting, validation, and fraud detection in the companies that I've worked for.
Drools is awesome of course I am speaking of someone that has used it for actual products. At one company, we used it for giving site members (video game websites) rewards for various achievements. At my current company we are looking at using it for implementing some case based reasoning algorithms.
The net of it is that Drools is an awesome tool for implementing 'if then else' style logic that is subject to change. For example, on those gaming sites, the product managers would regularly change reward level and achievement requirements. Instead of having to perform a code change or support some ridiculous configuration, Drools allows you to implement them as rules. In the simplest case, these would be stateless rules however if your users need to maintain state (like a level) then you can use stateful rules. Furthermore, Drools has a visual interface which allows non-technical types (which most product managers are) to maintain the rule set themselves. You only need to worry about loading the drl file.
The other huge bonus to Drools is that is it very fast. It uses the Reets algorithm which in layman's terms mean it performs pattern matching over a rule set rather than evaluating each one as a declarative programming language would.
It is crazy fast and allows you to double couple the rule logic from the code and lets non-engineers maintain it.
I am currently working on an enterprise integration project that uses drools to do message transformation and enrichment (electronic trading messages). The business users add rules through Guvnor that tranform system specific messages to a canonical message form. When the canonical message reaches an endpoint the business users can enter rules to transform the canonical back into a system specific message.
Message filtering is also controlled through drools. This makes it very easy for business users to exclude or include certain types of messages without having to get developers involved.
If you take in EDI files as data, and need to validate that the files are valid, Drools is awesome. The files are huge, the rules can change, and your basic code doesn't have to.
You don't have massively nested if/ifelse/else statements, and because it optimizes it's comparisons, it also runs faster than if/ifelse/else statements would have.
Used Drools in conjunction with JBoss JBPM. Drools was used to decide upon the workflow definition to be executed by JBPM based on given ACTION. This helped customizing our business logic a lot. Thus, a simple change in rule would in effect give us power to change a business logic easily.
Another use case is where there are multiple actions associated with given event. Drools can help not only in choosing appropriate actions for given event also in prioritizing it.
I used Drools to implement a 'decision service' in a SOA architecture, to validate incoming 'orders' for an ISP. See: