| | | 1 | | using Bpmn.Interchange; |
| | | 2 | | using Elsa.Bpmn.Features; |
| | | 3 | | using Elsa.Bpmn.Interchange.Binding; |
| | | 4 | | using Elsa.Bpmn.Interchange.Handlers.Notifications; |
| | | 5 | | using Elsa.Bpmn.Interchange.Services; |
| | | 6 | | using Elsa.Extensions; |
| | | 7 | | using Elsa.Features.Abstractions; |
| | | 8 | | using Elsa.Features.Attributes; |
| | | 9 | | using Elsa.Features.Services; |
| | | 10 | | using Microsoft.Extensions.DependencyInjection; |
| | | 11 | | |
| | | 12 | | namespace Elsa.Bpmn.Interchange.Features; |
| | | 13 | | |
| | | 14 | | /// <summary> |
| | | 15 | | /// Provides BPMN XML interchange support to the system. |
| | | 16 | | /// </summary> |
| | | 17 | | /// <remarks> |
| | | 18 | | /// The task-to-activity binding this module reads lives inside the BPMN document as an <c>elsa:</c> vendor extension, |
| | | 19 | | /// so an exported <c>.bpmn</c> carries binding configuration — including input expressions — verbatim. Exporting a |
| | | 20 | | /// process discloses its implementation detail; see <see cref="BpmnActivityBindingFormat"/> for the format and for why |
| | | 21 | | /// nothing is redacted. |
| | | 22 | | /// </remarks> |
| | | 23 | | [DependsOn(typeof(BpmnFeature))] |
| | | 24 | | public class BpmnInterchangeFeature : FeatureBase |
| | | 25 | | { |
| | | 26 | | /// <inheritdoc /> |
| | 54 | 27 | | public BpmnInterchangeFeature(IModule module) : base(module) |
| | | 28 | | { |
| | 54 | 29 | | } |
| | | 30 | | |
| | | 31 | | /// <inheritdoc /> |
| | | 32 | | public override void Configure() |
| | | 33 | | { |
| | 54 | 34 | | Module.AddFastEndpointsAssembly<BpmnInterchangeFeature>(); |
| | 54 | 35 | | } |
| | | 36 | | |
| | | 37 | | /// <inheritdoc /> |
| | | 38 | | public override void Apply() |
| | | 39 | | { |
| | 54 | 40 | | Services.AddSingleton<BpmnActivityBindingFormat>(); |
| | 54 | 41 | | Services.AddSingleton<BpmnWorkBinder>(); |
| | 54 | 42 | | Services.AddSingleton<BpmnXmlReader>(); |
| | 54 | 43 | | Services.AddSingleton<BpmnXmlWriter>(); |
| | 54 | 44 | | Services.AddScoped<BpmnInterchangeDocumentService>(); |
| | 54 | 45 | | Services.AddNotificationHandler<ValidateBpmnProcessBindings>(); |
| | 54 | 46 | | } |
| | | 47 | | } |