It's a good idea to start thinking of the rules in Guvnor as source code, just the same as the rest of the application. Every time a rule is saved in Guvnor, a version is created automatically. You don't need business users to do any special tasks for this. Given that source code doesn't change every time you make a call to it, there's no benefit to logging the source code on every call. And there's definitely a level of performance degradation if you do.
If you want to automate reconciling rule activations against the rules, then I would recommend setting up a process to store a snapshot of the knowledge base source being used, when the knowledge base is built or updated. It could use the REST interface to download the source. That way, if you have logged the names of rules which have activated and the time at which they activated, then you could build an automated reconciliation tool to quickly show what the source of a rule was at the time it was called.
And I would emphasise that you need the source of all packages used to build the knowledge base, not just the source of the activated rule. Very often (in my experience, most of the time) you need to know why a specific rule *didn't* activate. As you build up the knowledge base, you will find that it's very rare for a single rule to be responsible for a decision. It's not unusual for there to be hundreds of rule activations for every call to a decision service. In fact, you may find that just logging activation names has a significant impact on your application's performance, even if you do use async logging, and your log files may reach multiple gigabytes in hours.
You have been warned! ;)
Steve
Not the actual source code, but as Java developers, we do log some precise information in term of what is happening. When it comes to rules, especially the rules built using Guvnor, we do not want the rule author (business users) to manually add these "logs" as they are not technical staff. This is why there is a need to build these log information automatically by accessing "rule LHS" through API.
Visiting rules and their histories after the rule name has been logged is always an option for this process. However it takes time and manual process.
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users