use of org.kie.api.builder.model.RuleTemplateModel in project drools by kiegroup.
the class AbstractKieModule method addResourceToCompiler.
public final boolean addResourceToCompiler(CompositeKnowledgeBuilder ckbuilder, KieBaseModel kieBaseModel, String fileName, ResourceChangeSet rcs) {
ResourceConfiguration conf = getResourceConfiguration(fileName);
Resource resource = getResource(fileName);
if (resource != null) {
ResourceType resourceType = conf instanceof ResourceConfigurationImpl && ((ResourceConfigurationImpl) conf).getResourceType() != null ? ((ResourceConfigurationImpl) conf).getResourceType() : ResourceType.determineResourceType(fileName);
if (resourceType == ResourceType.DTABLE && conf instanceof DecisionTableConfiguration) {
for (RuleTemplateModel template : kieBaseModel.getRuleTemplates()) {
if (template.getDtable().equals(fileName)) {
Resource templateResource = getResource(template.getTemplate());
if (templateResource != null) {
((DecisionTableConfiguration) conf).addRuleTemplateConfiguration(templateResource, template.getRow(), template.getCol());
}
}
}
}
if (conf == null) {
ckbuilder.add(resource, resourceType, rcs);
} else {
ckbuilder.add(resource, resourceType, conf, rcs);
}
return true;
}
return false;
}
Aggregations