private void addDrl(String drl) { if ("".equals(drl)) { return; } try { builder.addPackageFromDrl(new StringReader(drl)); } catch (DroolsParserException e) { throw new RulesRepositoryException("Unexpected error when parsing package.", e); } catch (IOException e) { throw new RulesRepositoryException("IO Exception occurred when parsing package.", e); } }
private void loadDeclaredTypes() { AssetItemIterator it = this.pkg.listAssetsByFormat(new String[] {AssetFormats.DRL_MODEL}); while (it.hasNext()) { AssetItem as = it.next(); try { builder.addPackageFromDrl(new StringReader(as.getContent())); } catch (DroolsParserException e) { this.errors.add(new ContentAssemblyError(as, "Parser exception: " + e.getMessage())); } catch (IOException e) { this.errors.add(new ContentAssemblyError(as, "IOException: " + e.getMessage())); } } }