* Restructuring (WIP) * Fix warnings * Move DSL to modules * Update namespaces * Make design factory base reusable * Update service registrations * Remove unused namespaces and rename ElsaDbContext * Incremental work on migrations * Generate WorkflowsDbContext SQLite migrations * Rename ServiceCollectionExtensions * Update DbContextOptionsBuilderExtensions.cs * Restructure * Configuration refactorings (WIP) * Incremental work on configurator API * Incremental work on configuration API * Incremental work on configuration API * Fix workflow runtime options * Move standard stream providers * Implement configurator dependencies * Cleanup configurator API * Update configurator dependencies * Cleanup * Update Label API endpoints * Fix eager configuration issue
20 lines
894 B
C#
20 lines
894 B
C#
using Elsa.Workflows.Runtime.Services;
|
|
|
|
namespace Elsa.Workflows.Runtime.Implementations;
|
|
|
|
public class StimulusInterpreter : IStimulusInterpreter
|
|
{
|
|
private readonly IEnumerable<IStimulusHandler> _workflowExecutionInstructionProviders;
|
|
|
|
public StimulusInterpreter(IEnumerable<IStimulusHandler> workflowExecutionInstructionProviders)
|
|
{
|
|
_workflowExecutionInstructionProviders = workflowExecutionInstructionProviders;
|
|
}
|
|
|
|
public async Task<IEnumerable<IWorkflowInstruction>> GetExecutionInstructionsAsync(IStimulus stimulus, CancellationToken cancellationToken = default)
|
|
{
|
|
var providers = _workflowExecutionInstructionProviders.Where(x => x.GetSupportsStimulus(stimulus)).ToList();
|
|
var tasks = providers.Select(x => x.GetInstructionsAsync(stimulus, cancellationToken).AsTask());
|
|
return (await Task.WhenAll(tasks)).SelectMany(x => x);
|
|
}
|
|
} |