Permalink
Browse files

PMML : Initial separation of informer from main PMML module

  • Loading branch information...
1 parent 2eabf90 commit 9672dcb2235e7edcde746d858c76ff64498457db @sotty sotty committed Aug 7, 2013
Showing with 8 additions and 5 deletions.
  1. +8 −5 drools-pmml/src/main/java/org/drools/pmml/pmml_4_1/PMML4Compiler.java
@@ -36,6 +36,7 @@
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import java.io.*;
+import java.net.URISyntaxException;
import java.util.*;
import org.dmg.pmml.pmml_4_1.descr.*;
@@ -47,8 +48,6 @@
public static final String BASE_PACK = PMML4Compiler.class.getPackage().getName().replace('.','/');
-
-
public static final String VISITOR_RULES = BASE_PACK + "/pmml_visitor.drl";
public static boolean visitorRules = false;
@@ -266,9 +265,13 @@ private static void initVisitor() throws IOException {
compilerRules = true;
}
if ( informerRules == false ) {
- Resource res = ResourceFactory.newClassPathResource( INFORMER_RULES );
- if ( res != null && new File( (( ClassPathResource) res).getPath() ).exists() ) {
- kBuilder.add( res, ResourceType.DRL );
+ Resource res = ResourceFactory.newClassPathResource( INFORMER_RULES, PMML4Compiler.class );
+ try {
+ if ( res != null && new File( (( ClassPathResource) res).getURL().toURI() ).exists() ) {
+ kBuilder.add( res, ResourceType.DRL );
+ }
+ } catch ( URISyntaxException e ) {
+ throw new IOException( "Unable to check for informer rules " + e.getMessage() );
}
informerRules = true;
}

0 comments on commit 9672dcb

Please sign in to comment.