07-31-2023 01:57 PM
Hello,
This chunk of code follows a sequential way of getting a count of GetDocumentList.
Instead of doing one by one, can we do it in a bulk way to speed up the process.
Statuses.ForEach(status => {var configDBStatus = statuses.Where(stat => stat.status_id == statusId).First(); Queue q = app.Workflow.Queues.Find(configDBStatus.onbasequeueName); if (q != null) { //Set Queue Query Options QueueQueryOptions qqo = q.CreateQueueQueryOptions(); qqo.ListType = QueueQueryListType.CurrentUserWorkItems; getCountForStatus.ProcessId = processId; getCountForStatus.StatusId = statusId; // getCountForStatus.Count = (int)q.GetWorkItemCount(qqo); // 'workitem' not equiv to 'document' getCountForStatus.Count = q.GetDocumentList(qqo, 99999, DocumentRetrievalOptions.None)?.Count() ?? 0;}
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.