| | | 1 | | using Elsa.Workflows.CommitStates; |
| | | 2 | | using Elsa.Workflows.Features; |
| | | 3 | | |
| | | 4 | | // ReSharper disable once CheckNamespace |
| | | 5 | | namespace Elsa.Extensions; |
| | | 6 | | |
| | | 7 | | /// <summary> |
| | | 8 | | /// Provides extension methods for configuring commit strategies on <see cref="WorkflowsFeature"/>. |
| | | 9 | | /// </summary> |
| | | 10 | | public static class WorkflowsFeatureCommitStateExtensions |
| | | 11 | | { |
| | | 12 | | /// <summary> |
| | | 13 | | /// Configures commit strategies for workflows. |
| | | 14 | | /// </summary> |
| | | 15 | | /// <param name="workflowsFeature">The workflows feature.</param> |
| | | 16 | | /// <param name="configure">An optional configuration delegate for the commit strategies feature.</param> |
| | | 17 | | /// <returns>The workflows feature for chaining.</returns> |
| | | 18 | | public static WorkflowsFeature UseCommitStrategies(this WorkflowsFeature workflowsFeature, Action<CommitStrategiesFe |
| | | 19 | | { |
| | 7 | 20 | | workflowsFeature.Module.Use(configure); |
| | 7 | 21 | | return workflowsFeature; |
| | | 22 | | } |
| | | 23 | | |
| | | 24 | | /// <summary> |
| | | 25 | | /// Sets the specified workflow commit strategy as the global default for all workflows that do not specify their ow |
| | | 26 | | /// The strategy will not be added to the registry and serves only as a fallback. |
| | | 27 | | /// </summary> |
| | | 28 | | /// <param name="workflowsFeature">The workflows feature.</param> |
| | | 29 | | /// <param name="strategy">The workflow commit strategy instance to use as the default.</param> |
| | | 30 | | /// <returns>The workflows feature for chaining.</returns> |
| | | 31 | | public static WorkflowsFeature WithDefaultWorkflowCommitStrategy(this WorkflowsFeature workflowsFeature, IWorkflowCo |
| | | 32 | | { |
| | 0 | 33 | | workflowsFeature.Module.Use<CommitStrategiesFeature>(feature => feature.SetDefaultWorkflowCommitStrategy(strateg |
| | 0 | 34 | | return workflowsFeature; |
| | | 35 | | } |
| | | 36 | | |
| | | 37 | | /// <summary> |
| | | 38 | | /// Sets the specified activity commit strategy as the global default for all activities that do not specify their o |
| | | 39 | | /// The strategy will not be added to the registry and serves only as a fallback. |
| | | 40 | | /// </summary> |
| | | 41 | | /// <param name="workflowsFeature">The workflows feature.</param> |
| | | 42 | | /// <param name="strategy">The activity commit strategy instance to use as the default.</param> |
| | | 43 | | /// <returns>The workflows feature for chaining.</returns> |
| | | 44 | | public static WorkflowsFeature WithDefaultActivityCommitStrategy(this WorkflowsFeature workflowsFeature, IActivityCo |
| | | 45 | | { |
| | 0 | 46 | | workflowsFeature.Module.Use<CommitStrategiesFeature>(feature => feature.SetDefaultActivityCommitStrategy(strateg |
| | 0 | 47 | | return workflowsFeature; |
| | | 48 | | } |
| | | 49 | | } |