public ProcessDefinition readFromArchive(ProcessArchive processArchive, ProcessDefinition processDefinition) { processArchive.removeEntry("processdefinition.xml"); return null; } }
/** * parse a process definition from a process archive zip-stream. * * @throws org.jbpm.jpdl.JpdlException if parsing reported an error. */ public static ProcessDefinition parseParZipInputStream(ZipInputStream zipInputStream) throws IOException { return new ProcessArchive(zipInputStream).parseProcessDefinition(); }
public InputStream getEntryInputStream(String entryName) { return new ByteArrayInputStream(getEntry(entryName)); }
public ProcessDefinition parseProcessDefinition() { ProcessDefinition processDefinition = ProcessDefinition.createNewProcessDefinition(); for (Iterator iter = getParsers().iterator(); iter.hasNext();) { ProcessArchiveParser processArchiveParser = (ProcessArchiveParser) iter.next(); processDefinition = processArchiveParser.readFromArchive(this, processDefinition); } if (Problem.containsProblemsOfLevel(problems, Problem.LEVEL_ERROR)) { throw new JpdlException(problems); } return processDefinition; }
private static List getParsers() { String resource = Configs.getString("resource.parsers"); synchronized (parsersByResource) { List parsers = (List) parsersByResource.get(resource); if (parsers == null) { parsers = createParsers(resource); parsersByResource.put(resource, parsers); } return parsers; } }
public ProcessDefinition readFromArchive(ProcessArchive processArchive, ProcessDefinition processDefinition) { Map entries = processArchive.getEntries(); if (!entries.isEmpty()) { // get or create file definition FileDefinition fileDefinition = processDefinition.getFileDefinition(); if (fileDefinition == null) { fileDefinition = new FileDefinition(); processDefinition.addDefinition(fileDefinition); } // add file entries to definition for (Iterator iter = entries.entrySet().iterator(); iter.hasNext();) { Map.Entry entry = (Map.Entry) iter.next(); fileDefinition.addFile((String) entry.getKey(), (byte[]) entry.getValue()); } } return processDefinition; }
ProcessArchiveParser parser = (ProcessArchiveParser) parserClass.newInstance(); if (parser instanceof ConfigurableParser) { ((ConfigurableParser) parser).configure(parserElement);
/** * parse a process definition from a process archive zip-stream. * * @throws org.jbpm.jpdl.JpdlException if parsing reported an error. */ public static ProcessDefinition parseParZipInputStream(ZipInputStream zipInputStream) throws IOException { return new ProcessArchive(zipInputStream).parseProcessDefinition(); }
public ProcessDefinition parseProcessDefinition() { ProcessDefinition processDefinition = ProcessDefinition.createNewProcessDefinition(); for (Iterator iter = getParsers().iterator(); iter.hasNext();) { ProcessArchiveParser processArchiveParser = (ProcessArchiveParser) iter.next(); processDefinition = processArchiveParser.readFromArchive(this, processDefinition); } if (Problem.containsProblemsOfLevel(problems, Problem.LEVEL_ERROR)) { throw new JpdlException(problems); } return processDefinition; }
public InputStream getEntryInputStream(String entryName) { return new ByteArrayInputStream(getEntry(entryName)); }
public ProcessDefinition readFromArchive(ProcessArchive processArchive, ProcessDefinition processDefinition) { processArchive.removeEntry("processdefinition.xml"); return null; } }
private static List getParsers() { String resource = Configs.getString("resource.parsers"); synchronized (parsersByResource) { List parsers = (List) parsersByResource.get(resource); if (parsers == null) { parsers = createParsers(resource); parsersByResource.put(resource, parsers); } return parsers; } }
public ProcessDefinition readFromArchive(ProcessArchive processArchive, ProcessDefinition processDefinition) { Map entries = processArchive.getEntries(); if (!entries.isEmpty()) { // get or create file definition FileDefinition fileDefinition = processDefinition.getFileDefinition(); if (fileDefinition == null) { fileDefinition = new FileDefinition(); processDefinition.addDefinition(fileDefinition); } // add file entries to definition for (Iterator iter = entries.entrySet().iterator(); iter.hasNext();) { Map.Entry entry = (Map.Entry) iter.next(); fileDefinition.addFile((String) entry.getKey(), (byte[]) entry.getValue()); } } return processDefinition; }
ProcessArchiveParser parser = (ProcessArchiveParser) parserClass.newInstance(); if (parser instanceof ConfigurableParser) { ((ConfigurableParser) parser).configure(parserElement);
public ProcessDefinition readFromArchive(ProcessArchive processArchive, ProcessDefinition processDefinition) throws JpdlException { // getting the value byte[] processBytes = processArchive.getEntry("processdefinition.xml"); if (processBytes == null) { throw new JpdlException("no processdefinition.xml inside process archive"); } ByteArrayInputStream processStream = new ByteArrayInputStream(processBytes); JpdlXmlReader jpdlXmlReader = new JpdlXmlReader(new InputSource(processStream), processArchive); return jpdlXmlReader.readProcessDefinition(); } }
public InputStream removeEntryInputStream(String entryName) { return new ByteArrayInputStream(removeEntry(entryName)); }
public ProcessDefinition readFromArchive(ProcessArchive processArchive, ProcessDefinition processDefinition) throws JpdlException { // getting the value byte[] processBytes = processArchive.getEntry("processdefinition.xml"); if (processBytes == null) { throw new JpdlException("no processdefinition.xml inside process archive"); } ByteArrayInputStream processStream = new ByteArrayInputStream(processBytes); JpdlXmlReader jpdlXmlReader = new JpdlXmlReader(new InputSource(processStream), processArchive); return jpdlXmlReader.readProcessDefinition(); } }
public InputStream removeEntryInputStream(String entryName) { return new ByteArrayInputStream(removeEntry(entryName)); }
public String convertPar(ProcessArchive pa) { try { // Parse the process definition XML into a DOM document Document doc = DocumentHelper.parseText(new String(pa.getEntry("processdefinition.xml"))); // Convert from 2.0 to 3.0 PDL Document doc30 = convert(doc); // Serialize the resulting document as the result ByteArrayOutputStream bos = new ByteArrayOutputStream(); serializetoXML(bos, doc30); return bos.toString(); } catch (DocumentException de) { log.error("Conversion had trouble parsing the 2.0 process definition", de); } catch (Exception ex) { log.error("Unexpected error in conversion", ex); } // things did not go well return null; }
public String convertPar(ProcessArchive pa) { try { // Parse the process definition XML into a DOM document Document doc = DocumentHelper.parseText(new String(pa.getEntry("processdefinition.xml"))); // Convert from 2.0 to 3.0 PDL Document doc30 = convert(doc); // Serialize the resulting document as the result ByteArrayOutputStream bos = new ByteArrayOutputStream(); serializetoXML(bos, doc30); return bos.toString(); } catch (DocumentException de) { log.error("Conversion had trouble parsing the 2.0 process definition", de); } catch (Exception ex) { log.error("Unexpected error in conversion", ex); } // things did not go well return null; }