Harvesting Rules, The Good and Bad
- December 11, 2017
- 1 Comments
I recently came across a link to a website advertising “The Impossible Jigsaw Puzzle”. The description states “These are not just regular puzzles, but also have a few features that make them both unique and extremely hard to assemble.” Some of the features touted of these puzzles are:
- the box doesn’t have the whole picture
- there are no borders
- no straight edges
- no corners
… and my favorite, “some [puzzles] have 5 extra pieces that don’t fit anywhere.”
Imagine you’re involved in a project automating a decision for calculating credit scores using business rules. Now, maybe this is a newly automated decision, or maybe we’re just re-platforming an existing decision service. At any rate, the requirements have been presented to you as a spreadsheet of hundreds or maybe even thousands of rules that have been “harvested” either from the subject matter experts or maybe from an existing system. You might see rules like:
if the receipt date of a loan payment is more than 10 days after the loan payment due date
then mark the payment as late
if the amount owed on the loan is greater than 0
then add the amount owed on the loan to the total amount owed
if a loan has at least 1 late payment
then the borrower of the loan is delinquent on the loan
All of these rules may be valid. Each tells a little bit about how the credit score is calculated. But by themselves, it would be pretty difficult to implement a decision service from them. What’s missing is context.
How do these rules work together to calculate the overall credit score? Without understanding how the decision is structured, and where each rule fits into that structure, implementing a decision service to determine someone’s credit score is like trying to put together “The impossible Jigsaw Puzzle”. There is no picture to help you understand what the end result should look like, no straight edges or corners to give you a place to start and you’re not entirely sure that you don’t have extra pieces (redundant rules).
The good news is, like “The impossible Jigsaw Puzzle”, piecing together the credit score decision from a list of harvested rules is not really impossible, if you’re given access to additional resources that can provide some hints on what’s really going on. Fortunately for us, we have tools and techniques that help the Decision Architect organize the decision and provide the needed context for this basket of harvested rules.
This is part of a Decision Requirements Diagram (DRD) with a little extra information that shows where each of our rules fits into the overall decision. DRD’s are part of the Decision Modeling Notation (DMN) standard defined by an organization called the Object Modeling Group (OMG).
I know, it’s a lot of alphabet soup. One of the premises behind DMN is that the best way to understand how a complex decision is made first, understanding the relationships between the complex decision and its dependent decisions.
In the above DRD, you can see that a decision, and it’s dependent decisions, are connected with a closed-pointer arrow. Modeling a decision using DMN gives the decision architect a “place to hang” all of the “harvested rules” so that we understand their context in the overall decision. In essence, it give us the picture on the box. Furthermore, depending on how the decision is structured, there may be rules in the harvested set that are redundant. Building a DMN model makes it relatively easy to identify these “extra puzzle pieces”.
Based on our experience, DMN models are the best way to make sense of a decision and provide some structure to how a customer’s basket of harvested rules hang together. It is, of course, easier to “start with the picture on the box” or model your rules first versus harvest them.