my spreadsheet contains 3780 records. which create the same no of rules
during runtime.
the control just get hung in the line
"knowledgeBase.addKnowledgePackages(knowledgeBuilder
.getKnowledgePackages());"
CODE SNIPPET
----------------------
public KnowledgeBase buildKnowledgeBaseFromSpreadsheet(String spreadSheet,
String ruleTemplate, int rowNo, int colNo) {
KnowledgeBuilder knowledgeBuilder = KnowledgeBuilderFactory
.newKnowledgeBuilder();
KnowledgeBase knowledgeBase = KnowledgeBaseFactory.newKnowledgeBase();
String drl = externalSpreadsheetCompiler.compile(spreadSheetStream,
ruleTemplateStream, 0, 0);
knowledgeBuilder.add(new ByteArrayResource(drl.getBytes()),
ResourceType.DRL);
validateKnowledgeBuilder(knowledgeBuilder);
// code which get hung
*knowledgeBase.addKnowledgePackages(knowledgeBuilder
.getKnowledgePackages());*
return knowledgeBase;
}
public void validateKnowledgeBuilder(KnowledgeBuilder knowledgeBuilder) {
if (knowledgeBuilder.hasErrors()) {
System.out.println("Error compiling resources:");
for (KnowledgeBuilderError error : knowledgeBuilder.getErrors()) {
System.err.println(error.toString());
}
throw new IllegalStateException("Error compiling resources");
}
}
-----
Thanks...
Himansu
--
View this message in context:
http://drools.46999.n3.nabble.com/knowledgeBase-addKnowledgePackages-api-...
Sent from the Drools: User forum mailing list archive at
Nabble.com.