diff --git a/src/bundles/Elsa.AllInOne.Web/Program.cs b/src/bundles/Elsa.AllInOne.Web/Program.cs index d948d36c6..398c11102 100644 --- a/src/bundles/Elsa.AllInOne.Web/Program.cs +++ b/src/bundles/Elsa.AllInOne.Web/Program.cs @@ -32,7 +32,6 @@ services runtime.UseEntityFrameworkCore(ef => ef.UseSqlite(sqliteConnectionString)); runtime.UseDefaultRuntime(dr => dr.UseEntityFrameworkCore(ef => ef.UseSqlite(sqliteConnectionString))); runtime.UseExecutionLogRecords(e => e.UseEntityFrameworkCore(ef => ef.UseSqlite(sqliteConnectionString))); - runtime.UseAsyncWorkflowStateExporter(); }) .UseScheduling() .UseJavaScript() diff --git a/src/modules/Elsa.Workflows.Runtime/Features/AsyncWorkflowStateExporterFeature.cs b/src/modules/Elsa.Workflows.Runtime/Features/AsyncWorkflowStateExporterFeature.cs index 2e7968a98..5a53cdf98 100644 --- a/src/modules/Elsa.Workflows.Runtime/Features/AsyncWorkflowStateExporterFeature.cs +++ b/src/modules/Elsa.Workflows.Runtime/Features/AsyncWorkflowStateExporterFeature.cs @@ -24,6 +24,5 @@ public class AsyncWorkflowStateExporterFeature : FeatureBase public override void Configure() { Module.Configure(workflowRuntime => workflowRuntime.WorkflowStateExporter = sp => ActivatorUtilities.CreateInstance(sp)); - Services.AddCommandHandler(); } } \ No newline at end of file diff --git a/src/modules/Elsa.Workflows.Runtime/Features/WorkflowRuntimeFeature.cs b/src/modules/Elsa.Workflows.Runtime/Features/WorkflowRuntimeFeature.cs index 8c86451b8..660318bd0 100644 --- a/src/modules/Elsa.Workflows.Runtime/Features/WorkflowRuntimeFeature.cs +++ b/src/modules/Elsa.Workflows.Runtime/Features/WorkflowRuntimeFeature.cs @@ -74,7 +74,7 @@ public class WorkflowRuntimeFeature : FeatureBase /// /// A factory that instantiates an . /// - public Func WorkflowStateExporter { get; set; } = ActivatorUtilities.GetServiceOrCreateInstance; + public Func WorkflowStateExporter { get; set; } = ActivatorUtilities.GetServiceOrCreateInstance; /// /// A factory that instantiates an . @@ -120,6 +120,9 @@ public class WorkflowRuntimeFeature : FeatureBase { // Activities Module.AddActivitiesFrom(); + + // Add command handler for export workflow state to database. + Services.AddCommandHandler(); } ///