}
}
public void addProcessFromFile(final Reader reader, final Resource resource) throws Exception {
PackageBuilderConfiguration configuration = packageBuilder.getPackageBuilderConfiguration();
XmlProcessReader xmlReader = new XmlProcessReader( configuration.getSemanticModules() );
final ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
final ClassLoader newLoader = this.getClass().getClassLoader();
try {
Thread.currentThread().setContextClassLoader( newLoader );
String portRuleFlow = System.getProperty( "drools.ruleflow.port", "false" );
Reader portedReader = null;
if ( portRuleFlow.equalsIgnoreCase( "true" ) ) {
portedReader = portToCurrentVersion( reader );
} else {
portedReader = reader;
}
Process process = xmlReader.read(portedReader);
if ( process != null ) {
// it is possible an xml file could not be parsed, so we need to stop null pointers
buildProcess( process, resource );
} else {
// @TODO could we maybe add something a bit more informative about what is wrong with the XML ?