Uploaded image for project: 'Service Packs and Hot Fixes'
  1. Service Packs and Hot Fixes
  2. MNT-16468

CLONE [5.0.N] - skipCount does not appear to work for Workflow tasks REST api



      skipCount argument for REST call to


      does not appear to work correctly. From reading the [http://docs.alfresco.com/4.2/pra/1/concepts/pra-pagination.html|Pagination] help, skipCount should skip the first n results from the totalItems amount and return the next page (or up to maxItems). The problem appears to be that skipCount is always referring to the original page results, not to the totalItems.

      For example:
      Say, we have 1050 tasks assigned to a group and we are querying using a few clauses, thus slowing the query down and forcing pagination:

      http://localhost:8080/alfresco/api/-default-/public/workflow/versions/1/tasks?skipCount=0&maxItems=2000&where=(candidateUser = 'admin' AND status = 'active' AND includeTaskVariables = 'true' AND includeProcessVariables = 'true')

      we get:


      From what I understand of the docs, setting skipCount to 625 in a follow-up query would get either all of the remaining results or the next page (depending on the speed of the query). However it appears that skipCount currently refers to the totalItems, therefore changing the skipCount to 625 in this case returns zero results, i.e.




      Steps to reproduce

      1. Create ~1050 workflow tasks
      1a. Upload a document to the repository and get it's nodeRef
      1b. Using javascript-console, get that document and create a workflow package with it and then create and start 1050 workflows assigned to the admin group, i.e.

      var document = search.findNode("workspace://SpacesStore/788e5602-0d99-445b-aaaf-af166fd3ed1a"); // <-- place your document's nodeRef here
      for (var i = 0; i < 1050; i++)  {
      var workflowPackage = workflow.createPackage();
      var wfdef = workflow.getDefinitionByName("activiti$activitiReviewPooled");
      var wfparams = new Object();
      wfparams["bpm:workflowDescription"] = "Start workflow - ";
      wfparams["bpm:groupAssignee"] = people.getGroup("GROUP_ALFRESCO_ADMINISTRATORS");

      2. Once that completes run the following REST call from a browser:


      At this point, it should page the first set of results, in my environment, I get 625 returned, i.e.


      3. Change the query's skipCount to 625 for example (or whatever the total of the returned number was previously) and send the call again.

      Expected behaviour
      Call should skip the first paged set and return the next page (or the rest of the results)

      Actual behaviour
      The first page is returned again minus the skipCount.


          Issue Links




                • Assignee:
                  closedbugs Closed Bugs (Inactive)
                  astrachan Alex Strachan
                • Votes:
                  0 Vote for this issue
                  14 Start watching this issue


                  • Created:

                    Time Tracking

                    Original Estimate - Not Specified
                    Not Specified
                    Remaining Estimate - 0 minutes
                    Time Spent - 4 hours, 20 minutes
                    4h 20m

                      Structure Helper Panel