Michael Holtzman [
http://community.jboss.org/people/michaelholtzman] created the
discussion
"GraphSession.findLatestProcessDefinition() returns wrong value"
To view the discussion, visit:
http://community.jboss.org/message/568662#568662
--------------------------------------------------------------
Greetings. We are having a problem deploying process instances. It seems that
findLatestProcessDefinition() is returning null, even when there are clearly entries in
JBPM_PROCESSDEFINITION with the same name.
This is causing all sorts of problems:
- Deploying a process definition keeps inserting multiple entries into
JBPM_PROCESSDEFINITION with version = 1
- Attempting to instantiate a definition fails (definition not found error) because
no process definition object is returned for the name.
- Etc.
This happens sporadically across multiple schemas and platforms (Oracle and SqlServer).
Typically some definitions will work OK and others will fail with this error.
We are running jBPM 3.1.2 with some local mods. Thanx for any advice.
Here is the underlying query:
public ProcessDefinition findLatestProcessDefinition(String name) {
ProcessDefinition processDefinition = null;
try {
Query query =
session.getNamedQuery("GraphSession.findLatestProcessDefinitionQuery");
query.setString("name", name);
query.setMaxResults(1);
processDefinition = (ProcessDefinition) query.uniqueResult();
} catch (Exception e) {
e.printStackTrace(); log.error(e);
jbpmSession.handleException();
throw new JbpmException("couldn't find process definition '" +
name + "'", e);
}
return processDefinition;
}
<query name="GraphSession.findLatestProcessDefinitionQuery">
<![CDATA[
select pd
from org.jbpm.graph.def.ProcessDefinition as pd
where pd.name = :name
order by pd.version desc
]]>
</query>
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/568662#568662]
Start a new discussion in jBPM at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]