We are using drools 5.6.0.Final and the same version of Guvnor. When we run
the source file of a package from Guvnor everything works as expected. When
we take the same rules and create a package we get stuck in an infinite loop
of rules firing(I have a listener logging every time a rule is
created/fired). Why would there be a difference if the rules don't change
between the source and the pkg?
We build the kbase as follows:
KnowledgeBuilderConfiguration config = KnowledgeBuilderFactory
.newKnowledgeBuilderConfiguration();
config.setOption(PropertySpecificOption.ALWAYS);
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory
.newKnowledgeBuilder(config);
for (ResourcePair pair : pairs) {
/* kbuilder.add(
ResourceFactory.newClassPathResource("rule-sets/2014/feb/"+pair.resourceName),
ResourceType.getResourceType(pair.resourceType));*/
kbuilder.add(
ResourceFactory.newClassPathResource(pair.resourceName),
ResourceType.getResourceType(pair.resourceType));
}
KnowledgeBuilderErrors errors = kbuilder.getErrors();
if (errors.size() > 0) {
StringBuilder sb = new StringBuilder();
for (KnowledgeBuilderError error : errors) {
sb.append(error + "\n");
System.out.println(sb);
}
throw new IllegalArgumentException("Could not parse knowledge.
\n"
+ sb);
}
this.knowledgeBase = KnowledgeBaseFactory.newKnowledgeBase();
this.knowledgeBase
.addKnowledgePackages(kbuilder.getKnowledgePackages());
--
View this message in context:
http://drools.46999.n3.nabble.com/Drools-5-6-0-Final-PKG-vs-DRL-infinite-...
Sent from the Drools: User forum mailing list archive at
Nabble.com.