[jboss-user] [jBPM] - GraphSession.findLatestProcessDefinition() returns wrong value

Michael Holtzman do-not-reply at jboss.com
Wed Oct 27 11:24:26 EDT 2010

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);
      processDefinition = (ProcessDefinition) query.uniqueResult();
    } catch (Exception e) {

       e.printStackTrace(); log.error(e);
      throw new JbpmException("couldn't find process definition '" + name + "'", e);
    return processDefinition;

<query name="GraphSession.findLatestProcessDefinitionQuery">
     select pd
     from org.jbpm.graph.def.ProcessDefinition as pd
     where pd.name = :name
     order by pd.version desc    

Reply to this message by going to Community

Start a new discussion in jBPM at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20101027/d67c89bc/attachment-0001.html 

More information about the jboss-user mailing list