Hi all,
Recently I had to update part of the application I'm working so it would use KnowledgeAgent instead of RuleAgent. The later restricts scanned DRL files so that all rules from any given package must be written into only one file), whereas the former does not. Long story made short: an external application will feed my application with generated DRL's and it cannot (aka will not) managed a single monolithic DRL or even regenerate it every now and then.
What happens is that I have to update (re-write?) a less critical part of that code which generates a list of all rules contained within a certain package. It has to print rules' attibutes like name, salience, date-effective and date-expires. On the one hand, the old code imports org.drools.rule.Rule (1), which provides getters for such properties; that Rule class is accessed through a chain of method calls starting at RuleAgent, for example:
agent.getRuleBase().getPackage( /* ... */ ).getRules()[ /* ... */ ].getDateEffective()
agent.getKnowledgeBase().getKnowledgePackage( /* ... */ ).getRules()
String getPackageName
String getName
Collection listMetaAttributes
String getMetaAttribute