Browse files

PMML : Initial separation of Informer from main PMML module

  • Loading branch information...
1 parent 317b57f commit 98a02b2559cd984d04f094dfbabae441d3770e6f @sotty sotty committed Jul 11, 2013
View
0 ...rg/drools/pmml/pmml_4_1/pmml_informer.drl → ...rg/drools/pmml/pmml_4_1/pmml_informer.drl
File renamed without changes.
View
0 .../templates/informer/informer_imports.drlt → .../templates/informer/informer_imports.drlt
File renamed without changes.
View
0 ...mer/modelAddQuestionsToQuestionnaire.drlt → ...mer/modelAddQuestionsToQuestionnaire.drlt
File renamed without changes.
View
0 ...plates/informer/modelCreateByBinding.drlt → ...plates/informer/modelCreateByBinding.drlt
File renamed without changes.
View
0 ...emplates/informer/modelInvalidAnswer.drlt → ...emplates/informer/modelInvalidAnswer.drlt
File renamed without changes.
View
0 ...emplates/informer/modelMultiQuestion.drlt → ...emplates/informer/modelMultiQuestion.drlt
File renamed without changes.
View
0 ...emplates/informer/modelOutputBinding.drlt → ...emplates/informer/modelOutputBinding.drlt
File renamed without changes.
View
0 ...4_1/templates/informer/modelQuestion.drlt → ...4_1/templates/informer/modelQuestion.drlt
File renamed without changes.
View
0 ...plates/informer/modelQuestionBinding.drlt → ...plates/informer/modelQuestionBinding.drlt
File renamed without changes.
View
0 ...ates/informer/modelQuestionRebinding.drlt → ...ates/informer/modelQuestionRebinding.drlt
File renamed without changes.
View
0 ...emplates/informer/modelQuestionnaire.drlt → ...emplates/informer/modelQuestionnaire.drlt
File renamed without changes.
View
0 ...1/templates/informer/modelRevalidate.drlt → ...1/templates/informer/modelRevalidate.drlt
File renamed without changes.
View
1 drools-informer/pom.xml
@@ -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>
View
7 drools-pmml/pom.xml
@@ -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>
View
13 drools-pmml/src/main/java/org/drools/pmml/pmml_4_1/PMML4Compiler.java
@@ -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;
@@ -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();
}

0 comments on commit 98a02b2

Please sign in to comment.