Rulette : A pragmatic business rule management library
Apr. 21, 2019•0 likes
0 likes
Be the first to like this
Show More
•547 views
views
Total views
0
On Slideshare
0
From embeds
0
Number of embeds
0
Download to read offline
Report
Software
This talk was given at the first Grofers tech meet up in Bangalore on 20 April, 2019. I talk about the whys of Rulette and use some case studies to demonstrate how Rulette can be used effectively to model and apply business rules.
Jargon
Rule : IF order status=”cancelled” AND refunded=”false”, THEN
action=”doRefund”.
Rule Input : “order status”, “refunded” in the above example.
Rule Output : “action” in the above example.
Jargon
Rule : Mapping of “n” rule inputs to 1 output
Rule System : System with ability to manage rules and evaluate them against an input.
Problems with Drools
1. Cognitive Modelling Mismatch
2. Too much flexibility at the cost of expression
3. No data types
4. How to handle “Any”/”Others”?
5. Large set-up
Enter Rulette...
1. Talks the same language as your business
2. Works out-of-the-box
3. Rule management and evaluation
4. Lightweight with minimal boilerplate
5. Completely extensible with custom data types and data sources
When not to use Rulette
1. Rules go beyond “equals”, “less than”, and “greater than”.
2. The output logic is complicated - genuine ad-hocness.
3. Maintaining a set-up is not a problem.
Rulette : Core Entities
Rule System
a. Id
b. Name
c. Table name
d. Output column name
e. Input column name
Rulette : Core Entities
Rule Input
a. Rule system id
b. Name
c. Rule Input Type
d. Rule Input Data Type
e. Priority
f. Low threshold column name
g. High Threshold column name
Rulette : Consistency Semantics
1. Rule Input Data Types : Number, Date, String
2. Rule Input Input Types : Value, Range
3. Value inputs can’t all be equal for 2 rules.
4. Ranges can’t overlap partially, one should completely contain another
5. Output : Always String, interpret however you want