我创建了一个kieBase,但我没有在其中找到任何kiePackage。 Syso语句打印一个空列表。
kFile.write("D:/Test Rule/simple.drl",kieService.getResources().newReaderResource( new StringReader(new String(drlRuleData)) ));
kiebuilder = kieService.newKieBuilder(kFile).buildAll();
if (kiebuilder.getResults().hasMessages(Message.Level.ERROR)) {
logger.error("kiebuilder has errors", kiebuilder.getResults().getMessages(Message.Level.ERROR));
throw new CEHServiceException("Errors in drl file for Alert Classification",
kiebuilder.getResults().getMessages(Message.Level.ERROR).toString());
}
kieContainer = kieService.newKieContainer(kbuilder.getKieModule().getReleaseId());
kieBase= kContainer.getKieBase();
System.out.println("The packages are : "+kbaseAcknowledgement.getKiePackages().toString());