public async Task <IEnumerable <WorkflowTrigger> > GetTriggersAsync(IEnumerable <IWorkflowBlueprint> workflowBlueprints, CancellationToken cancellationToken = default) { var activityTypes = (await _activityTypeService.GetActivityTypesAsync(cancellationToken)).ToDictionary(x => x.TypeName); var tasksOfListsOfTriggers = workflowBlueprints.Select(workflowBlueprint => GetTriggersInternalAsync(workflowBlueprint, activityTypes, cancellationToken)); return((await Task.WhenAll(tasksOfListsOfTriggers)) .SelectMany(x => x) .ToList()); }
public async Task <IActionResult> Handle(CancellationToken cancellationToken) { var activityTypes = await _activityTypeService.GetActivityTypesAsync(cancellationToken); var tasks = activityTypes.Where(x => x.IsBrowsable).Select(x => DescribeActivity(x, cancellationToken)).ToList(); var descriptors = await Task.WhenAll(tasks); return(Json(descriptors, _serializerSettingsProvider.GetSettings())); }