Fixed issue when more than 100 workflows as activities are available
This commit is contained in:
parent
90651b4735
commit
2ee823ba30
|
|
@ -35,7 +35,7 @@ public class WorkflowDefinitionActivityProvider : IActivityProvider
|
|||
VersionOptions = VersionOptions.All
|
||||
};
|
||||
|
||||
var allDescriptors = new List<ActivityDescriptor>();
|
||||
var allDefinitions = new List<WorkflowDefinition>();
|
||||
var currentPage = 0;
|
||||
const int pageSize = 100;
|
||||
|
||||
|
|
@ -43,15 +43,13 @@ public class WorkflowDefinitionActivityProvider : IActivityProvider
|
|||
{
|
||||
var pageArgs = PageArgs.FromPage(currentPage++, pageSize);
|
||||
var pageOfDefinitions = await _store.FindManyAsync(filter, pageArgs, cancellationToken);
|
||||
var descriptors = CreateDescriptors(pageOfDefinitions.Items).ToList();
|
||||
allDefinitions.AddRange(pageOfDefinitions.Items);
|
||||
|
||||
allDescriptors.AddRange(descriptors);
|
||||
|
||||
if(allDescriptors.Count >= pageOfDefinitions.TotalCount)
|
||||
if(pageSize > pageOfDefinitions.TotalCount)
|
||||
break;
|
||||
}
|
||||
|
||||
return allDescriptors;
|
||||
return CreateDescriptors(allDefinitions).ToList();
|
||||
}
|
||||
|
||||
private IEnumerable<ActivityDescriptor> CreateDescriptors(ICollection<WorkflowDefinition> definitions) =>
|
||||
|
|
|
|||
Loading…
Reference in a new issue