| | | 1 | | using Elsa.Extensions; |
| | | 2 | | using Elsa.Features.Abstractions; |
| | | 3 | | using Elsa.Features.Services; |
| | | 4 | | using Elsa.Workflows.Activities.Flowchart.Models; |
| | | 5 | | using Elsa.Workflows.Activities.Flowchart.Options; |
| | | 6 | | using Elsa.Workflows.Activities.Flowchart.Serialization; |
| | | 7 | | using Elsa.Workflows.Options; |
| | | 8 | | using Microsoft.Extensions.DependencyInjection; |
| | | 9 | | using Elsa.Common.Serialization; |
| | | 10 | | |
| | | 11 | | namespace Elsa.Workflows.Features; |
| | | 12 | | |
| | | 13 | | /// <summary> |
| | | 14 | | /// Adds support for the Flowchart activity. |
| | | 15 | | /// </summary> |
| | | 16 | | public class FlowchartFeature : FeatureBase |
| | | 17 | | { |
| | | 18 | | /// <inheritdoc /> |
| | 126 | 19 | | public FlowchartFeature(IModule module) : base(module) |
| | | 20 | | { |
| | 126 | 21 | | } |
| | | 22 | | |
| | | 23 | | /// <summary> |
| | | 24 | | /// A delegate to configure <see cref="FlowchartOptions"/>. |
| | | 25 | | /// </summary> |
| | 132 | 26 | | public Action<FlowchartOptions>? FlowchartOptionsConfigurator { get; set; } |
| | | 27 | | |
| | | 28 | | /// <inheritdoc /> |
| | | 29 | | public override void Apply() |
| | | 30 | | { |
| | 126 | 31 | | Services.AddSerializationOptionsConfigurator<FlowchartSerializationOptionConfigurator>(); |
| | | 32 | | |
| | | 33 | | // Register FlowchartOptions |
| | 126 | 34 | | Services.AddOptions<FlowchartOptions>(); |
| | | 35 | | |
| | 126 | 36 | | if (FlowchartOptionsConfigurator != null) |
| | 3 | 37 | | Services.Configure(FlowchartOptionsConfigurator); |
| | | 38 | | |
| | 252 | 39 | | Services.Configure<SerializationTypeOptions>(options => options.AddTypeAlias<FlowScope>("FlowScope")); |
| | 126 | 40 | | } |
| | | 41 | | } |