Write Business Rules — Author, Test, Repeat

on August 5, 2024
Write Business Rules with SMARTS™ RedPen

Write Business Rules Without Writing

In our previous Authoring Business Rules 101 post, we covered diagramming your knockout rules through a decision flow. This is a continuation our series covering key takeaways from our presentation at BBC 2024. You can view the full “Authoring Business Rules 101” recording here. With a decision flow in place, you’re ready to move forward with the next step, writing business rules. However, if your project has over 18k rules, we don’t recommend writing all of them by hand. We’ll go over a few tips, leveraging the tools within SMARTS™ Data-Powered Decision Manager.

Transforming Requirements into IF-THEN Statements

First of all, your requirements may not be written in IF-THEN statements. For example, you may have a requirement like “Insurance policies cannot be issued in Hawaii.” In order to write an executable business rule, you need to write it in an IF-THEN statement. In addition, you need to reference the appropriate data fields and elements in the correct format. This is where leveraging SMARTS™ comes in handy. As mentioned in the previous post, SMARTS™ allows you to author rules in context of data. Therefore you can reference actual data as you’re writing rules.

In addition, SMARTS™ RedPen™ point-and-click rules authoring tool enables you to click on the data fields and elements to “write” your rules. Below is an example, where the left column represents the data fields (State, Status, Reason), the middle column represents the data elements in a record (HI, Declined, State is not eligible), and the right column represents the rules (==”HI”, =”Declined”, =”State is not eligible”). Through point-and-click, you’ve essentially transformed the original requirement to IF State = HI, THEN Status = Declined AND Reason = State is not eligible.
RedPen Example - Hawaii Knockout Rule

Test Before You Move to the Next Rule

Before you write your next business rule, we recommend testing the rule you just wrote. As mentioned in the previous post, SMARTS™ allows you to test rules on the same data your referenced when authoring your rules. SMARTS™ enables you to test and view results both at an individual record and aggregate level. By following an author, test, repeat cycle, you’ll catch errors more easily and make final QA a breeze.

Transforming Spreadsheets into Executable Rules

Now if any of your requirements already exist in spreadsheet form, such as a rate table or price table, you can leverage SMARTS™ Lookup Models to transform that table into executable rules. This is where the bulk of our 18k rules is coming from. Rather than coding each rule by hand, simply upload the spreadsheet, and establish the mapping (map State in the spreadsheet to State in the form structure). See below for an example. A Lookup Model acts like a VLOOKUP or INDEX + MATCH in Excel, pulling the information from the spreadsheet according to the mapping. Not only do Lookup Models save time, they also ensure that what’s in execution matches what is being managed. You don’t have to worry about lost-in-translation errors.
Lookup Model Example - Rating Table

Now if you are using a different platform than SMARTS™ or you just happen to love writing business rules by hand, learn more about our best practices on how to write business rules. For a brief overview of different ways you can write rules in SMARTS™, read our “Hello World” rule post.

Continue to our next post, Measure Business Performance Before Your Launch.

Search Posts by Category

ABOUT US

Sparkling Logic Inc. is a Silicon Valley-based company dedicated to helping organizations automate and optimize key decisions in daily business operations and customer interactions in a low-code, no-code environment. Our core product, SMARTS™ Data-Powered Decision Manager, is an all-in-one decision management platform designed for business analysts to quickly automate and continuously optimize complex operational decisions. Learn more by requesting a live demo or free trial today.