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 Aug 7, 2013
1 parent 2eabf90 commit 9672dcb
Showing 1 changed file with 8 additions and 5 deletions.
Expand Up @@ -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.*;
Expand All @@ -47,8 +48,6 @@ public class PMML4Compiler implements org.drools.compiler.PMMLCompiler {
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;

Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 9672dcb

Please sign in to comment.