Business Rules Debugger to Survive
An advanced business rules debugger lets you to inspect, find and change values at runtime. It also enables you to write expressions and evaluate them during rules execution.
We previously discussed how to debug your business rules using Visual Studio. But if you’ve written your business rules properly and have taken advantage of the declarative approach, you should not be debugging business rules in Visual Studio in the first place! So you need a set of tools to debug your business rules, simulate the execution and evaluate expressions in the context of the current execution.
When you put your business logic (i.e., rules, decisions, flows, etc.) into a debug state using a debugger, it means you have access to the current execution context. Let’s say in a complex business decision (e.g. calculating premium for car insurance), you have the following Decision Table as part of a bigger decision model:
As you can see in the above picture, the green lines are the ones that the business rules consequences (actions) are executing. The yellow lines are the ones that the conditions have yet to evaluate, and when/if their criteria are satisfied then their actions will be executed.
Now let’s say you want to see what the values are of the car involved in this decision? Or what are all the Parameters in the execution context that led to this behaviour in this decision table?
There is a pane in your business rule debugger called Parameters Window. This window shows you all the Parameters in an execution context.
The Parameter window is a read only window and loads all the values in the current execution context in a tree, so you can simply expand the nodes of the tree and drill down to the details of any values in the current execution context.
Last updated July 9th, 2020 at 09:09 am, Published July 20th, 2016 at 09:09 am