[jbpm-issues] [JBoss JIRA] Commented: (JBPM-1133) the query findActiveNodesByProcessInstance doesn't find active nodes in the root token

David Roberts (JIRA) jira-events at lists.jboss.org
Wed Apr 2 03:45:39 EDT 2008


    [ http://jira.jboss.com/jira/browse/JBPM-1133?page=comments#action_12406415 ] 
            
David Roberts commented on JBPM-1133:
-------------------------------------

I also noticed I wasn't getting any Node objects returned when calling: graphSession.findActiveNodesByProcessInstance(processInstance);

I have taken your advice above and modified the query in my app as you suggested, and just called it myself where I need it.

I used the following code to get the nodes:

//-------------------------------------------------------------------------------------------------------------------------------------------------
Query query = jbpmContext.getSession().createQuery("select distinct node from org.jbpm.graph.def.Node node," +
													 "org.jbpm.graph.exe.Token token," +
													 "org.jbpm.graph.exe.ProcessInstance processInstance " +
													 "where token.processInstance = :processInstance " +
													 "and token.node = node " +
													 "and token.isSuspended != true " +
													 "and token.end is null");
query.setEntity("processInstance", processInstance);
List nodes = query.list();
//-------------------------------------------------------------------------------------------------------------------------------------------------

 It seems to be working nicely now - thanks.

> the query findActiveNodesByProcessInstance doesn't find active nodes in the root token
> --------------------------------------------------------------------------------------
>
>                 Key: JBPM-1133
>                 URL: http://jira.jboss.com/jira/browse/JBPM-1133
>             Project: JBoss jBPM
>          Issue Type: Bug
>          Components: Core Engine
>    Affects Versions: jBPM jPDL 3.2.2
>            Reporter: Jérôme Tellier
>         Assigned To: Tom Baeyens
>            Priority: Minor
>
> the query findActiveNodesByProcessInstance has the condition "token.parent is not null", but if the token is the root token his parent is null.
> the query needs certainly also a "distinct". 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       




More information about the jbpm-issues mailing list