The worklist involved has a limit on return items since it is so large via the CM admin. Using the Java API, when I do a routingService.getCount(worklist,owner)
it gives me the count of all packages in the worklist. When I do the routingService.listWorkPackagePidStrings(worklist,owner)
it gives me the collection but it is limited to the count set by the admin. Sort of what you would expect. But I need all of the packages when running with the API's.
I can get all of the work packages if I do the following, but it doesn't seem like a good idea to temporarily change the limit count for the worklist:
workList.setMaxResult(0);
routingMgmt.update(workList);
dkCollection dkcollection = routingService.listWorkPackages(worklistnameI, userName);
workList.setMaxResult(25);
routingMgmt.update(workList);
Tried to use this prior to the listWorkPackages
:
routingService.getDocRoutingServiceMgmt().retrieveWorkList(worklist).setMaxResults(0)
but this didn't affect the returned packages. Anybody have another suggestion to bypass the worklist return limit while using the API's?
Your second approach can not work.
routingService.getDocRoutingServiceMgmt().retrieveWorkList(worklist).setMaxResults(0)
Once the worklist is retrieved setMaxResult has no effect. As far as I know there is no way to re-retrieve the worklist after a new maxResult was set.
Because I think that there are valid reasons for limiting the max return results, you must take some kind of workaround. I think that your approach is quite acceptable. Maybe you could think about to wrap it in an explicit transaciont to ensure the limit will always be set back to 25.