]
Tom Baeyens commented on JBPM-457:
----------------------------------
in the ant task DeployProcessTask i see:
JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
try {
ZipInputStream zipInputStream = new ZipInputStream(new FileInputStream(file));
ProcessDefinition processDefinition =
ProcessDefinition.parseParZipInputStream(zipInputStream);
jbpmContext.deployProcessDefinition(processDefinition);
} finally {
jbpmContext.close();
}
in the DeployProcessCommand i see:
public Object execute(JbpmContext jbpmContext) throws Exception {
ProcessDefinition processDefinition = null;
if (par != null && par.length > 0) {
log.info("start parsing process from par");
// Thanks to George Mournos who helped to improve this:
ZipInputStream zipInputStream = new ZipInputStream(
new ByteArrayInputStream(par));
processDefinition = ProcessDefinition
.parseParZipInputStream(zipInputStream);
jbpmContext.deployProcessDefinition(processDefinition);
log.info("deployment sucessfull");
}
...
In the ProcessUploadServlet, i see:
JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
try {
response.setContentType("text/html");
response.getWriter().println(handleRequest(request));
} finally {
jbpmContext.close();
}
So I don't see where sub processes are being parsed without a JbpmContext. If you
know a specific scenario in 3.2.1, please reopen the case
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
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: