@Test public void testComplex() throws Exception { InputStream in = ClassLoader.getSystemResourceAsStream("complex.bpmn"); Parser p = new ActivitiParser(); ProcessDefinition pd = p.parse(in); assertNotNull(pd); assertEquals("cpaChargingReserve", pd.getId()); }
@Override public ProcessDefinition parse(InputStream in) throws ParserException { if (in == null) { throw new NullPointerException("Input cannot be null"); } try { SAXParserFactory spf = SAXParserFactory.newInstance(); SAXParser p = spf.newSAXParser(); Handler h = new Handler(); p.parse(in, h); return h.process; } catch (IOException | ParserConfigurationException | SAXException e) { throw new ParserException("Parsing error", e); } }
ActivitiParser implements Parser { @Override public ProcessDefinition parse(InputStream in) throws ParserException { if (in == null) { throw new NullPointerException("Input cannot be null"); } try { SAXParserFactory spf = SAXParserFactory.newInstance(); SAXParser p = spf.newSAXParser(); Handler h = new Handler(); p.parse(in, h); return h.process; } catch (IOException | ParserConfigurationException | SAXException e) { throw new ParserException("Parsing error", e); } } }
ActivitiParser implements Parser { @Override public ProcessDefinition parse(InputStream in) throws ParserException { if (in == null) { throw new NullPointerException("Input cannot be null"); } try { SAXParserFactory spf = SAXParserFactory.newInstance(); SAXParser p = spf.newSAXParser(); Handler h = new Handler(); p.parse(in, h); return h.process; } catch (IOException | ParserConfigurationException | SAXException e) { throw new ParserException("Parsing error", e); } }  }
ActivitiParser implements Parser { @Override public ProcessDefinition parse(InputStream in) throws ParserException { if (in == null) { throw new NullPointerException("Input cannot be null"); } try { SAXParserFactory spf = SAXParserFactory.newInstance(); SAXParser p = spf.newSAXParser(); Handler h = new Handler(); p.parse(in, h); return h.process; } catch (IOException | ParserConfigurationException | SAXException e) { throw new ParserException("Parsing error", e); } }  @Override ProcessDefinition parse(InputStream in); }
ActivitiParser implements Parser { @Override public ProcessDefinition parse(InputStream in) throws ParserException { if (in == null) { throw new NullPointerException("Input cannot be null"); } try { SAXParserFactory spf = SAXParserFactory.newInstance(); SAXParser p = spf.newSAXParser(); Handler h = new Handler(); p.parse(in, h); return h.process; } catch (IOException | ParserConfigurationException | SAXException e) { throw new ParserException("Parsing error", e); } }  @Override ProcessDefinition parse(InputStream in);  }