Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

Commit

Permalink
PMML : Initial separation of Informer from main PMML module
Browse files Browse the repository at this point in the history
  • Loading branch information
sotty committed Jul 12, 2013
1 parent 317b57f commit 98a02b2
Show file tree
Hide file tree
Showing 15 changed files with 17 additions and 4 deletions.
1 change: 1 addition & 0 deletions drools-informer/pom.xml
Expand Up @@ -38,6 +38,7 @@
<module>drools-informer-core</module>
<module>drools-informer-loader</module>
<module>drools-informer-interaction</module>
<module>drools-informer-pmml</module>
<module>human-task-helpers</module>
</modules>

Expand Down
7 changes: 7 additions & 0 deletions drools-pmml/pom.xml
Expand Up @@ -40,6 +40,13 @@
<groupId>org.drools</groupId>
<artifactId>drools-informer-core</artifactId>
<version>${chance.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-informer-pmml</artifactId>
<version>${chance.version}</version>
<scope>test</scope>
</dependency>

<dependency>
Expand Down
Expand Up @@ -22,6 +22,7 @@
import org.drools.builder.*;
import org.drools.compiler.PackageRegistry;
import org.drools.conf.EventProcessingOption;
import org.drools.io.Resource;
import org.drools.io.ResourceFactory;
import org.drools.runtime.StatefulKnowledgeSession;
import org.mvel2.templates.SimpleTemplateRegistry;
Expand Down Expand Up @@ -449,10 +450,14 @@ private static void checkBuildingResources( PMML pmml ) {
private static void prepareTemplate( String ntempl ) {
try {
String path = TEMPLATE_PATH + ntempl;
InputStream stream = ResourceFactory.newClassPathResource(path, PMML4Compiler.class).getInputStream();

registry.addNamedTemplate( path.substring(path.lastIndexOf('/') + 1),
TemplateCompiler.compileTemplate(stream));
Resource res = ResourceFactory.newClassPathResource(path, PMML4Compiler.class);
if ( res != null ) {
InputStream stream = res.getInputStream();
if ( stream != null ) {
registry.addNamedTemplate( path.substring(path.lastIndexOf('/') + 1),
TemplateCompiler.compileTemplate(stream));
}
}
} catch (IOException e) {
e.printStackTrace();
}
Expand Down

0 comments on commit 98a02b2

Please sign in to comment.