1 Reply Latest reply on Oct 14, 2010 11:25 AM by spiga

    Impossible to find Group Tasks ordered

    spiga

      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

        • 1. Re: Impossible to find Group Tasks ordered
          spiga

          I noticed that the previous versions of jBPM (4.3) does not have such a problem: the call to appendOrderByClause(hql); is unconditioned!

          Why now is this condition added?

          Nobody needs to get group tasks ordered and paged?

           

          Please help me!

          Fabio