Geoffrey De Smet Why do I need the Guvnor BRMS?
Guvnor agenda Use cases
My business requires domain expertise
My business rules change often
Auditable and reproducible
Future improvements
Use cases I have hammer, so every problem is a nail?
The myth Because Drools can fulfil business rules
Drools is  Turing complete we should write the entire business layer in Drools? No!
Not imperative like Java, Scala, Groovy, ...
Declarative like RegEx, SQL, JPA-QL, … Easier to read, better at scaling Extract business decisions in Drools that either: Require schooled  domain expertise
Change often/fast
Use cases Financial decisions Mortgages acceptance and interest calculation
Insurances acceptance and fee calculation Price calculations Phone/Telecom bills Diagnostics Possible diseases based on symptoms Complex validation Car parts selection Not a good use case: an XML parser Use Java code for that
Mortgages example
Developers don't like data input from spreadsheets Before App 1.0: Mortgages rules in a spreadsheet Which version/copy of the spreadsheet file?
Which field has the result our application need? Version 1 Version 2
Mortgage experts like the flexibility of spreadsheets Since App 1.0: Mortgages rules in source code Changing business rules not flexible enough Business rules are  hard coded in Java Invalid: must be a number Flooded with new improvement requests: when income below 500
when income below 1000 and age above 50
when income below 1% of mortgage amount
Data model in Guvnor Import POJO jar
or  Design the model in Guvnor:
Mortgage  experts like the flexibility of Guvnor App 2.0: Mortgage rules in Guvnor repository Flexible like spreadsheet But fields clearly defined No spreadsheet versions/copies Auditable
My business requires domain expertise Only mortgage managers understand mortgage rules
Schooled domain expertise Are we, the developers, domain experts? Yes, we've been working in this company for year(s). Do we have university's degree in economics? No
participated in mortgages conferences/courses? No
years of mortgage customer experience? No Do we have a clue when the mortgage rules need to change? No
Are we, the developers, domain experts?  No Mortgage manager is the domain expert
Domain experts can not read/write Java source code Communication problem Domain expert can not read it: for  (Mortgage m :  mortgages ) { for  (Applicant a : m.getApplicants()) { if  (a.getAge() >  70 ) { boolean  existsGuarantor =  false ; for  (Guarantor g : m.getGuarantors() { if  (g.getAge <  60 ) { existsGuarantor =  true ; } } // Will they spot the bug in this code? if  (existsGuarantor) { m.setApproved( false ); } } } } DRL scales better than this Java code
Domain experts can read/write DRL with Guided Rule Editor Change

2011-03-29 London - Why do I need the guvnor BRMS?