Search in sources :

Example 6 with PMMLResource

use of org.drools.compiler.compiler.PMMLResource in project drools by kiegroup.

the class PMML4Compiler method precompile.

public List<PMMLResource> precompile(String fileName, ClassLoader classLoader, KieBaseModel rootKieBaseModel) {
    InputStream is = getInputStreamByFileName(fileName);
    List<PMMLResource> resources = null;
    if (is != null) {
        try {
            resources = precompile(is, classLoader, rootKieBaseModel);
        } catch (Exception e) {
            PMMLError err = new PMMLError("Unable to retrieve pre-compiled resources for PMML: " + e.getMessage());
            this.results.add(err);
        }
    }
    return (resources != null) ? resources : Collections.emptyList();
}
Also used : PMMLResource(org.drools.compiler.compiler.PMMLResource) InputStream(java.io.InputStream) JAXBException(javax.xml.bind.JAXBException) SAXException(org.xml.sax.SAXException) UnsupportedEncodingException(java.io.UnsupportedEncodingException) IOException(java.io.IOException)

Aggregations

PMMLResource (org.drools.compiler.compiler.PMMLResource)6 KieBaseModel (org.kie.api.builder.model.KieBaseModel)4 ArrayList (java.util.ArrayList)3 InputStream (java.io.InputStream)2 PMML (org.kie.dmg.pmml.pmml_4_2.descr.PMML)2 IOException (java.io.IOException)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 List (java.util.List)1 Map (java.util.Map)1 JAXBException (javax.xml.bind.JAXBException)1 DrlParser (org.drools.compiler.compiler.DrlParser)1 PMMLCompiler (org.drools.compiler.compiler.PMMLCompiler)1 ParserError (org.drools.compiler.compiler.ParserError)1 CompositePackageDescr (org.drools.compiler.lang.descr.CompositePackageDescr)1 PackageDescr (org.drools.compiler.lang.descr.PackageDescr)1 Ignore (org.junit.Ignore)1 Test (org.junit.Test)1 KieServices (org.kie.api.KieServices)1 KieModuleModel (org.kie.api.builder.model.KieModuleModel)1 KieSessionModel (org.kie.api.builder.model.KieSessionModel)1