コード例 #1
0
        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());
        }
コード例 #2
0
        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()));
        }