Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

PMML : Initial separation of Informer from main PMML module

  • Loading branch information...
commit 98a02b2559cd984d04f094dfbabae441d3770e6f 1 parent 317b57f
@sotty sotty authored
Showing with 17 additions and 4 deletions.
  1. 0  ... → drools-informer/drools-informer-pmml}/src/main/resources/org/drools/pmml/pmml_4_1/pmml_informer.drl
  2. 0  .../drools-informer-pmml}/src/main/resources/org/drools/pmml/pmml_4_1/templates/informer/informer_imports.drlt
  3. 0  ...-pmml}/src/main/resources/org/drools/pmml/pmml_4_1/templates/informer/modelAddQuestionsToQuestionnaire.drlt
  4. 0  ...ols-informer-pmml}/src/main/resources/org/drools/pmml/pmml_4_1/templates/informer/modelCreateByBinding.drlt
  5. 0  ...rools-informer-pmml}/src/main/resources/org/drools/pmml/pmml_4_1/templates/informer/modelInvalidAnswer.drlt
  6. 0  ...rools-informer-pmml}/src/main/resources/org/drools/pmml/pmml_4_1/templates/informer/modelMultiQuestion.drlt
  7. 0  ...rools-informer-pmml}/src/main/resources/org/drools/pmml/pmml_4_1/templates/informer/modelOutputBinding.drlt
  8. 0  ...mer/drools-informer-pmml}/src/main/resources/org/drools/pmml/pmml_4_1/templates/informer/modelQuestion.drlt
  9. 0  ...ols-informer-pmml}/src/main/resources/org/drools/pmml/pmml_4_1/templates/informer/modelQuestionBinding.drlt
  10. 0  ...s-informer-pmml}/src/main/resources/org/drools/pmml/pmml_4_1/templates/informer/modelQuestionRebinding.drlt
  11. 0  ...rools-informer-pmml}/src/main/resources/org/drools/pmml/pmml_4_1/templates/informer/modelQuestionnaire.drlt
  12. 0  ...r/drools-informer-pmml}/src/main/resources/org/drools/pmml/pmml_4_1/templates/informer/modelRevalidate.drlt
  13. +1 −0  drools-informer/pom.xml
  14. +7 −0 drools-pmml/pom.xml
  15. +9 −4 drools-pmml/src/main/java/org/drools/pmml/pmml_4_1/PMML4Compiler.java
View
0  ...ources/org/drools/pmml/pmml_4_1/pmml_informer.drl → ...ources/org/drools/pmml/pmml_4_1/pmml_informer.drl
File renamed without changes
View
0  ...pmml_4_1/templates/informer/informer_imports.drlt → ...pmml_4_1/templates/informer/informer_imports.drlt
File renamed without changes
View
0  ...es/informer/modelAddQuestionsToQuestionnaire.drlt → ...es/informer/modelAddQuestionsToQuestionnaire.drlt
File renamed without changes
View
0  ..._4_1/templates/informer/modelCreateByBinding.drlt → ..._4_1/templates/informer/modelCreateByBinding.drlt
File renamed without changes
View
0  ...ml_4_1/templates/informer/modelInvalidAnswer.drlt → ...ml_4_1/templates/informer/modelInvalidAnswer.drlt
File renamed without changes
View
0  ...ml_4_1/templates/informer/modelMultiQuestion.drlt → ...ml_4_1/templates/informer/modelMultiQuestion.drlt
File renamed without changes
View
0  ...ml_4_1/templates/informer/modelOutputBinding.drlt → ...ml_4_1/templates/informer/modelOutputBinding.drlt
File renamed without changes
View
0  ...ml/pmml_4_1/templates/informer/modelQuestion.drlt → ...ml/pmml_4_1/templates/informer/modelQuestion.drlt
File renamed without changes
View
0  ..._4_1/templates/informer/modelQuestionBinding.drlt → ..._4_1/templates/informer/modelQuestionBinding.drlt
File renamed without changes
View
0  ..._1/templates/informer/modelQuestionRebinding.drlt → ..._1/templates/informer/modelQuestionRebinding.drlt
File renamed without changes
View
0  ...ml_4_1/templates/informer/modelQuestionnaire.drlt → ...ml_4_1/templates/informer/modelQuestionnaire.drlt
File renamed without changes
View
0  .../pmml_4_1/templates/informer/modelRevalidate.drlt → .../pmml_4_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();
}
Please sign in to comment.
Something went wrong with that request. Please try again.