Fast Rules Diagnostics and Root Cause Analysis with the New Rule Trace Viewer

Fast Rules Diagnostics and Root Cause Analysis with the New Rule Trace Viewer

Posted on May 18, 2022 0 Comments
Fast Rules Diagnostics and Root Cause Analysis with the New Rule Trace Viewer_1200x620

Learn how to quickly diagnose rules problems with Corticon rule trace viewer.

Recently, I was working with a customer on a very complex rule project. In a very specific case, the decision service was returning the correct result data except for one attribute we didn’t expect. We were having a hard time understanding why.

We imported the project in the latest release of Corticon and ran the rule trace viewer and immediately saw which rulesheet and specific rule was setting the unexpected attribute. From there it was immediately obvious what was wrong. The rule trace viewer had saved us many hours of work, difficult troubleshooting and headache.

In the rest of this blog, you will see what the rule trace viewer is and how we leveraged it to solve a complex problem and find the root cause of the problem in just minutes.

What is the Corticon Rule Trace Viewer?

The rule trace is a new function in Corticon studio that you can access when running rule tests. Essentially, you can run rules tests with rule tracing enabled.

You simply use the button highlighted below:

 

Running with rule trace

When you run your tests with rule tracing enabled you get an additional view indicating which elements were changed, what was the value before and after any rules changed any attributes. You can sort any columns to quickly focus on specific areas.

Here is an example of the rule trace view and its content.

Example rule trace view

This is all very nice, but the key feature is to be able to double click on any attribute changes (any row) to find the root cause, that is the exact rule that changed the attribute. This is what enabled us to troubleshoot our problem in no time.

Troubleshooting Issues

Now let’s look at how we solved a complex problem. The issue was that a specific attribute (UI.done) was set to true in the result payload. The problem was hard to find as there are 15 ruleflows (including subflows) and more than 60 rulesheets. We didn’t want to browse through all of them to discover which one was potentially setting the attribute and guess which ones were executing in the path with the issue.

We simply did this:

  1. We ran the full ruleflow with rule trace.
  2. We sorted the rule trace view by the column Element. This allowed us to quickly find the row where UI.done was set. In our case, there was only one location where the flag was set, as outlined below (Row sequence 7).

     

    location identified

  3. We double clicked on that row. Corticon studio brought up the culprit rulesheet in the rulesheet editor. Thus, we immediately had the rulesheet name as well as the exact rule action that resulted in this attribute being set.

     

    Root cause issue found

Now in our case, it was simple to discover that this rulesheet was executing because we had set a filter incorrectly. So, it was not that the rule at line F was wrong, it was simply that the entire rulesheet should not have executed. We fixed the filter to execute this rulesheet on the proper stage value.

All in all, it only took a few minutes to understand what the issue was and fix it.

Conclusion

Give it a spin; we are confident you will find it very useful not only for troubleshooting issues as described in this blog, but also when creating and maintaining your rules.

This capability is available in all the latest releases of Corticon (V6.3 or greater) and Corticon.js (V1.4 and greater).

Try Corticon, Corticon.js Now

Thierry Ciot

Thierry Ciot

Thierry Ciot is a Software Architect on the Corticon Business Rule Management System. Ciot has gained broad experience in the development of products ranging from development tools to production monitoring systems. He is now focusing on bringing Business Rule Management to Javascript and in particular to the serverless world where Corticon will shine. He holds two patents in the memory management space.

Comments

Comments are disabled in preview mode.
Topics

Sitefinity Training and Certification Now Available.

Let our experts teach you how to use Sitefinity's best-in-class features to deliver compelling digital experiences.

Learn More
Latest Stories
in Your Inbox

Subscribe to get all the news, info and tutorials you need to build better business apps and sites

Loading animation