One of the challenges of using a business rule engine (BRE) is the disconnect between the actual application code base and the source implementation of rules as resources of the application. The difficulty of debugging business rules is an issue in such instances, but this is no longer the case!
In a recent release (v5.3), we have introduced a new capability that removes this barrier and makes it easy for developers to see the actual linking and debug the rules in a more efficient way.
How it Works
When you install FlexRule Runtime in the samples folder, there is a project named “Airline Discount Program”, for which we posted a blog here.
In this example, there is a validation rule that makes sure input data coming from the user is in a valid state. This rule looks like the one in the picture below:
As you can see, on line 6 of the rule we added an attribute called debug=”true”. This acts like a break point. When you execute the rule, it will be paused at this point in your debugger (i.e., Visual Studio) as shown in the picture below:
You can see all the internal states of the rules by putting FlexRule.Diagnostics.Debugger.Current into your watch window.
You can even see the exact line number (6,6) which corresponds to the line into which you put the debug attribute.
It’s as simple as that!
For more information please refer to http://wiki.flexrule.com/index.php?title=Runtime:Debugging