-
1. Re: Should the JpdlArchiveParser throw the JpdlException?
kukeltje Jul 22, 2005 2:33 PM (in response to jjmargon)Eventually there will also be a validation against the schema. Once the WTP reaches final state. This validation will probably be done fist and *in* the editor as well as jBPM core. So many of these issues will not arise.
As mentioned in your other post, please file things like this in the jira -
2. Re: Should the JpdlArchiveParser throw the JpdlException?
aguizar Jul 22, 2005 3:22 PM (in response to jjmargon)As you can see in the try/catch block, the problem details are added to the process archive. If you instantiate a ProcessArchive and then invoke its parseProcessDefinition() method directly, instead of ProcessDefinition.parseParXXX(), you could later call ProcessArchive.getProblems() to see whether any problems have occurred.
However, the ProcessDefinition.parseXmlXXX() methods do throw a JpdlException with the list of problems that occurred. Conversely, ProcessDefinition.parseParXXX() have no way of notifying the caller of problems that might have ocurred.
How about changing method ProcessDefinition.parseParZipInputStream() from:try { return new ProcessArchive(zipInputStream).parseProcessDefinition(); } catch (IOException e) { throw new RuntimeException("couldn't parse par zip file zipInputStream", e); }
to:try { ProcessArchive archive = new ProcessArchive(zipInputStream); ProcessDefinition definition = archive.parseProcessDefinition(); List problems = archive.getProblems(); if (!problems.isEmpty()) throw new JpdlException(problems); return definition; } catch (IOException e) { throw new RuntimeException("couldn't parse par zip file zipInputStream", e); }
ProcessDefinition.parseParResource() delegates to the previous method, so it gets fixed for free. -
3. Re: Should the JpdlArchiveParser throw the JpdlException?
aguizar Aug 22, 2005 3:55 PM (in response to jjmargon)Opened http://jira.jboss.org/jira/browse/JBPM-322 to track this issue.