use of org.drools.core.builder.conf.impl.ResourceConfigurationImpl in project drools by kiegroup.
the class BaseResource method setResourceType.
public InternalResource setResourceType(ResourceType resourceType) {
this.resourceType = resourceType;
if (this.configuration == null) {
this.configuration = new ResourceConfigurationImpl();
}
this.configuration.setResourceType(resourceType);
return this;
}
use of org.drools.core.builder.conf.impl.ResourceConfigurationImpl 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