| | | 1 | | using Elsa.Workflows; |
| | | 2 | | using Elsa.Workflows.Features; |
| | | 3 | | using Elsa.Workflows.Middleware.Activities; |
| | | 4 | | |
| | | 5 | | // ReSharper disable once CheckNamespace |
| | | 6 | | namespace Elsa.Extensions; |
| | | 7 | | |
| | | 8 | | /// <summary> |
| | | 9 | | /// Adds an extension method to the <see cref="WorkflowsFeature"/> that installs a default workflow runtime execution pi |
| | | 10 | | /// </summary> |
| | | 11 | | public static class PipelineWorkflowsFeatureExtensions |
| | | 12 | | { |
| | | 13 | | /// <summary> |
| | | 14 | | /// Installs a default workflow runtime execution pipeline. |
| | | 15 | | /// </summary> |
| | | 16 | | public static WorkflowsFeature WithDefaultWorkflowExecutionPipeline(this WorkflowsFeature workflowsFeature, Action<I |
| | | 17 | | { |
| | 0 | 18 | | return workflowsFeature.WithWorkflowExecutionPipeline(pipeline => |
| | 0 | 19 | | { |
| | 0 | 20 | | pipeline.UseDefaultPipeline(); |
| | 0 | 21 | | configurePipeline?.Invoke(pipeline); |
| | 0 | 22 | | }); |
| | | 23 | | } |
| | | 24 | | |
| | | 25 | | /// <summary> |
| | | 26 | | /// Installs an activity invoker that can run activities asynchronously in the background. |
| | | 27 | | /// </summary> |
| | | 28 | | public static WorkflowsFeature WithDefaultActivityExecutionPipeline(this WorkflowsFeature workflowsFeature, Action<I |
| | | 29 | | { |
| | 172 | 30 | | return workflowsFeature.WithActivityExecutionPipeline(pipeline => |
| | 172 | 31 | | { |
| | 436 | 32 | | pipeline |
| | 436 | 33 | | .UseExceptionHandling() |
| | 436 | 34 | | .UseExecutionLogging() |
| | 436 | 35 | | .UseNotifications() |
| | 436 | 36 | | .UseLogPersistenceModeEvaluation() |
| | 436 | 37 | | .UseBackgroundActivityInvoker(); |
| | 172 | 38 | | |
| | 436 | 39 | | configurePipeline?.Invoke(pipeline); |
| | 172 | 40 | | }); |
| | | 41 | | } |
| | | 42 | | } |