What basically is Drools..
Drools is an Object-Oriented Rule Engine for Java.
Its a rule based management framework, which takes care of giving you the output based on the condition you feed. simple right..
eg.,
Rule 1:
if you like this blog ?
read through
Rule 2:
if you dont like it?
you can Google drools :)
Basically what happens is like we give the input as
set of rules and
set of data
to the Drools engine. The Drools engine executes the rule (if.. then.. else) and gives the output as
Data Objects.
Rule is basically has a condition, if it becomes true, it initiates some actions.
Ok now lets write a bit technically valid rule and here it comes
rule "checkAmount"
when
$accountNumber : Account( money < 1000 )
then
AccountHolder.message($account.money);
end
Once the User has his balance less than 1000 bucks.. we are sending him an message.
Advantages of Drools are
- they are flexible
- reusable
- easy to understand language unlike procedural languages.
http://www.drools.org/
will give the required jars and documentation.
Overall flow:
Facts : Data to be processed
Fact model : the model / pojo class written in java
Rule Engine : applies the rules from .drl files / excel sheet into the facts and gives the output.

No comments:
Post a Comment