| | | 1 | | using System.Diagnostics.CodeAnalysis; |
| | | 2 | | using System.Reflection; |
| | | 3 | | using Elsa.Common.DistributedHosting; |
| | | 4 | | using Elsa.Common.Features; |
| | | 5 | | using Elsa.Common.RecurringTasks; |
| | | 6 | | using Elsa.Extensions; |
| | | 7 | | using Elsa.Features.Abstractions; |
| | | 8 | | using Elsa.Features.Attributes; |
| | | 9 | | using Elsa.Features.Services; |
| | | 10 | | using Elsa.Mediator.Contracts; |
| | | 11 | | using Elsa.Workflows.Features; |
| | | 12 | | using Elsa.Workflows.Management; |
| | | 13 | | using Elsa.Workflows.Management.Contracts; |
| | | 14 | | using Elsa.Workflows.Management.Services; |
| | | 15 | | using Elsa.Workflows.Runtime.ActivationValidators; |
| | | 16 | | using Elsa.Workflows.Runtime.Entities; |
| | | 17 | | using Elsa.Workflows.Runtime.Handlers; |
| | | 18 | | using Elsa.Workflows.Runtime.Options; |
| | | 19 | | using Elsa.Workflows.Runtime.Providers; |
| | | 20 | | using Elsa.Workflows.Runtime.Stores; |
| | | 21 | | using Elsa.Workflows.Runtime.Tasks; |
| | | 22 | | using Elsa.Workflows.Runtime.UIHints; |
| | | 23 | | using Medallion.Threading; |
| | | 24 | | using Medallion.Threading.FileSystem; |
| | | 25 | | using Microsoft.Extensions.DependencyInjection; |
| | | 26 | | |
| | | 27 | | namespace Elsa.Workflows.Runtime.Features; |
| | | 28 | | |
| | | 29 | | /// <summary> |
| | | 30 | | /// Installs and configures workflow runtime features. |
| | | 31 | | /// </summary> |
| | | 32 | | [DependsOn(typeof(SystemClockFeature))] |
| | 202 | 33 | | public class WorkflowRuntimeFeature(IModule module) : FeatureBase(module) |
| | | 34 | | { |
| | 366 | 35 | | private IDictionary<string, DispatcherChannel> WorkflowDispatcherChannels { get; set; } = new Dictionary<string, Dis |
| | | 36 | | |
| | | 37 | | /// <summary> |
| | | 38 | | /// A list of workflow builders configured during application startup. |
| | | 39 | | /// </summary> |
| | 826 | 40 | | public IDictionary<string, Func<IServiceProvider, ValueTask<IWorkflow>>> Workflows { get; set; } = new Dictionary<st |
| | | 41 | | |
| | | 42 | | /// <summary> |
| | | 43 | | /// A factory that instantiates a concrete <see cref="IWorkflowRuntime"/>. |
| | | 44 | | /// </summary> |
| | 467 | 45 | | public Func<IServiceProvider, IWorkflowRuntime> WorkflowRuntime { get; set; } = sp => ActivatorUtilities.CreateInsta |
| | | 46 | | |
| | | 47 | | /// <summary> |
| | | 48 | | /// A factory that instantiates an <see cref="IWorkflowDispatcher"/>. |
| | | 49 | | /// </summary> |
| | 404 | 50 | | public Func<IServiceProvider, IWorkflowDispatcher> WorkflowDispatcher { get; set; } = sp => |
| | 202 | 51 | | { |
| | 441 | 52 | | var decoratedService = ActivatorUtilities.CreateInstance<BackgroundWorkflowDispatcher>(sp); |
| | 441 | 53 | | return ActivatorUtilities.CreateInstance<ValidatingWorkflowDispatcher>(sp, decoratedService); |
| | 202 | 54 | | }; |
| | | 55 | | |
| | | 56 | | /// <summary> |
| | | 57 | | /// A factory that instantiates an <see cref="IStimulusDispatcher"/>. |
| | | 58 | | /// </summary> |
| | 419 | 59 | | public Func<IServiceProvider, IStimulusDispatcher> StimulusDispatcher { get; set; } = sp => ActivatorUtilities.Creat |
| | | 60 | | |
| | | 61 | | /// <summary> |
| | | 62 | | /// A factory that instantiates an <see cref="IWorkflowCancellationDispatcher"/>. |
| | | 63 | | /// </summary> |
| | 411 | 64 | | public Func<IServiceProvider, IWorkflowCancellationDispatcher> WorkflowCancellationDispatcher { get; set; } = sp => |
| | | 65 | | |
| | | 66 | | /// <summary> |
| | | 67 | | /// A factory that instantiates an <see cref="IBookmarkStore"/>. |
| | | 68 | | /// </summary> |
| | 586 | 69 | | public Func<IServiceProvider, IBookmarkStore> BookmarkStore { get; set; } = sp => sp.GetRequiredService<MemoryBookma |
| | | 70 | | |
| | | 71 | | /// <summary> |
| | | 72 | | /// A factory that instantiates an <see cref="IBookmarkQueueStore"/>. |
| | | 73 | | /// </summary> |
| | 587 | 74 | | public Func<IServiceProvider, IBookmarkQueueStore> BookmarkQueueStore { get; set; } = sp => sp.GetRequiredService<Me |
| | | 75 | | |
| | | 76 | | /// <summary> |
| | | 77 | | /// A factory that instantiates an <see cref="ITriggerStore"/>. |
| | | 78 | | /// </summary> |
| | 590 | 79 | | public Func<IServiceProvider, ITriggerStore> TriggerStore { get; set; } = sp => sp.GetRequiredService<MemoryTriggerS |
| | | 80 | | |
| | | 81 | | /// <summary> |
| | | 82 | | /// A factory that instantiates an <see cref="IWorkflowExecutionLogStore"/>. |
| | | 83 | | /// </summary> |
| | 581 | 84 | | public Func<IServiceProvider, IWorkflowExecutionLogStore> WorkflowExecutionLogStore { get; set; } = sp => sp.GetRequ |
| | | 85 | | |
| | | 86 | | /// <summary> |
| | | 87 | | /// A factory that instantiates an <see cref="IActivityExecutionStore"/>. |
| | | 88 | | /// </summary> |
| | 572 | 89 | | public Func<IServiceProvider, IActivityExecutionStore> ActivityExecutionLogStore { get; set; } = sp => sp.GetRequire |
| | | 90 | | |
| | | 91 | | /// <summary> |
| | | 92 | | /// A factory that instantiates an <see cref="IDistributedLockProvider"/>. |
| | | 93 | | /// </summary> |
| | 577 | 94 | | public Func<IServiceProvider, IDistributedLockProvider> DistributedLockProvider { get; set; } = _ => new FileDistrib |
| | | 95 | | |
| | | 96 | | /// <summary> |
| | | 97 | | /// A factory that instantiates an <see cref="ITaskDispatcher"/>. |
| | | 98 | | /// </summary> |
| | 404 | 99 | | public Func<IServiceProvider, ITaskDispatcher> RunTaskDispatcher { get; set; } = sp => sp.GetRequiredService<Backgro |
| | | 100 | | |
| | | 101 | | /// <summary> |
| | | 102 | | /// A factory that instantiates an <see cref="IBackgroundActivityScheduler"/>. |
| | | 103 | | /// </summary> |
| | 571 | 104 | | public Func<IServiceProvider, IBackgroundActivityScheduler> BackgroundActivityScheduler { get; set; } = sp => Activa |
| | | 105 | | |
| | | 106 | | /// <summary> |
| | | 107 | | /// A factory that instantiates a log record sink for an <see cref="ActivityExecutionRecord"/>. |
| | | 108 | | /// </summary> |
| | 923 | 109 | | public Func<IServiceProvider, ILogRecordSink<ActivityExecutionRecord>> ActivityExecutionLogSink { get; set; } = sp = |
| | | 110 | | |
| | | 111 | | /// <summary> |
| | | 112 | | /// A factory that instantiates a log record sink for an <see cref="WorkflowExecutionLogRecord"/>. |
| | | 113 | | /// </summary> |
| | 923 | 114 | | public Func<IServiceProvider, ILogRecordSink<WorkflowExecutionLogRecord>> WorkflowExecutionLogSink { get; set; } = s |
| | | 115 | | |
| | | 116 | | /// <summary> |
| | | 117 | | /// A factory that instantiates an <see cref="ICommandHandler"/>. |
| | | 118 | | /// </summary> |
| | 202 | 119 | | public Func<IServiceProvider, ICommandHandler> DispatchWorkflowCommandHandler { get; set; } = sp => sp.GetRequiredSe |
| | | 120 | | |
| | | 121 | | /// <summary> |
| | | 122 | | /// A factory that instantiates an <see cref="IWorkflowResumer"/>. |
| | | 123 | | /// </summary> |
| | 537 | 124 | | public Func<IServiceProvider, IWorkflowResumer> WorkflowResumer { get; set; } = sp => sp.GetRequiredService<Workflow |
| | | 125 | | |
| | | 126 | | /// <summary> |
| | | 127 | | /// A factory that instantiates an <see cref="IBookmarkQueueWorker"/>. |
| | | 128 | | /// </summary> |
| | 617 | 129 | | public Func<IServiceProvider, IBookmarkQueueWorker> BookmarkQueueWorker { get; set; } = sp => sp.GetRequiredService< |
| | | 130 | | |
| | | 131 | | /// <summary> |
| | | 132 | | /// A delegate to configure the <see cref="DistributedLockingOptions"/>. |
| | | 133 | | /// </summary> |
| | 577 | 134 | | public Action<DistributedLockingOptions> DistributedLockingOptions { get; set; } = _ => { }; |
| | | 135 | | |
| | | 136 | | /// <summary> |
| | | 137 | | /// A delegate to configure the <see cref="WorkflowInboxCleanupOptions"/>. |
| | | 138 | | /// </summary> |
| | | 139 | | [Obsolete("Will be removed in a future version")] |
| | 404 | 140 | | public Action<WorkflowInboxCleanupOptions> WorkflowInboxCleanupOptions { get; set; } = _ => { }; |
| | | 141 | | |
| | | 142 | | /// <summary> |
| | | 143 | | /// A delegate to configure the <see cref="WorkflowDispatcherOptions"/>. |
| | | 144 | | /// </summary> |
| | 568 | 145 | | public Action<WorkflowDispatcherOptions> WorkflowDispatcherOptions { get; set; } = _ => { }; |
| | | 146 | | |
| | | 147 | | /// <summary> |
| | | 148 | | /// A delegate to configure the <see cref="BookmarkQueuePurgeOptions"/>. |
| | | 149 | | /// </summary> |
| | 404 | 150 | | public Action<BookmarkQueuePurgeOptions> BookmarkQueuePurgeOptions { get; set; } = _ => { }; |
| | | 151 | | |
| | | 152 | | /// <summary> |
| | | 153 | | /// Enables the workflow inbox cleanup job. |
| | | 154 | | /// </summary> |
| | | 155 | | public WorkflowRuntimeFeature EnableWorkflowInboxCleanupJob() |
| | | 156 | | { |
| | 0 | 157 | | Services.Configure<WorkflowInboxCleanupOptions>(options => { options.IsEnabled = true; }); |
| | 0 | 158 | | return this; |
| | | 159 | | } |
| | | 160 | | |
| | | 161 | | /// <summary> |
| | | 162 | | /// Disables the workflow inbox cleanup job. |
| | | 163 | | /// </summary> |
| | | 164 | | public WorkflowRuntimeFeature DisableWorkflowInboxCleanupJob() |
| | | 165 | | { |
| | 0 | 166 | | Services.Configure<WorkflowInboxCleanupOptions>(options => { options.IsEnabled = false; }); |
| | 0 | 167 | | return this; |
| | | 168 | | } |
| | | 169 | | |
| | | 170 | | /// <summary> |
| | | 171 | | /// Register the specified workflow type. |
| | | 172 | | /// </summary> |
| | | 173 | | public WorkflowRuntimeFeature AddWorkflow<T>() where T : IWorkflow |
| | | 174 | | { |
| | 22 | 175 | | Workflows.Add<T>(); |
| | 22 | 176 | | return this; |
| | | 177 | | } |
| | | 178 | | |
| | | 179 | | /// <summary> |
| | | 180 | | /// Register all workflows in the specified assembly. |
| | | 181 | | /// </summary> |
| | | 182 | | [RequiresUnreferencedCode("The assembly is required to be referenced.")] |
| | | 183 | | public WorkflowRuntimeFeature AddWorkflowsFrom(Assembly assembly) |
| | | 184 | | { |
| | 14 | 185 | | var workflowTypes = assembly.GetExportedTypes() |
| | 924 | 186 | | .Where(x => typeof(IWorkflow).IsAssignableFrom(x) && x is { IsAbstract: false, IsInterface: false, IsGeneric |
| | 14 | 187 | | .ToList(); |
| | | 188 | | |
| | 910 | 189 | | foreach (var workflowType in workflowTypes) |
| | 441 | 190 | | Workflows.Add(workflowType); |
| | | 191 | | |
| | 14 | 192 | | return this; |
| | | 193 | | } |
| | | 194 | | |
| | | 195 | | /// <summary> |
| | | 196 | | /// Adds a dispatcher channel. |
| | | 197 | | /// </summary> |
| | | 198 | | public WorkflowRuntimeFeature AddDispatcherChannel(string channel) |
| | | 199 | | { |
| | 0 | 200 | | return AddDispatcherChannel(new DispatcherChannel |
| | 0 | 201 | | { |
| | 0 | 202 | | Name = channel |
| | 0 | 203 | | }); |
| | | 204 | | } |
| | | 205 | | |
| | | 206 | | /// <summary> |
| | | 207 | | /// Adds a dispatcher channel. |
| | | 208 | | /// </summary> |
| | | 209 | | public WorkflowRuntimeFeature AddDispatcherChannel(DispatcherChannel channel) |
| | | 210 | | { |
| | 0 | 211 | | WorkflowDispatcherChannels[channel.Name] = channel; |
| | 0 | 212 | | return this; |
| | | 213 | | } |
| | | 214 | | |
| | | 215 | | /// <inheritdoc /> |
| | | 216 | | public override void Configure() |
| | | 217 | | { |
| | 202 | 218 | | Module.AddActivitiesFrom<WorkflowRuntimeFeature>(); |
| | 202 | 219 | | Module.Configure<WorkflowsFeature>(workflows => |
| | 202 | 220 | | { |
| | 721 | 221 | | workflows.CommitStateHandler = sp => sp.GetRequiredService<DefaultCommitStateHandler>(); |
| | 404 | 222 | | }); |
| | | 223 | | |
| | 202 | 224 | | Services.Configure<RecurringTaskOptions>(options => |
| | 202 | 225 | | { |
| | 11 | 226 | | options.Schedule.ConfigureTask<TriggerBookmarkQueueRecurringTask>(TimeSpan.FromSeconds(10)); |
| | 213 | 227 | | }); |
| | 202 | 228 | | } |
| | | 229 | | |
| | | 230 | | /// <inheritdoc /> |
| | | 231 | | public override void Apply() |
| | | 232 | | { |
| | | 233 | | // Options. |
| | 202 | 234 | | Services.Configure(DistributedLockingOptions); |
| | 202 | 235 | | Services.Configure(WorkflowInboxCleanupOptions); |
| | 202 | 236 | | Services.Configure(WorkflowDispatcherOptions); |
| | 202 | 237 | | Services.Configure(BookmarkQueuePurgeOptions); |
| | 524 | 238 | | Services.Configure<RuntimeOptions>(options => { options.Workflows = Workflows; }); |
| | 202 | 239 | | Services.Configure<WorkflowDispatcherOptions>(options => |
| | 202 | 240 | | { |
| | 164 | 241 | | options.Channels.AddRange(WorkflowDispatcherChannels.Values); |
| | 366 | 242 | | }); |
| | | 243 | | |
| | 202 | 244 | | Services |
| | 202 | 245 | | // Core. |
| | 202 | 246 | | .AddScoped<ITriggerIndexer, TriggerIndexer>() |
| | 202 | 247 | | .AddScoped<IWorkflowInstanceFactory, WorkflowInstanceFactory>() |
| | 202 | 248 | | .AddScoped<IWorkflowHostFactory, WorkflowHostFactory>() |
| | 202 | 249 | | .AddScoped<IBackgroundActivityInvoker, BackgroundActivityInvoker>() |
| | 202 | 250 | | .AddScoped(WorkflowRuntime) |
| | 202 | 251 | | .AddScoped(WorkflowDispatcher) |
| | 202 | 252 | | .AddScoped(StimulusDispatcher) |
| | 202 | 253 | | .AddScoped(WorkflowCancellationDispatcher) |
| | 202 | 254 | | .AddScoped(RunTaskDispatcher) |
| | 202 | 255 | | .AddScoped(ActivityExecutionLogSink) |
| | 202 | 256 | | .AddScoped(WorkflowExecutionLogSink) |
| | 202 | 257 | | .AddSingleton(BackgroundActivityScheduler) |
| | 202 | 258 | | .AddSingleton<RandomLongIdentityGenerator>() |
| | 202 | 259 | | .AddSingleton<IBookmarkQueueSignaler, BookmarkQueueSignaler>() |
| | 202 | 260 | | .AddScoped(BookmarkQueueWorker) |
| | 202 | 261 | | .AddScoped<IBookmarkManager, DefaultBookmarkManager>() |
| | 202 | 262 | | .AddScoped<IActivityExecutionManager, DefaultActivityExecutionManager>() |
| | 202 | 263 | | .AddScoped<IActivityExecutionStatsService, ActivityExecutionStatsService>() |
| | 202 | 264 | | .AddScoped<IActivityExecutionMapper, DefaultActivityExecutionMapper>() |
| | 202 | 265 | | .AddScoped<IWorkflowDefinitionStorePopulator, DefaultWorkflowDefinitionStorePopulator>() |
| | 202 | 266 | | .AddScoped<IRegistriesPopulator, DefaultRegistriesPopulator>() |
| | 202 | 267 | | .AddScoped<IWorkflowDefinitionsRefresher, WorkflowDefinitionsRefresher>() |
| | 202 | 268 | | .AddScoped<IWorkflowDefinitionsReloader, WorkflowDefinitionsReloader>() |
| | 202 | 269 | | .AddScoped<IWorkflowRegistry, DefaultWorkflowRegistry>() |
| | 202 | 270 | | .AddScoped<IWorkflowMatcher, WorkflowMatcher>() |
| | 202 | 271 | | .AddScoped<IWorkflowInvoker, WorkflowInvoker>() |
| | 202 | 272 | | .AddScoped<IStimulusSender, StimulusSender>() |
| | 202 | 273 | | .AddScoped<ITriggerBoundWorkflowService, TriggerBoundWorkflowService>() |
| | 202 | 274 | | .AddScoped<IBookmarkBoundWorkflowService, BookmarkBoundWorkflowService>() |
| | 202 | 275 | | .AddScoped<ITaskReporter, TaskReporter>() |
| | 202 | 276 | | .AddScoped<SynchronousTaskDispatcher>() |
| | 202 | 277 | | .AddScoped<BackgroundTaskDispatcher>() |
| | 202 | 278 | | .AddScoped<StoreActivityExecutionLogSink>() |
| | 202 | 279 | | .AddScoped<StoreWorkflowExecutionLogSink>() |
| | 202 | 280 | | .AddScoped<DispatchWorkflowCommandHandler>() |
| | 202 | 281 | | .AddScoped<IEventPublisher, EventPublisher>() |
| | 202 | 282 | | .AddScoped<IBookmarkUpdater, BookmarkUpdater>() |
| | 202 | 283 | | .AddScoped<IBookmarksPersister, BookmarksPersister>() |
| | 202 | 284 | | .AddScoped<IBookmarkResumer, BookmarkResumer>() |
| | 202 | 285 | | .AddScoped<IBookmarkQueue, StoreBookmarkQueue>() |
| | 202 | 286 | | .AddScoped(WorkflowResumer) |
| | 202 | 287 | | .AddScoped<WorkflowResumer>() |
| | 202 | 288 | | .AddScoped(BookmarkQueueWorker) |
| | 202 | 289 | | .AddScoped<BookmarkQueueWorker>() |
| | 202 | 290 | | .AddScoped<ITriggerInvoker, TriggerInvoker>() |
| | 202 | 291 | | .AddScoped<IWorkflowCanceler, WorkflowCanceler>() |
| | 202 | 292 | | .AddScoped<IWorkflowCancellationService, WorkflowCancellationService>() |
| | 202 | 293 | | .AddScoped<IWorkflowActivationStrategyEvaluator, DefaultWorkflowActivationStrategyEvaluator>() |
| | 202 | 294 | | .AddScoped<IWorkflowStarter, DefaultWorkflowStarter>() |
| | 202 | 295 | | .AddScoped<IWorkflowRestarter, DefaultWorkflowRestarter>() |
| | 202 | 296 | | .AddScoped<IBookmarkQueuePurger, DefaultBookmarkQueuePurger>() |
| | 202 | 297 | | .AddScoped<ILogRecordExtractor<WorkflowExecutionLogRecord>, WorkflowExecutionLogRecordExtractor>() |
| | 202 | 298 | | .AddScoped<IActivityPropertyLogPersistenceEvaluator, ActivityPropertyLogPersistenceEvaluator>() |
| | 202 | 299 | | .AddScoped<IBookmarkQueueProcessor, BookmarkQueueProcessor>() |
| | 202 | 300 | | .AddScoped<DefaultCommitStateHandler>() |
| | 202 | 301 | | .AddScoped<WorkflowHeartbeatGeneratorFactory>() |
| | 202 | 302 | | |
| | 202 | 303 | | // Deprecated services. |
| | 202 | 304 | | .AddScoped<IWorkflowInbox, StimulusProxyWorkflowInbox>() |
| | 202 | 305 | | |
| | 202 | 306 | | // Stores. |
| | 202 | 307 | | .AddScoped(BookmarkStore) |
| | 202 | 308 | | .AddScoped(BookmarkQueueStore) |
| | 202 | 309 | | .AddScoped(TriggerStore) |
| | 202 | 310 | | .AddScoped(WorkflowExecutionLogStore) |
| | 202 | 311 | | .AddScoped(ActivityExecutionLogStore) |
| | 202 | 312 | | |
| | 202 | 313 | | // Lazy services. |
| | 167 | 314 | | .AddScoped<Func<IEnumerable<IWorkflowsProvider>>>(sp => sp.GetServices<IWorkflowsProvider>) |
| | 620 | 315 | | .AddScoped<Func<IEnumerable<IWorkflowMaterializer>>>(sp => sp.GetServices<IWorkflowMaterializer>) |
| | 202 | 316 | | |
| | 202 | 317 | | // Noop stores. |
| | 202 | 318 | | .AddScoped<MemoryWorkflowExecutionLogStore>() |
| | 202 | 319 | | .AddScoped<MemoryActivityExecutionStore>() |
| | 202 | 320 | | |
| | 202 | 321 | | // Memory stores. |
| | 202 | 322 | | .AddMemoryStore<StoredBookmark, MemoryBookmarkStore>() |
| | 202 | 323 | | .AddMemoryStore<StoredTrigger, MemoryTriggerStore>() |
| | 202 | 324 | | .AddMemoryStore<BookmarkQueueItem, MemoryBookmarkQueueStore>() |
| | 202 | 325 | | .AddMemoryStore<WorkflowExecutionLogRecord, MemoryWorkflowExecutionLogStore>() |
| | 202 | 326 | | .AddMemoryStore<ActivityExecutionRecord, MemoryActivityExecutionStore>() |
| | 202 | 327 | | |
| | 202 | 328 | | // Startup tasks, background tasks, and recurring tasks. |
| | 202 | 329 | | .AddStartupTask<PopulateRegistriesStartupTask>() |
| | 202 | 330 | | .AddRecurringTask<TriggerBookmarkQueueRecurringTask>(TimeSpan.FromMinutes(1)) |
| | 202 | 331 | | .AddRecurringTask<PurgeBookmarkQueueRecurringTask>(TimeSpan.FromSeconds(10)) |
| | 202 | 332 | | .AddRecurringTask<RestartInterruptedWorkflowsTask>(TimeSpan.FromMinutes(5)) // Same default as the workflow |
| | 202 | 333 | | |
| | 202 | 334 | | // Distributed locking. |
| | 202 | 335 | | .AddSingleton(DistributedLockProvider) |
| | 202 | 336 | | |
| | 202 | 337 | | // Workflow definition providers. |
| | 202 | 338 | | .AddWorkflowDefinitionProvider<ClrWorkflowsProvider>() |
| | 202 | 339 | | |
| | 202 | 340 | | // UI property handlers. |
| | 202 | 341 | | .AddScoped<IPropertyUIHandler, DispatcherChannelOptionsProvider>() |
| | 202 | 342 | | |
| | 202 | 343 | | // Domain handlers. |
| | 202 | 344 | | .AddCommandHandler<DispatchWorkflowCommandHandler>() |
| | 202 | 345 | | .AddCommandHandler<DispatchStimulusCommandHandler>() |
| | 202 | 346 | | .AddCommandHandler<CancelWorkflowsCommandHandler>() |
| | 202 | 347 | | .AddNotificationHandler<ResumeDispatchWorkflowActivity>() |
| | 202 | 348 | | .AddNotificationHandler<ResumeBulkDispatchWorkflowActivity>() |
| | 202 | 349 | | .AddNotificationHandler<ResumeExecuteWorkflowActivity>() |
| | 202 | 350 | | .AddNotificationHandler<IndexTriggers>() |
| | 202 | 351 | | .AddNotificationHandler<CancelBackgroundActivities>() |
| | 202 | 352 | | .AddNotificationHandler<DeleteBookmarks>() |
| | 202 | 353 | | .AddNotificationHandler<DeleteTriggers>() |
| | 202 | 354 | | .AddNotificationHandler<DeleteActivityExecutionLogRecords>() |
| | 202 | 355 | | .AddNotificationHandler<DeleteWorkflowExecutionLogRecords>() |
| | 202 | 356 | | .AddNotificationHandler<RefreshActivityRegistry>() |
| | 202 | 357 | | .AddNotificationHandler<SignalBookmarkQueueWorker>() |
| | 202 | 358 | | .AddNotificationHandler<EvaluateParentLogPersistenceModes>() |
| | 202 | 359 | | .AddNotificationHandler<CaptureActivityExecutionState>() |
| | 202 | 360 | | .AddNotificationHandler<ValidateWorkflowRequestHandler>() |
| | 202 | 361 | | |
| | 202 | 362 | | // Workflow activation strategies. |
| | 202 | 363 | | .AddScoped<IWorkflowActivationStrategy, SingletonStrategy>() |
| | 202 | 364 | | .AddScoped<IWorkflowActivationStrategy, CorrelatedSingletonStrategy>() |
| | 202 | 365 | | .AddScoped<IWorkflowActivationStrategy, CorrelationStrategy>() |
| | 202 | 366 | | ; |
| | 202 | 367 | | } |
| | | 368 | | } |