[jboss-dev-forums] [jBPM Development] - Impossible to get group tasks paged and ordered

Fabio Spiga do-not-reply at jboss.com
Thu Oct 14 05:06:26 EDT 2010


Fabio Spiga [http://community.jboss.org/people/Spiga] created the discussion

"Impossible to get group tasks paged and ordered"

To view the discussion, visit: http://community.jboss.org/message/566407#566407

--------------------------------------------------------------
Hi everybody,
I need to get  the group tasks for which a user is candidate in a manner ORDERED e  PAGED, so the API findGroupTasks is not sufficient.
Therefore, I have replaced findGroupTasks() with the following code:

+         taskList = getTaskService().createTaskQuery()
            .candidate(filter.getUsername())
            .orderDesc(TaskQuery.PROPERTY_CREATEDATE)
            .page(startRow, maxResults)
            .list();+

The problem is that the resulting list is not ordered.
By  debugging jBPM sources, I've found that the problem is in the class  org.jbpm.pvm.internal.query.TaskQueryImpl within the method

+public String hql()+

Here the ORDER BY clause is added only if I'm not searching for Candidate. The original code is the following:

+....
+
+if (candidate == null && !count)
      appendOrderByClause(hql);+
+....+

Why in your opinion is there such a condition?
How can I do to obtain an ordered and paged list for a candidate user?

Thanks you in advance,
Fabio
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/566407#566407]

Start a new discussion in jBPM Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2035]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20101014/001264a3/attachment-0004.html 


More information about the jboss-dev-forums mailing list