I was able to work around this problem by filtering out the KnowledgePackage
containing my NormalizedEvent. In Drools 5.2.0 there was no problem adding
this KnowledgePackage multiple times but apparently 5.3.0 doesn't cope with
it well. I'm still not sure if that is a feature or a defect in 5.3.0.
In any event doing the following make the exception go away.
I'm still curious if this is a feature or a defect in 5.3.0. Any thoughts
or opinions regarding are welcome.
String globals = readDrlfile("globals.drl");
String newRules = readDrlfile("rulesToAdd.drl");
knowledgeBuilder.add(ResourceFactory.newReaderResource(new
StringReader(globals + newRules)));
if (knowledgeBuilder.hasErrors()) {
throw exception ...
}
// No exception so compile succeeded --- BTW, it's using JANINO
Collection<KnowledgePackage> pkgs =
knowledgeBuilder.getKnowledgePackages();
pkgs=filterOutAnyPackageThatHasNoRulesAndNameMatchingNormalizeEventPackageName(pkgs);
knowledgeBase.addKnowledgePackages(pkgs); // NO ERROR ANYMORE
--
View this message in context:
http://drools.46999.n3.nabble.com/rules-users-5-3-0-Final-throws-RuntimeD...
Sent from the Drools: User forum mailing list archive at
Nabble.com.