} catch ( NoSuchFieldException e ) {
e.printStackTrace();
throw new RuntimeDroolsException( "Unable to resolve import '" + lastName + "'" );
}
final ParserContext parserContext = new ParserContext( resolvedImports,
null,
name );
parserContext.getParserConfiguration().setClassLoader( classLoader );
for ( String pkgImport : this.pkgImports ) {
parserContext.addPackageImport( pkgImport );
}
parserContext.setInterceptors( interceptors );
parserContext.setStrongTyping( strictMode );
//parserContext.setStrictTypeEnforcement( strictMode );
resolvedInputs = new HashMap<String, Class>( inputIdentifiers.length );
parserContext.addInput( "drools",
KnowledgeHelper.class );
resolvedInputs.put( "drools",
KnowledgeHelper.class );
String lastIdentifier = null;
String lastType = null;
try {
for ( int i = 0, length = inputIdentifiers.length; i < length; i++ ) {
lastIdentifier = inputIdentifiers[i];
lastType = inputTypes[i];
Class cls = loadClass( classLoader,
inputTypes[i] );
resolvedInputs.put( inputIdentifiers[i],
cls );
parserContext.addInput( inputIdentifiers[i],
cls );
}
} catch ( ClassNotFoundException e ) {
e.printStackTrace();
throw new RuntimeDroolsException( "Unable to resolve class '" + lastType + "' for identifier '" + lastIdentifier );
}
if ( parserContext.getInputs().get( "kcontext" ) == null) {
parserContext.addInput( "kcontext",
RuleContext.class );
resolvedInputs.put( "kcontext",
RuleContext.class );