Top Banner
Rules with Drools Gaurav Kohli Saket Vishal
22

Rules with Drools

Dec 04, 2014

Download

Technology

Gaurav Kohli

Presentation which we gave at OSS Camp 2009 - NSIT Delhi
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Rules with Drools

Rules with Drools

Gaurav KohliSaket Vishal

Page 2: Rules with Drools

Recognize this?

3.1732

Page 3: Rules with Drools

What about this?

Akshay Kumar,32, Chandini Chowk,

Delhi, 110006

Page 4: Rules with Drools

Lets talk about

Akshay Kumar

Page 5: Rules with Drools

Some rules on names

• First Name + Last Name• First Name + First Name + Last Name• (First Name)+ + Last Name

• First Name + First Name– Saket Vishal

Page 6: Rules with Drools

Implementing these rules in Java

Page 7: Rules with Drools

Demo

Page 8: Rules with Drools

Problems in implementing with Java

• Frequent changes to rules(conditions)• Lack of centralization of rules– Difficult to analyse and manage

• Non technical people(Business Analysts ..) can't create/update rules

• Performance

Page 9: Rules with Drools

Introducing Drools

Basically, a rule engine

Rule Engine: Platform that provides functionality to manage rules

Rule: An if else condition (Business Logic)

Page 10: Rules with Drools

Rules in Drools

Page 11: Rules with Drools

Demo

Page 12: Rules with Drools

The Big Picture

Page 13: Rules with Drools

Back to rules in Drools

DSL – Domain Specific Languages– Human readable rules

Page 14: Rules with Drools

Demo

Page 15: Rules with Drools

Behind Drools

• RETE

Page 16: Rules with Drools

Behind Drools

Page 17: Rules with Drools

If your business logic is well defined/static and doesn't change often, you don't need to change rules at run-time.

If your rules are simple, self-contained, and usually spanning only a single object (for example, a check that user's age is less than 21).

If you have a memory constrained environment.

If your project is a one-shot effort and it will never be used again ormaintained over time.

When not to use Drools

Page 18: Rules with Drools

ILOG (now IBM)—JRules

Fair Isaac—Blaze Advisor

Corticon's BRMS,

Haley (now Oracle) Business Rules Engine

Pegasystems—PegaRules,

Production Systems Technologies—OPSJ

CLIPS

OpenRules or Jess

Alternatives to Drools

Page 19: Rules with Drools

Advanced Drools

• Drools Flow – Loan approval

• Drools Fusion– Fraud detection

• Drools Guvnor– BRMS

Page 20: Rules with Drools

?

Page 21: Rules with Drools

References

• Drools• http://www.jboss.org/drools• Drools JBoss Rules 5.0 Developer's Guide

• RETE• http://en.wikipedia.org/wiki/Rete_algorithm

Page 22: Rules with Drools

Thank You!