This content has been marked as final.
Show 4 replies
-
1. Re: Deployment of processes with process-state nodes
ejimenez Nov 30, 2005 10:49 AM (in response to ejimenez)I meant SUBPROCESSDEFINITION_
-
2. Re: Deployment of processes with process-state nodes
ejimenez Dec 2, 2005 1:41 PM (in response to ejimenez)Guys, I think I found the problem.
I'm using the ProcessArchiveDeployer to deploy processes from ant and parent processes are not being linked. From the ProcessState code:if (jbpmSession != null) { // now, we must be able to find the sub-process if (subProcessName != null) { // if the name and the version are specified if (subProcessVersion != null) { try { int version = Integer.parseInt(subProcessVersion); // select that exact process definition as the subprocess definition subProcessDefinition = jbpmSession.getGraphSession().findProcessDefinition(subProcessName, version); } catch (NumberFormatException e) { jpdlReader.addWarning("version in process-state was not a number: " + processStateElement.asXML()); } } else { // if only the name is specified // select the latest version of that process as the subprocess // definition subProcessDefinition = jbpmSession.getGraphSession().findLatestProcessDefinition(subProcessName); } } else { jpdlReader.addWarning("no sub-process name specified in process-state " + processStateElement.asXML()); } }
if there is no session open, it simply won't look for the parent process.
Now, from the ProcessArchiveDeployer:public static void deployZipInputStream(ZipInputStream zipInputStream, JbpmSessionFactory jbpmSessionFactory) { ProcessDefinition processDefinition = ProcessDefinition.parseParZipInputStream(zipInputStream); deployProcessDefinition(processDefinition, jbpmSessionFactory); }
It reads the process definition first, then calls deploy, which opens the first jbpmSession!!!. The session must be open first before attempting to deploy!.
Now, you might say, use the ant task, but the bug is still there:private void deploy(File file, JbpmSessionFactory jbpmSessionFactory) throws IOException, FileNotFoundException { ZipInputStream zipInputStream = new ZipInputStream(new FileInputStream(file)); ProcessArchiveDeployer.deployZipInputStream(zipInputStream,jbpmSessionFactory); }
See, the ant task doens't open a jbpmSession either, so its up to ProcessArchiveDeployer.deployZipInputStream() to do it, which is the same method I'm having an issue with.
Examining ProcessArchiveDeployer, every way of deploying a process would have the same problem.
I'll open an issue and try to create a unit test to reproduce it. -
3. Re: Deployment of processes with process-state nodes
ejimenez Dec 2, 2005 1:42 PM (in response to ejimenez)I meant the session must be open before attempting to parse.
-
4. Re: Deployment of processes with process-state nodes
koen.aers Dec 2, 2005 5:33 PM (in response to ejimenez)You are a hero, thanks ;-)
Regards,
Koen