PackageDescr decisionTableToPackageDescr(Resource resource, ResourceConfiguration configuration) throws DroolsParserException, IOException {
DecisionTableConfiguration dtableConfiguration = (DecisionTableConfiguration) configuration;
String string = DecisionTableFactory.loadFromInputStream( resource.getInputStream(), dtableConfiguration );
DrlParser parser = new DrlParser();
PackageDescr pkg = parser.parse( new StringReader( string ) );
this.results.addAll( parser.getErrors() );
if (pkg == null) {
this.results.add( new ParserError( resource, "Parser returned a null Package", 0, 0 ) );
}
return parser.hasErrors() ? null : pkg;