Resource ruleResource = ResourceFactory.newReaderResource((Reader) new StringReader(ruleDRL));
kbuilder.add(ruleResource, ResourceType.DRL);
}
if (kbuilder.hasErrors()) {
KnowledgeBuilderErrors errors = kbuilder.getErrors();
if(errors != null){
for (Iterator<KnowledgeBuilderError> iterator = errors.iterator(); iterator.hasNext();) {
KnowledgeBuilderError knowledgeBuilderError = (KnowledgeBuilderError) iterator.next();
logger.error(knowledgeBuilderError.getMessage());
}
}
throw new RuntimeException("Unable to compile drl");