Back to Basics
Let’s go back to basics and explore how business rules work. For that purpose, I am using the unavoidable ‘Hello World’ project. I will show you today that agility can be obtained without a whole lot of complexity… My first-grade son could do it, so it can’t be that hard ;-)
Before I start writing rules, let me take a very quick detour. To make the exercise more concrete, it helps to have test cases so that we can see how the rules apply as we write them.
Prepare a Test Case
I personally find it easier to explain what the decision logic does, or is supposed to do, when I have a concrete example to look at.
For our ‘Hello World’ project, I want to select the proper greetings. My decision logic will be based on names. You could obviously make it a lot more sophisticated based on country of origin or the time of year. But for now, let’s keep it simple.
To test my logic, I will have a test case for World, but I will also create one for Joe, my favorite test subject. I will actually create a few more cases for Jacques and Pedro.

Write the Rule
A business rule is an IF-THEN statement. It could also include an ELSE, but I recommended to avoid it when possible.
Based on a set of conditions (IF…), the business rules engine will apply the appropriate set of actions (THEN…). In our case, if the test case is for “World,” then we want the “Hello World” greeting.

If our system was going to say “Hello” all the time, we would need just one business rule. However, I would like to customize my greetings to say “Hi” to Joe, “Bonjour” to Jacques, and “Vote for” for Pedro. Can you guess what the rules will look like?
Well, that was a trick question! The rules are quite intuitive, I think. However, you might have a preference as to how they are displayed, or how you author them… Which are you more like?
I like data. I understand what it means.

In that case, our patented RedPen™ approach might be the best choice. As you click directly on the fields and their values, the rules are constructed and rendered as stickers showing the condition (in orange) or action (in blue). You just have to click on the sticker to change it.
In this project, I used RedPen™ to create these rules. In fact, RedPen™ is my default choice when I have data!
I like syntax. I understand what it does.

If you know your rules, you may as well just type them in. That is typically the preference of technically-savvy users. They can type faster than they operate the mouse! And Intellisense is always there to help too.
I like decision tables. I understand what must happen for each case.

If you use spreadsheets a lot, you might opt for a decision table. It is quite nice I must say when all the rules are very regular, meaning that they look at the same set of conditions with different values. It helps validate visually that the rules have been captured exhaustively.
I like decision trees. I understand what must happen for each segment.

If you think in terms of population segments, and treatment for that segment, a decision tree would allow you to conceptually visualize the assignments in a concise way. They look nice and symmetrical when the rules are regular. They are even more powerful when each path is looking at a different set of attributes!
I like decision graphs. I understand how we got to a conclusion.

If you are more concerned about the different ways that lead to a conclusion, you might prefer decision graphs. They are not very powerful here because there is only one way to reach each action, but think about an adverse action (decline for example), you might be required by law to audit the different ways you reach that conclusion. Decision graphs are very powerful then!
Learn more about Decision management and Sparkling Logic’s SMARTS™ Data-Powered Decision Manager

