Search in sources :

Example 1 with DecisionTableConfigurationImpl

use of org.drools.core.builder.conf.impl.DecisionTableConfigurationImpl in project drools by kiegroup.

the class MultipleSheetsLoadingTest method createXLSResourceConfig.

private ResourceConfiguration createXLSResourceConfig(final String worksheetName) {
    final DecisionTableConfiguration resourceConfig = new DecisionTableConfigurationImpl();
    resourceConfig.setInputType(DecisionTableInputType.XLS);
    resourceConfig.setWorksheetName(worksheetName);
    return resourceConfig;
}
Also used : DecisionTableConfiguration(org.kie.internal.builder.DecisionTableConfiguration) DecisionTableConfigurationImpl(org.drools.core.builder.conf.impl.DecisionTableConfigurationImpl)

Example 2 with DecisionTableConfigurationImpl

use of org.drools.core.builder.conf.impl.DecisionTableConfigurationImpl in project drools by kiegroup.

the class ResourceUtil method getDecisionTableResourceFromClasspath.

public static Resource getDecisionTableResourceFromClasspath(final String resourceName, final Class classLoaderFromClass, final DecisionTableInputType type) {
    final Resource dtable = KieServices.Factory.get().getResources().newClassPathResource(resourceName, classLoaderFromClass);
    final DecisionTableConfiguration resourceConfig = new DecisionTableConfigurationImpl();
    resourceConfig.setInputType(type);
    dtable.setConfiguration(resourceConfig);
    return dtable;
}
Also used : DecisionTableConfiguration(org.kie.internal.builder.DecisionTableConfiguration) Resource(org.kie.api.io.Resource) DecisionTableConfigurationImpl(org.drools.core.builder.conf.impl.DecisionTableConfigurationImpl)

Example 3 with DecisionTableConfigurationImpl

use of org.drools.core.builder.conf.impl.DecisionTableConfigurationImpl in project drools by kiegroup.

the class DecisionTableConfigurationHandler method start.

public Object start(String uri, String localName, Attributes attrs, ExtensibleXmlParser parser) throws SAXException {
    parser.startElementBuilder(localName, attrs);
    String type = attrs.getValue("input-type");
    String worksheetName = attrs.getValue("worksheet-name");
    emptyAttributeCheck(localName, "input-type", type, parser);
    DecisionTableConfiguration dtConf = new DecisionTableConfigurationImpl();
    dtConf.setInputType(DecisionTableInputType.valueOf(type));
    if (!StringUtils.isEmpty(worksheetName)) {
        dtConf.setWorksheetName(worksheetName);
    }
    return dtConf;
}
Also used : DecisionTableConfiguration(org.kie.internal.builder.DecisionTableConfiguration) DecisionTableConfigurationImpl(org.drools.core.builder.conf.impl.DecisionTableConfigurationImpl)

Aggregations

DecisionTableConfigurationImpl (org.drools.core.builder.conf.impl.DecisionTableConfigurationImpl)3 DecisionTableConfiguration (org.kie.internal.builder.DecisionTableConfiguration)3 Resource (org.kie.api.io.Resource)1