| | | 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 Microsoft.Extensions.DependencyInjection; |
| | | 8 | | |
| | | 9 | | namespace Elsa.Workflows.Features; |
| | | 10 | | |
| | | 11 | | /// <summary> |
| | | 12 | | /// Adds support for the Flowchart activity. |
| | | 13 | | /// </summary> |
| | | 14 | | public class FlowchartFeature : FeatureBase |
| | | 15 | | { |
| | | 16 | | /// <inheritdoc /> |
| | 129 | 17 | | public FlowchartFeature(IModule module) : base(module) |
| | | 18 | | { |
| | 129 | 19 | | } |
| | | 20 | | |
| | | 21 | | /// <summary> |
| | | 22 | | /// A delegate to configure <see cref="FlowchartOptions"/>. |
| | | 23 | | /// </summary> |
| | 143 | 24 | | public Action<FlowchartOptions>? FlowchartOptionsConfigurator { get; set; } |
| | | 25 | | |
| | | 26 | | /// <inheritdoc /> |
| | | 27 | | public override void Apply() |
| | | 28 | | { |
| | 129 | 29 | | Services.AddSerializationOptionsConfigurator<FlowchartSerializationOptionConfigurator>(); |
| | | 30 | | |
| | | 31 | | // Register FlowchartOptions |
| | 129 | 32 | | Services.AddOptions<FlowchartOptions>(); |
| | | 33 | | |
| | 129 | 34 | | if (FlowchartOptionsConfigurator != null) |
| | 7 | 35 | | Services.Configure(FlowchartOptionsConfigurator); |
| | 129 | 36 | | } |
| | | 37 | | |
| | | 38 | | public override void Configure() |
| | | 39 | | { |
| | 129 | 40 | | Module.AddTypeAlias<FlowScope>("FlowScope"); |
| | 129 | 41 | | } |
| | | 42 | | } |