KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
List<RuleRepository> activeRules = ruleRepositoryService.findActiveRuleRepositories();
for (Iterator<RuleRepository> iterator = activeRules.iterator(); iterator.hasNext();) {
RuleRepository ruleRepository = (RuleRepository) iterator.next();
String ruleDRL = ruleRepository.getRuleString().toString();
Resource ruleResource = ResourceFactory.newReaderResource((Reader) new StringReader(ruleDRL));
kbuilder.add(ruleResource, ResourceType.DRL);
}
if (kbuilder.hasErrors()) {