]
Tom Baeyens updated JBPM-457:
-----------------------------
Fix Version/s: jBPM jPDL 3.2.2
Priority: Critical (was: Major)
Parent process deployment does not link process-state with subprocess
definition
--------------------------------------------------------------------------------
Key: JBPM-457
URL:
http://jira.jboss.com/jira/browse/JBPM-457
Project: JBoss jBPM
Issue Type: Bug
Components: Core Engine
Reporter: Eduardo Jimenez
Assigned To: Tom Baeyens
Priority: Critical
Fix For: jBPM jPDL 3.2.2
From the ProcessState code:
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(subProcessNam
e, 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(subProces
sName);
}
} 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:
Code:
public static void deployZipInputStream(ZipInputStream zipInputStream, JbpmSessionFactory
jbpmSessio
nFactory) {
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:
Code:
private void deploy(File file, JbpmSessionFactory jbpmSessionFactory) throws IOException,
FileNotFou
ndException {
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.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: