| | | 1 | | using Elsa.Features.Attributes; |
| | | 2 | | using Elsa.Features.Services; |
| | | 3 | | using Elsa.KeyValues.Entities; |
| | | 4 | | using Elsa.KeyValues.Features; |
| | | 5 | | using Elsa.Workflows.Runtime.Entities; |
| | | 6 | | using Elsa.Workflows.Runtime.Features; |
| | | 7 | | using Microsoft.Extensions.DependencyInjection; |
| | | 8 | | |
| | | 9 | | namespace Elsa.Persistence.EFCore.Modules.Runtime; |
| | | 10 | | |
| | | 11 | | /// <summary> |
| | | 12 | | /// Configures the default workflow runtime to use EF Core persistence providers. |
| | | 13 | | /// </summary> |
| | | 14 | | [DependsOn(typeof(WorkflowRuntimeFeature))] |
| | 1 | 15 | | public class EFCoreWorkflowRuntimePersistenceFeature(IModule module) : PersistenceFeatureBase<EFCoreWorkflowRuntimePersi |
| | | 16 | | { |
| | | 17 | | /// <inheritdoc /> |
| | | 18 | | public override void Configure() |
| | | 19 | | { |
| | 1 | 20 | | Module.Configure<KeyValueFeature>(feature => |
| | 1 | 21 | | { |
| | 1 | 22 | | feature.KeyValueStore = sp => sp.GetRequiredService<EFCoreKeyValueStore>(); |
| | 2 | 23 | | }); |
| | 1 | 24 | | Module.Configure<WorkflowRuntimeFeature>(feature => |
| | 1 | 25 | | { |
| | 322 | 26 | | feature.TriggerStore = sp => sp.GetRequiredService<EFCoreTriggerStore>(); |
| | 354 | 27 | | feature.BookmarkStore = sp => sp.GetRequiredService<EFCoreBookmarkStore>(); |
| | 352 | 28 | | feature.BookmarkQueueStore = sp => sp.GetRequiredService<EFBookmarkQueueStore>(); |
| | 322 | 29 | | feature.WorkflowExecutionLogStore = sp => sp.GetRequiredService<EFCoreWorkflowExecutionLogStore>(); |
| | 325 | 30 | | feature.ActivityExecutionLogStore = sp => sp.GetRequiredService<EFCoreActivityExecutionStore>(); |
| | 2 | 31 | | }); |
| | 1 | 32 | | } |
| | | 33 | | |
| | | 34 | | /// <inheritdoc /> |
| | | 35 | | public override void Apply() |
| | | 36 | | { |
| | 1 | 37 | | base.Apply(); |
| | 1 | 38 | | AddEntityStore<StoredTrigger, EFCoreTriggerStore>(); |
| | 1 | 39 | | AddStore<StoredBookmark, EFCoreBookmarkStore>(); |
| | 1 | 40 | | AddStore<BookmarkQueueItem, EFBookmarkQueueStore>(); |
| | 1 | 41 | | AddEntityStore<WorkflowExecutionLogRecord, EFCoreWorkflowExecutionLogStore>(); |
| | 1 | 42 | | AddEntityStore<ActivityExecutionRecord, EFCoreActivityExecutionStore>(); |
| | 1 | 43 | | AddStore<SerializedKeyValuePair, EFCoreKeyValueStore>(); |
| | 1 | 44 | | } |
| | | 45 | | } |