For execution path tracking, we need to log which rule was fired in a decision table. Does Blaze provide API's to track fired rules in decsion tables?
Decision Table is a Tabular representation of the rules. It isn't used for logging purpose. Could you please elaborate on what you are trying achieve here.
Execution path tracking (tracking/logging fired rules) is achieved using Log4J or custom logging mechanism either to - a log file, a DB table or other persistant layers.
Thanks & Regards,
Thanks Sandesh for your reply.
Most of our business startegies are represented in tables (up to 1000 rows/rules). Business asked us to prepare test cases that must cover all rules in the table. In other words, they want to make sure we have test cases in such a way that each rule in the table is fired and a log should be created with each rule's inputs and outputs for verification of correctness.
As you know, rules SRL in a table's instance is read only and we can't insert logging code into them.
Hope this gives you better idea.
Thanks for your help.
The initial creation of the decision table generates just a bunch of templates. Those templates can indeed be modified to contain your logging code. And/or do a lot a other things you may need to do.
Let's forget about logging. It's a secondary thing. The primary thing is to get which rule in the table was fired. This is a runtime issue. How to know which rule was fired?
You could have the user enter a code per rule/row, for rules you could use the name if you wanted to or have them enter a code. You just need a provider for them to do this.
Once you have that data then in the action you can take this code and call a backend class and save it to the database tied to the application/transaction number or whatever is representing the rule session uniquely. another thing you can do is put all the codes into an array or object array if you want more data and return the array of rules that fired to the invoking rules call.
As Spar mentioned, thats fairly simple and easy approach. "Code" can also be analogy to name of the rule, which is the need of the hour for you.
On the other hand, slighly (?) complex solution could involve writing a custom provider to read the rule name from backend generate ruleset (from the decision table instance). Provider would return the rule name in which it is executed. Custom provider could reside in one of the action column (preferably the one which is not 'optional') and returned value can be pursued accordingly. This may save some addition typing efforts from the users' at the cost of some development efforts (one time though!).
With Blaze Advisor 7.1 version (java), decision table has options to 'Enable Rule Tracing' and 'Enable editing of rule id'. Hope this would help you in achieving the goal.
Thanks & Regards
Retrieving data ...