diff --git a/Elsa.sln b/Elsa.sln
index 9ae88f781..f169d04f3 100644
--- a/Elsa.sln
+++ b/Elsa.sln
@@ -62,22 +62,16 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "bundles", "bundles", "{F06B
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa", "src\bundles\Elsa\Elsa.csproj", "{FC5D2CE9-FFB0-478D-8D54-E4109D1FD202}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.AspNetCore", "src\common\Elsa.AspNetCore\Elsa.AspNetCore.csproj", "{C55F7AA0-0803-44CE-9AE4-BF697A1C0195}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Formatting", "src\common\Elsa.Formatting\Elsa.Formatting.csproj", "{60CEE728-3187-481B-B6EA-10D5284D8B55}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Jobs.Abstractions", "src\common\Elsa.Jobs.Abstractions\Elsa.Jobs.Abstractions.csproj", "{2782C593-98CD-4B80-B595-8BAE066DCBC3}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Mediator", "src\common\Elsa.Mediator\Elsa.Mediator.csproj", "{ED3D8BFA-03AC-437F-AE25-1EDB58569099}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.ServiceBus.Abstractions", "src\common\Elsa.ServiceBus.Abstractions\Elsa.ServiceBus.Abstractions.csproj", "{448FCDE6-DE44-4E44-A1CC-B9AA51471121}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Liquid", "src\modules\Elsa.Liquid\Elsa.Liquid.csproj", "{8E5BD3D9-3529-48BC-B741-CFB7A69DB233}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.ProtoActor", "src\modules\Elsa.ProtoActor\Elsa.ProtoActor.csproj", "{B2049499-D384-46DF-8837-F1180107DD54}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Expressions", "src\common\Elsa.Expressions\Elsa.Expressions.csproj", "{042D22D7-35B6-4A72-9FBD-25EF1842B31E}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Dsl", "src\modules\Elsa.Dsl\Elsa.Dsl.csproj", "{78DAB791-8595-4612-8E9E-2248AF5B1862}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Labels.EntityFrameworkCore.Sqlite", "src\modules\Elsa.Labels.EntityFrameworkCore.Sqlite\Elsa.Labels.EntityFrameworkCore.Sqlite.csproj", "{7610CB87-D50B-4E42-AE2C-0733A9A906B0}"
@@ -104,10 +98,16 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Workflows.Persistence.
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Workflows.Runtime", "src\modules\Elsa.Workflows.Runtime\Elsa.Workflows.Runtime.csproj", "{8A050229-DB79-4E0B-9AFF-7565E87F2954}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.ServiceConfiguration", "src\common\Elsa.ServiceConfiguration\Elsa.ServiceConfiguration.csproj", "{C237BA1A-3A7D-4AB2-BE09-2696F3C082A4}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Features", "src\common\Elsa.Features\Elsa.Features.csproj", "{C237BA1A-3A7D-4AB2-BE09-2696F3C082A4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.MemoryCache", "src\modules\Elsa.MemoryCache\Elsa.MemoryCache.csproj", "{2570418D-1674-4DAE-9A24-9146D522450C}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.AspNetCore", "src\modules\Elsa.AspNetCore\Elsa.AspNetCore.csproj", "{2CFF3041-BB6A-45EA-9716-7BA531BA6479}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Expressions", "src\modules\Elsa.Expressions\Elsa.Expressions.csproj", "{80529478-A383-4FEA-B744-C71264969E9A}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Mediator", "src\modules\Elsa.Mediator\Elsa.Mediator.csproj", "{40ED82D8-A7BB-4D37-9157-3176EDA3E119}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -190,10 +190,6 @@ Global
{FC5D2CE9-FFB0-478D-8D54-E4109D1FD202}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FC5D2CE9-FFB0-478D-8D54-E4109D1FD202}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FC5D2CE9-FFB0-478D-8D54-E4109D1FD202}.Release|Any CPU.Build.0 = Release|Any CPU
- {C55F7AA0-0803-44CE-9AE4-BF697A1C0195}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {C55F7AA0-0803-44CE-9AE4-BF697A1C0195}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {C55F7AA0-0803-44CE-9AE4-BF697A1C0195}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {C55F7AA0-0803-44CE-9AE4-BF697A1C0195}.Release|Any CPU.Build.0 = Release|Any CPU
{60CEE728-3187-481B-B6EA-10D5284D8B55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{60CEE728-3187-481B-B6EA-10D5284D8B55}.Debug|Any CPU.Build.0 = Debug|Any CPU
{60CEE728-3187-481B-B6EA-10D5284D8B55}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -202,10 +198,6 @@ Global
{2782C593-98CD-4B80-B595-8BAE066DCBC3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2782C593-98CD-4B80-B595-8BAE066DCBC3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2782C593-98CD-4B80-B595-8BAE066DCBC3}.Release|Any CPU.Build.0 = Release|Any CPU
- {ED3D8BFA-03AC-437F-AE25-1EDB58569099}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {ED3D8BFA-03AC-437F-AE25-1EDB58569099}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {ED3D8BFA-03AC-437F-AE25-1EDB58569099}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {ED3D8BFA-03AC-437F-AE25-1EDB58569099}.Release|Any CPU.Build.0 = Release|Any CPU
{448FCDE6-DE44-4E44-A1CC-B9AA51471121}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{448FCDE6-DE44-4E44-A1CC-B9AA51471121}.Debug|Any CPU.Build.0 = Debug|Any CPU
{448FCDE6-DE44-4E44-A1CC-B9AA51471121}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -218,10 +210,6 @@ Global
{B2049499-D384-46DF-8837-F1180107DD54}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B2049499-D384-46DF-8837-F1180107DD54}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B2049499-D384-46DF-8837-F1180107DD54}.Release|Any CPU.Build.0 = Release|Any CPU
- {042D22D7-35B6-4A72-9FBD-25EF1842B31E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {042D22D7-35B6-4A72-9FBD-25EF1842B31E}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {042D22D7-35B6-4A72-9FBD-25EF1842B31E}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {042D22D7-35B6-4A72-9FBD-25EF1842B31E}.Release|Any CPU.Build.0 = Release|Any CPU
{78DAB791-8595-4612-8E9E-2248AF5B1862}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{78DAB791-8595-4612-8E9E-2248AF5B1862}.Debug|Any CPU.Build.0 = Debug|Any CPU
{78DAB791-8595-4612-8E9E-2248AF5B1862}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -282,6 +270,18 @@ Global
{2570418D-1674-4DAE-9A24-9146D522450C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2570418D-1674-4DAE-9A24-9146D522450C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2570418D-1674-4DAE-9A24-9146D522450C}.Release|Any CPU.Build.0 = Release|Any CPU
+ {2CFF3041-BB6A-45EA-9716-7BA531BA6479}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {2CFF3041-BB6A-45EA-9716-7BA531BA6479}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {2CFF3041-BB6A-45EA-9716-7BA531BA6479}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {2CFF3041-BB6A-45EA-9716-7BA531BA6479}.Release|Any CPU.Build.0 = Release|Any CPU
+ {80529478-A383-4FEA-B744-C71264969E9A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {80529478-A383-4FEA-B744-C71264969E9A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {80529478-A383-4FEA-B744-C71264969E9A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {80529478-A383-4FEA-B744-C71264969E9A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {40ED82D8-A7BB-4D37-9157-3176EDA3E119}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {40ED82D8-A7BB-4D37-9157-3176EDA3E119}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {40ED82D8-A7BB-4D37-9157-3176EDA3E119}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {40ED82D8-A7BB-4D37-9157-3176EDA3E119}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{155227F0-A33B-40AA-A4B4-06F813EB921B} = {61017E64-6D00-49CB-9E81-5002DC8F7D5F}
@@ -298,12 +298,9 @@ Global
{6B80C8AC-E9E7-43FD-B514-C0D801D15792} = {90031D64-CA0F-46D0-9AF4-8DC023A5FFCD}
{177F4FF3-4618-4CB1-BA93-8B024BC64CD8} = {56C2FFB8-EA54-45B5-A095-4A78142EB4B5}
{F06B9573-DF68-4606-866C-A7546A10A05A} = {61017E64-6D00-49CB-9E81-5002DC8F7D5F}
- {C55F7AA0-0803-44CE-9AE4-BF697A1C0195} = {C6658DE0-2B2F-47F0-BB61-2CA66D435C09}
{60CEE728-3187-481B-B6EA-10D5284D8B55} = {C6658DE0-2B2F-47F0-BB61-2CA66D435C09}
{2782C593-98CD-4B80-B595-8BAE066DCBC3} = {C6658DE0-2B2F-47F0-BB61-2CA66D435C09}
- {ED3D8BFA-03AC-437F-AE25-1EDB58569099} = {C6658DE0-2B2F-47F0-BB61-2CA66D435C09}
{448FCDE6-DE44-4E44-A1CC-B9AA51471121} = {C6658DE0-2B2F-47F0-BB61-2CA66D435C09}
- {042D22D7-35B6-4A72-9FBD-25EF1842B31E} = {C6658DE0-2B2F-47F0-BB61-2CA66D435C09}
{B2049499-D384-46DF-8837-F1180107DD54} = {5BA4A8FA-F7F4-45B3-AEC8-8886D35AAC79}
{FC5D2CE9-FFB0-478D-8D54-E4109D1FD202} = {F06B9573-DF68-4606-866C-A7546A10A05A}
{E31F8955-B221-48AA-B301-6EE317D6F5B1} = {F06B9573-DF68-4606-866C-A7546A10A05A}
@@ -332,5 +329,8 @@ Global
{8A050229-DB79-4E0B-9AFF-7565E87F2954} = {5BA4A8FA-F7F4-45B3-AEC8-8886D35AAC79}
{C237BA1A-3A7D-4AB2-BE09-2696F3C082A4} = {C6658DE0-2B2F-47F0-BB61-2CA66D435C09}
{2570418D-1674-4DAE-9A24-9146D522450C} = {5BA4A8FA-F7F4-45B3-AEC8-8886D35AAC79}
+ {2CFF3041-BB6A-45EA-9716-7BA531BA6479} = {5BA4A8FA-F7F4-45B3-AEC8-8886D35AAC79}
+ {80529478-A383-4FEA-B744-C71264969E9A} = {5BA4A8FA-F7F4-45B3-AEC8-8886D35AAC79}
+ {40ED82D8-A7BB-4D37-9157-3176EDA3E119} = {5BA4A8FA-F7F4-45B3-AEC8-8886D35AAC79}
EndGlobalSection
EndGlobal
diff --git a/src/bundles/Elsa.AllInOne.Web/Elsa.AllInOne.Web.csproj b/src/bundles/Elsa.AllInOne.Web/Elsa.AllInOne.Web.csproj
index c90b22ab7..cf6669e63 100644
--- a/src/bundles/Elsa.AllInOne.Web/Elsa.AllInOne.Web.csproj
+++ b/src/bundles/Elsa.AllInOne.Web/Elsa.AllInOne.Web.csproj
@@ -9,7 +9,7 @@
-
+
diff --git a/src/bundles/Elsa.WorkflowServer.Web/Elsa.WorkflowServer.Web.csproj b/src/bundles/Elsa.WorkflowServer.Web/Elsa.WorkflowServer.Web.csproj
index 20ec8a477..900855312 100644
--- a/src/bundles/Elsa.WorkflowServer.Web/Elsa.WorkflowServer.Web.csproj
+++ b/src/bundles/Elsa.WorkflowServer.Web/Elsa.WorkflowServer.Web.csproj
@@ -9,7 +9,7 @@
-
+
diff --git a/src/bundles/Elsa.WorkflowServer.Web/Program.cs b/src/bundles/Elsa.WorkflowServer.Web/Program.cs
index 429ce4a59..94817d78e 100644
--- a/src/bundles/Elsa.WorkflowServer.Web/Program.cs
+++ b/src/bundles/Elsa.WorkflowServer.Web/Program.cs
@@ -46,7 +46,7 @@ services
.AddActivity()
.AddActivity()
)
- .UsePersistence(p => p.UseEntityFrameworkCore(ef => ef.UseSqlite()))
+ .UseWorkflowPersistence(p => p.UseEntityFrameworkCore(ef => ef.UseSqlite()))
.UseJavaScript()
.UseLiquid()
.UseLabels(labels => labels.UseEntityFrameworkCore(ef => ef.UseSqlite()))
diff --git a/src/bundles/Elsa/Configuration/ElsaConfigurator.cs b/src/bundles/Elsa/Configuration/ElsaConfigurator.cs
deleted file mode 100644
index 9b31ac095..000000000
--- a/src/bundles/Elsa/Configuration/ElsaConfigurator.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using Elsa.Mediator.Configuration;
-using Elsa.ServiceConfiguration.Abstractions;
-using Elsa.ServiceConfiguration.Attributes;
-using Elsa.ServiceConfiguration.Services;
-using Elsa.Workflows.Core.Configuration;
-using Elsa.Workflows.Management.Configuration;
-using Elsa.Workflows.Persistence.Configuration;
-using Elsa.Workflows.Runtime.Configuration;
-
-namespace Elsa.Configuration;
-
-[Dependency(typeof(MediatorConfigurator))]
-[Dependency(typeof(WorkflowsConfigurator))]
-[Dependency(typeof(WorkflowPersistenceConfigurator))]
-[Dependency(typeof(WorkflowRuntimeConfigurator))]
-[Dependency(typeof(WorkflowManagementConfigurator))]
-public class ElsaConfigurator : ConfiguratorBase
-{
- public ElsaConfigurator(IServiceConfiguration serviceConfiguration) : base(serviceConfiguration)
- {
- }
-}
\ No newline at end of file
diff --git a/src/bundles/Elsa/Elsa.csproj b/src/bundles/Elsa/Elsa.csproj
index 5960567b8..bb94de332 100644
--- a/src/bundles/Elsa/Elsa.csproj
+++ b/src/bundles/Elsa/Elsa.csproj
@@ -14,7 +14,7 @@
-
+
diff --git a/src/bundles/Elsa/Extensions/DependencyInjectionExtensions.cs b/src/bundles/Elsa/Extensions/DependencyInjectionExtensions.cs
index bf2d44eab..186eb19a1 100644
--- a/src/bundles/Elsa/Extensions/DependencyInjectionExtensions.cs
+++ b/src/bundles/Elsa/Extensions/DependencyInjectionExtensions.cs
@@ -1,14 +1,14 @@
using System;
-using Elsa.Configuration;
-using Elsa.ServiceConfiguration.Extensions;
-using Elsa.ServiceConfiguration.Services;
+using Elsa.Features;
+using Elsa.Features.Extensions;
+using Elsa.Features.Services;
using Microsoft.Extensions.DependencyInjection;
namespace Elsa.Extensions;
public static class DependencyInjectionExtensions
{
- public static IServiceCollection AddElsa(this IServiceCollection services, Action? configure = default)
+ public static IServiceCollection AddElsa(this IServiceCollection services, Action? configure = default)
{
var serviceConfiguration = services.ConfigureElsa();
configure?.Invoke(serviceConfiguration);
@@ -16,11 +16,11 @@ public static class DependencyInjectionExtensions
return services;
}
- public static IServiceConfiguration ConfigureElsa(this IServiceCollection services)
+ public static IModule ConfigureElsa(this IServiceCollection services)
{
- var serviceConfiguration = services.ConfigureServices();
- serviceConfiguration.Configure();
+ var module = services.CreateModule();
+ module.Configure();
- return serviceConfiguration;
+ return module;
}
}
\ No newline at end of file
diff --git a/src/bundles/Elsa/Features/ElsaFeature.cs b/src/bundles/Elsa/Features/ElsaFeature.cs
new file mode 100644
index 000000000..c6b7a61aa
--- /dev/null
+++ b/src/bundles/Elsa/Features/ElsaFeature.cs
@@ -0,0 +1,22 @@
+using Elsa.Features.Abstractions;
+using Elsa.Features.Attributes;
+using Elsa.Features.Services;
+using Elsa.Mediator.Features;
+using Elsa.Workflows.Core.Features;
+using Elsa.Workflows.Management.Features;
+using Elsa.Workflows.Persistence.Features;
+using Elsa.Workflows.Runtime.Features;
+
+namespace Elsa.Features;
+
+[DependsOn(typeof(MediatorFeature))]
+[DependsOn(typeof(WorkflowsFeature))]
+[DependsOn(typeof(WorkflowPersistenceFeature))]
+[DependsOn(typeof(WorkflowRuntimeFeature))]
+[DependsOn(typeof(WorkflowManagementFeature))]
+public class ElsaFeature : FeatureBase
+{
+ public ElsaFeature(IModule module) : base(module)
+ {
+ }
+}
\ No newline at end of file
diff --git a/src/common/Elsa.AspNetCore/Configuration/MvcConfigurator.cs b/src/common/Elsa.AspNetCore/Configuration/MvcConfigurator.cs
deleted file mode 100644
index 7004a0b48..000000000
--- a/src/common/Elsa.AspNetCore/Configuration/MvcConfigurator.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-using Elsa.AspNetCore.Conventions;
-using Elsa.ServiceConfiguration.Abstractions;
-using Elsa.ServiceConfiguration.Services;
-using Microsoft.Extensions.DependencyInjection;
-
-namespace Elsa.AspNetCore.Configuration;
-
-public class MvcConfigurator : ConfiguratorBase
-{
- public MvcConfigurator(IServiceConfiguration serviceConfiguration) : base(serviceConfiguration)
- {
- }
-
- public override void Configure()
- {
- Services.AddMvc(mvc => mvc.Conventions.Add(new ApiEndpointAttributeConvention()));
- }
-}
\ No newline at end of file
diff --git a/src/common/Elsa.AspNetCore/Extensions/DependencyInjectionExtensions.cs b/src/common/Elsa.AspNetCore/Extensions/DependencyInjectionExtensions.cs
deleted file mode 100644
index 71909a675..000000000
--- a/src/common/Elsa.AspNetCore/Extensions/DependencyInjectionExtensions.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using Elsa.AspNetCore.Configuration;
-using Elsa.ServiceConfiguration.Services;
-
-namespace Elsa.AspNetCore.Extensions;
-
-public static class DependencyInjectionExtensions
-{
- public static IServiceConfiguration UseMvc(this IServiceConfiguration configuration, Action? configure = default)
- {
- configuration.Configure(configure);
- return configuration;
- }
-}
\ No newline at end of file
diff --git a/src/common/Elsa.Features/Abstractions/FeatureBase.cs b/src/common/Elsa.Features/Abstractions/FeatureBase.cs
new file mode 100644
index 000000000..ffcd53056
--- /dev/null
+++ b/src/common/Elsa.Features/Abstractions/FeatureBase.cs
@@ -0,0 +1,27 @@
+using Elsa.Features.Services;
+using Microsoft.Extensions.DependencyInjection;
+
+namespace Elsa.Features.Abstractions;
+
+public abstract class FeatureBase : IFeature
+{
+ protected FeatureBase(IModule module)
+ {
+ Module = module;
+ }
+
+ public IModule Module { get; }
+ public IServiceCollection Services => Module.Services;
+
+ public virtual void Configure()
+ {
+ }
+
+ public virtual void ConfigureHostedServices()
+ {
+ }
+
+ public virtual void Apply()
+ {
+ }
+}
\ No newline at end of file
diff --git a/src/common/Elsa.ServiceConfiguration/Attributes/DependencyAttribute.cs b/src/common/Elsa.Features/Attributes/DependsOn.cs
similarity index 64%
rename from src/common/Elsa.ServiceConfiguration/Attributes/DependencyAttribute.cs
rename to src/common/Elsa.Features/Attributes/DependsOn.cs
index de46ac73c..e987ccc52 100644
--- a/src/common/Elsa.ServiceConfiguration/Attributes/DependencyAttribute.cs
+++ b/src/common/Elsa.Features/Attributes/DependsOn.cs
@@ -1,9 +1,9 @@
-namespace Elsa.ServiceConfiguration.Attributes;
+namespace Elsa.Features.Attributes;
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
-public class DependencyAttribute : Attribute
+public class DependsOn : Attribute
{
- public DependencyAttribute(Type type)
+ public DependsOn(Type type)
{
Type = type;
}
diff --git a/src/common/Elsa.ServiceConfiguration/Elsa.ServiceConfiguration.csproj b/src/common/Elsa.Features/Elsa.Features.csproj
similarity index 100%
rename from src/common/Elsa.ServiceConfiguration/Elsa.ServiceConfiguration.csproj
rename to src/common/Elsa.Features/Elsa.Features.csproj
diff --git a/src/common/Elsa.Features/Extensions/DependencyInjectionExtensions.cs b/src/common/Elsa.Features/Extensions/DependencyInjectionExtensions.cs
new file mode 100644
index 000000000..e9e6dc96a
--- /dev/null
+++ b/src/common/Elsa.Features/Extensions/DependencyInjectionExtensions.cs
@@ -0,0 +1,10 @@
+using Elsa.Features.Implementations;
+using Elsa.Features.Services;
+using Microsoft.Extensions.DependencyInjection;
+
+namespace Elsa.Features.Extensions;
+
+public static class DependencyInjectionExtensions
+{
+ public static IModule CreateModule(this IServiceCollection services) => new Module(services);
+}
\ No newline at end of file
diff --git a/src/common/Elsa.ServiceConfiguration/Implementations/ServiceConfiguration.cs b/src/common/Elsa.Features/Implementations/Module.cs
similarity index 69%
rename from src/common/Elsa.ServiceConfiguration/Implementations/ServiceConfiguration.cs
rename to src/common/Elsa.Features/Implementations/Module.cs
index 000da9019..9faf8ff41 100644
--- a/src/common/Elsa.ServiceConfiguration/Implementations/ServiceConfiguration.cs
+++ b/src/common/Elsa.Features/Implementations/Module.cs
@@ -1,29 +1,29 @@
using System.Reflection;
-using Elsa.ServiceConfiguration.Attributes;
-using Elsa.ServiceConfiguration.Services;
+using Elsa.Features.Attributes;
+using Elsa.Features.Services;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Hosting;
-namespace Elsa.ServiceConfiguration.Implementations;
+namespace Elsa.Features.Implementations;
-public class ServiceConfiguration : IServiceConfiguration
+public class Module : IModule
{
private record HostedServiceDescriptor(int Order, Type HostedServiceType);
- private readonly ISet _configurators = new HashSet();
+ private readonly ISet _configurators = new HashSet();
private readonly ICollection _hostedServiceDescriptors = new List();
- public ServiceConfiguration(IServiceCollection services)
+ public Module(IServiceCollection services)
{
Services = services;
}
public IServiceCollection Services { get; }
- public T Configure(Action? configure = default) where T : class, IConfigurator => Configure(serviceConfiguration => (T)Activator.CreateInstance(typeof(T), serviceConfiguration)!, configure);
+ public T Configure(Action? configure = default) where T : class, IFeature => Configure(serviceConfiguration => (T)Activator.CreateInstance(typeof(T), serviceConfiguration)!, configure);
- public T Configure(Func factory, Action? configure = default) where T : class, IConfigurator
+ public T Configure(Func factory, Action? configure = default) where T : class, IFeature
{
if (_configurators.FirstOrDefault(x => x is T) is not T configurator)
{
@@ -35,7 +35,7 @@ public class ServiceConfiguration : IServiceConfiguration
return configurator;
}
- public IServiceConfiguration ConfigureHostedService(int priority = 0)
+ public IModule ConfigureHostedService(int priority = 0)
{
_hostedServiceDescriptors.Add(new HostedServiceDescriptor(priority, typeof(T)));
return this;
@@ -68,9 +68,9 @@ public class ServiceConfiguration : IServiceConfiguration
ResolveDependencies(configurator, resolvedDependencyTypes);
}
- private void ResolveDependencies(IConfigurator configurator, ISet resolvedDependencyTypes)
+ private void ResolveDependencies(IFeature feature, ISet resolvedDependencyTypes)
{
- var dependencyTypes = configurator.GetType().GetCustomAttributes().Select(x => x.Type).ToHashSet();
+ var dependencyTypes = feature.GetType().GetCustomAttributes().Select(x => x.Type).ToHashSet();
dependencyTypes = dependencyTypes.Except(resolvedDependencyTypes).ToHashSet();
foreach (var type in dependencyTypes)
@@ -81,14 +81,14 @@ public class ServiceConfiguration : IServiceConfiguration
}
}
- private IConfigurator AddConfigurator(Type type)
+ private IFeature AddConfigurator(Type type)
{
var configurator = _configurators.FirstOrDefault(x => x.GetType() == type);
if (configurator != null)
return configurator;
- configurator = (IConfigurator)Activator.CreateInstance(type, this)!;
+ configurator = (IFeature)Activator.CreateInstance(type, this)!;
_configurators.Add(configurator);
return configurator;
}
diff --git a/src/common/Elsa.Features/Services/IFeature.cs b/src/common/Elsa.Features/Services/IFeature.cs
new file mode 100644
index 000000000..786971f5f
--- /dev/null
+++ b/src/common/Elsa.Features/Services/IFeature.cs
@@ -0,0 +1,10 @@
+namespace Elsa.Features.Services;
+
+public interface IFeature
+{
+ IModule Module { get; }
+ void Configure();
+ void ConfigureHostedServices();
+ void Apply();
+
+}
\ No newline at end of file
diff --git a/src/common/Elsa.Features/Services/IModule.cs b/src/common/Elsa.Features/Services/IModule.cs
new file mode 100644
index 000000000..79b283bee
--- /dev/null
+++ b/src/common/Elsa.Features/Services/IModule.cs
@@ -0,0 +1,12 @@
+using Microsoft.Extensions.DependencyInjection;
+
+namespace Elsa.Features.Services;
+
+public interface IModule
+{
+ IServiceCollection Services { get; }
+ T Configure(Action? configure = default) where T : class, IFeature;
+ T Configure(Func factory, Action? configure = default) where T : class, IFeature;
+ IModule ConfigureHostedService(int priority = 0);
+ void Apply();
+}
\ No newline at end of file
diff --git a/src/common/Elsa.Mediator/Configuration/MediatorConfigurator.cs b/src/common/Elsa.Mediator/Configuration/MediatorConfigurator.cs
deleted file mode 100644
index 80d3c35cb..000000000
--- a/src/common/Elsa.Mediator/Configuration/MediatorConfigurator.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using Elsa.Mediator.Extensions;
-using Elsa.ServiceConfiguration.Abstractions;
-using Elsa.ServiceConfiguration.Services;
-
-namespace Elsa.Mediator.Configuration;
-
-public class MediatorConfigurator : ConfiguratorBase
-{
- public MediatorConfigurator(IServiceConfiguration serviceConfiguration) : base(serviceConfiguration)
- {
- }
-
- public override void Apply()
- {
- Services.AddMediator();
- }
-}
\ No newline at end of file
diff --git a/src/common/Elsa.Persistence.EntityFrameworkCore.Common/Abstractions/EFCorePersistenceConfigurator.cs b/src/common/Elsa.Persistence.EntityFrameworkCore.Common/Abstractions/EFCorePersistenceFeature.cs
similarity index 67%
rename from src/common/Elsa.Persistence.EntityFrameworkCore.Common/Abstractions/EFCorePersistenceConfigurator.cs
rename to src/common/Elsa.Persistence.EntityFrameworkCore.Common/Abstractions/EFCorePersistenceFeature.cs
index d5dd51d97..b442827c0 100644
--- a/src/common/Elsa.Persistence.EntityFrameworkCore.Common/Abstractions/EFCorePersistenceConfigurator.cs
+++ b/src/common/Elsa.Persistence.EntityFrameworkCore.Common/Abstractions/EFCorePersistenceFeature.cs
@@ -2,16 +2,16 @@ using Elsa.Persistence.Common.Entities;
using Elsa.Persistence.EntityFrameworkCore.Common.HostedServices;
using Elsa.Persistence.EntityFrameworkCore.Common.Implementations;
using Elsa.Persistence.EntityFrameworkCore.Common.Services;
-using Elsa.ServiceConfiguration.Abstractions;
-using Elsa.ServiceConfiguration.Services;
+using Elsa.Features.Abstractions;
+using Elsa.Features.Services;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
namespace Elsa.Persistence.EntityFrameworkCore.Common.Abstractions;
-public abstract class EFCorePersistenceConfigurator : ConfiguratorBase where TDbContext : DbContext
+public abstract class EFCorePersistenceFeature : FeatureBase where TDbContext : DbContext
{
- protected EFCorePersistenceConfigurator(IServiceConfiguration serviceConfiguration) : base(serviceConfiguration)
+ protected EFCorePersistenceFeature(IModule module) : base(module)
{
}
@@ -20,19 +20,19 @@ public abstract class EFCorePersistenceConfigurator : ConfiguratorBa
public ServiceLifetime DbContextFactoryLifetime { get; set; } = ServiceLifetime.Singleton;
public Action DbContextOptionsBuilderAction = (_, _) => { };
- public EFCorePersistenceConfigurator WithContextPooling(bool enabled = true)
+ public EFCorePersistenceFeature WithContextPooling(bool enabled = true)
{
ContextPoolingIsEnabled = enabled;
return this;
}
- public EFCorePersistenceConfigurator AutoRunMigrations(bool enabled = true)
+ public EFCorePersistenceFeature AutoRunMigrations(bool enabled = true)
{
AutoRunMigrationsIsEnabled = enabled;
return this;
}
- public EFCorePersistenceConfigurator ConfigureDbContextOptions(Action configure)
+ public EFCorePersistenceFeature ConfigureDbContextOptions(Action configure)
{
DbContextOptionsBuilderAction = configure;
return this;
@@ -41,7 +41,7 @@ public abstract class EFCorePersistenceConfigurator : ConfiguratorBa
public override void ConfigureHostedServices()
{
if (AutoRunMigrationsIsEnabled)
- ServiceConfiguration.ConfigureHostedService>(-1); // Migrations need to run before other hosted services that depend on DB access.
+ Module.ConfigureHostedService>(-1); // Migrations need to run before other hosted services that depend on DB access.
}
public override void Apply()
diff --git a/src/common/Elsa.Persistence.EntityFrameworkCore.Common/Elsa.Persistence.EntityFrameworkCore.Common.csproj b/src/common/Elsa.Persistence.EntityFrameworkCore.Common/Elsa.Persistence.EntityFrameworkCore.Common.csproj
index 2106561ba..f7706a01f 100644
--- a/src/common/Elsa.Persistence.EntityFrameworkCore.Common/Elsa.Persistence.EntityFrameworkCore.Common.csproj
+++ b/src/common/Elsa.Persistence.EntityFrameworkCore.Common/Elsa.Persistence.EntityFrameworkCore.Common.csproj
@@ -24,7 +24,7 @@
-
+
diff --git a/src/common/Elsa.ServiceConfiguration/Abstractions/ConfiguratorBase.cs b/src/common/Elsa.ServiceConfiguration/Abstractions/ConfiguratorBase.cs
deleted file mode 100644
index 1487ebcc7..000000000
--- a/src/common/Elsa.ServiceConfiguration/Abstractions/ConfiguratorBase.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-using Elsa.ServiceConfiguration.Services;
-using Microsoft.Extensions.DependencyInjection;
-
-namespace Elsa.ServiceConfiguration.Abstractions;
-
-public abstract class ConfiguratorBase : IConfigurator
-{
- protected ConfiguratorBase(IServiceConfiguration serviceConfiguration)
- {
- ServiceConfiguration = serviceConfiguration;
- }
-
- public IServiceConfiguration ServiceConfiguration { get; }
- public IServiceCollection Services => ServiceConfiguration.Services;
-
- public virtual void Configure()
- {
- }
-
- public virtual void ConfigureHostedServices()
- {
- }
-
- public virtual void Apply()
- {
- }
-}
\ No newline at end of file
diff --git a/src/common/Elsa.ServiceConfiguration/Extensions/DependencyInjectionExtensions.cs b/src/common/Elsa.ServiceConfiguration/Extensions/DependencyInjectionExtensions.cs
deleted file mode 100644
index 84810bdc8..000000000
--- a/src/common/Elsa.ServiceConfiguration/Extensions/DependencyInjectionExtensions.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-using Elsa.ServiceConfiguration.Services;
-using Microsoft.Extensions.DependencyInjection;
-
-namespace Elsa.ServiceConfiguration.Extensions;
-
-public static class DependencyInjectionExtensions
-{
- public static IServiceConfiguration ConfigureServices(this IServiceCollection services) =>
- new ServiceConfiguration.Implementations.ServiceConfiguration(services);
-}
\ No newline at end of file
diff --git a/src/common/Elsa.ServiceConfiguration/Services/IConfigurator.cs b/src/common/Elsa.ServiceConfiguration/Services/IConfigurator.cs
deleted file mode 100644
index c4fa10d96..000000000
--- a/src/common/Elsa.ServiceConfiguration/Services/IConfigurator.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-namespace Elsa.ServiceConfiguration.Services;
-
-public interface IConfigurator
-{
- IServiceConfiguration ServiceConfiguration { get; }
- void Configure();
- void ConfigureHostedServices();
- void Apply();
-
-}
\ No newline at end of file
diff --git a/src/common/Elsa.ServiceConfiguration/Services/IServiceConfiguration.cs b/src/common/Elsa.ServiceConfiguration/Services/IServiceConfiguration.cs
deleted file mode 100644
index d09a895bb..000000000
--- a/src/common/Elsa.ServiceConfiguration/Services/IServiceConfiguration.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-using Microsoft.Extensions.DependencyInjection;
-
-namespace Elsa.ServiceConfiguration.Services;
-
-public interface IServiceConfiguration
-{
- IServiceCollection Services { get; }
- T Configure(Action? configure = default) where T : class, IConfigurator;
- T Configure(Func factory, Action? configure = default) where T : class, IConfigurator;
- IServiceConfiguration ConfigureHostedService(int priority = 0);
- void Apply();
-}
\ No newline at end of file
diff --git a/src/designer/elsa-workflows-designer/src/modules/labels/labels-widget.tsx b/src/designer/elsa-workflows-designer/src/modules/labels/labels-widget.tsx
index c9ead1ec6..dcb0cedfc 100644
--- a/src/designer/elsa-workflows-designer/src/modules/labels/labels-widget.tsx
+++ b/src/designer/elsa-workflows-designer/src/modules/labels/labels-widget.tsx
@@ -27,7 +27,6 @@ export class LabelsWidget {
private refreshWorkflowProperties: () => void;
private definitionVersionId: string;
-
constructor() {
this.eventBus = Container.get(EventBus);
this.workflowDefinitionManager = Container.get(WorkflowDefinitionManager);
@@ -97,6 +96,13 @@ export class LabelsWidget {
private onWorkflowDefinitionImported = async (e: WorkflowDefinitionImportedArgs) => {
const workflowDefinition = e.workflowDefinition;
+
+ if (isNullOrWhitespace(workflowDefinition.id)) {
+ this.definitionVersionId = null;
+ this.assignedLabelIds = [];
+ return;
+ }
+
const assignedLabelIds = await this.workflowDefinitionLabelsApi.get(workflowDefinition.id);
this.assignedLabelIds = assignedLabelIds;
this.definitionVersionId = workflowDefinition.id;
diff --git a/src/common/Elsa.AspNetCore/Attributes/ApiEndpointAttribute.cs b/src/modules/Elsa.AspNetCore/Attributes/ApiEndpointAttribute.cs
similarity index 100%
rename from src/common/Elsa.AspNetCore/Attributes/ApiEndpointAttribute.cs
rename to src/modules/Elsa.AspNetCore/Attributes/ApiEndpointAttribute.cs
diff --git a/src/common/Elsa.AspNetCore/Conventions/ApiEndpointAttributeConvention.cs b/src/modules/Elsa.AspNetCore/Conventions/ApiEndpointAttributeConvention.cs
similarity index 100%
rename from src/common/Elsa.AspNetCore/Conventions/ApiEndpointAttributeConvention.cs
rename to src/modules/Elsa.AspNetCore/Conventions/ApiEndpointAttributeConvention.cs
diff --git a/src/common/Elsa.AspNetCore/Elsa.AspNetCore.csproj b/src/modules/Elsa.AspNetCore/Elsa.AspNetCore.csproj
similarity index 84%
rename from src/common/Elsa.AspNetCore/Elsa.AspNetCore.csproj
rename to src/modules/Elsa.AspNetCore/Elsa.AspNetCore.csproj
index 9e7837d75..b4b19d41b 100644
--- a/src/common/Elsa.AspNetCore/Elsa.AspNetCore.csproj
+++ b/src/modules/Elsa.AspNetCore/Elsa.AspNetCore.csproj
@@ -13,7 +13,7 @@
-
+
diff --git a/src/modules/Elsa.AspNetCore/Extensions/DependencyInjectionExtensions.cs b/src/modules/Elsa.AspNetCore/Extensions/DependencyInjectionExtensions.cs
new file mode 100644
index 000000000..352550c6a
--- /dev/null
+++ b/src/modules/Elsa.AspNetCore/Extensions/DependencyInjectionExtensions.cs
@@ -0,0 +1,13 @@
+using Elsa.AspNetCore.Features;
+using Elsa.Features.Services;
+
+namespace Elsa.AspNetCore.Extensions;
+
+public static class DependencyInjectionExtensions
+{
+ public static IModule UseMvc(this IModule configuration, Action? configure = default)
+ {
+ configuration.Configure(configure);
+ return configuration;
+ }
+}
\ No newline at end of file
diff --git a/src/common/Elsa.AspNetCore/Extensions/MvcBuilderExtensions.cs b/src/modules/Elsa.AspNetCore/Extensions/MvcBuilderExtensions.cs
similarity index 100%
rename from src/common/Elsa.AspNetCore/Extensions/MvcBuilderExtensions.cs
rename to src/modules/Elsa.AspNetCore/Extensions/MvcBuilderExtensions.cs
diff --git a/src/modules/Elsa.AspNetCore/Features/MvcFeature.cs b/src/modules/Elsa.AspNetCore/Features/MvcFeature.cs
new file mode 100644
index 000000000..f63c92d52
--- /dev/null
+++ b/src/modules/Elsa.AspNetCore/Features/MvcFeature.cs
@@ -0,0 +1,18 @@
+using Elsa.AspNetCore.Conventions;
+using Elsa.Features.Abstractions;
+using Elsa.Features.Services;
+using Microsoft.Extensions.DependencyInjection;
+
+namespace Elsa.AspNetCore.Features;
+
+public class MvcFeature : FeatureBase
+{
+ public MvcFeature(IModule module) : base(module)
+ {
+ }
+
+ public override void Configure()
+ {
+ Services.AddMvc(mvc => mvc.Conventions.Add(new ApiEndpointAttributeConvention()));
+ }
+}
\ No newline at end of file
diff --git a/src/common/Elsa.AspNetCore/Models/ListModel.cs b/src/modules/Elsa.AspNetCore/Models/ListModel.cs
similarity index 100%
rename from src/common/Elsa.AspNetCore/Models/ListModel.cs
rename to src/modules/Elsa.AspNetCore/Models/ListModel.cs
diff --git a/src/common/Elsa.AspNetCore/Parts/TypesPart.cs b/src/modules/Elsa.AspNetCore/Parts/TypesPart.cs
similarity index 100%
rename from src/common/Elsa.AspNetCore/Parts/TypesPart.cs
rename to src/modules/Elsa.AspNetCore/Parts/TypesPart.cs
diff --git a/src/modules/Elsa.AzureServiceBus/Elsa.AzureServiceBus.csproj b/src/modules/Elsa.AzureServiceBus/Elsa.AzureServiceBus.csproj
index bd81dd42d..9d5fc1fd8 100644
--- a/src/modules/Elsa.AzureServiceBus/Elsa.AzureServiceBus.csproj
+++ b/src/modules/Elsa.AzureServiceBus/Elsa.AzureServiceBus.csproj
@@ -16,7 +16,7 @@
-
+
diff --git a/src/modules/Elsa.Dsl/Configuration/DslConfigurator.cs b/src/modules/Elsa.Dsl/Configuration/DslConfigurator.cs
deleted file mode 100644
index a7b9ba975..000000000
--- a/src/modules/Elsa.Dsl/Configuration/DslConfigurator.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-using Elsa.Dsl.Implementations;
-using Elsa.Dsl.Services;
-using Elsa.Expressions.Configuration;
-using Elsa.JavaScript.Configuration;
-using Elsa.ServiceConfiguration.Abstractions;
-using Elsa.ServiceConfiguration.Attributes;
-using Elsa.ServiceConfiguration.Services;
-using Microsoft.Extensions.DependencyInjection;
-
-namespace Elsa.Dsl.Configuration;
-
-[Dependency(typeof(JavaScriptConfigurator))]
-[Dependency(typeof(ExpressionsConfigurator))]
-public class DslConfigurator : ConfiguratorBase
-{
- public DslConfigurator(IServiceConfiguration serviceConfiguration) : base(serviceConfiguration)
- {
- }
-
- public override void Configure()
- {
- Services
- .AddSingleton()
- .AddSingleton()
- .AddSingleton();
- }
-}
\ No newline at end of file
diff --git a/src/modules/Elsa.Dsl/Extensions/DependencyInjectionExtensions.cs b/src/modules/Elsa.Dsl/Extensions/DependencyInjectionExtensions.cs
index 48e908f8a..bc8096ddc 100644
--- a/src/modules/Elsa.Dsl/Extensions/DependencyInjectionExtensions.cs
+++ b/src/modules/Elsa.Dsl/Extensions/DependencyInjectionExtensions.cs
@@ -1,12 +1,12 @@
using System;
-using Elsa.Dsl.Configuration;
-using Elsa.ServiceConfiguration.Services;
+using Elsa.Dsl.Features;
+using Elsa.Features.Services;
namespace Elsa.Dsl.Extensions;
public static class DependencyInjectionExtensions
{
- public static IServiceConfiguration UseDsl(this IServiceConfiguration configuration, Action? configure = default)
+ public static IModule UseDsl(this IModule configuration, Action? configure = default)
{
configuration.Configure(configure);
return configuration;
diff --git a/src/modules/Elsa.Dsl/Features/DslFeature.cs b/src/modules/Elsa.Dsl/Features/DslFeature.cs
new file mode 100644
index 000000000..5b23232a6
--- /dev/null
+++ b/src/modules/Elsa.Dsl/Features/DslFeature.cs
@@ -0,0 +1,27 @@
+using Elsa.Dsl.Implementations;
+using Elsa.Dsl.Services;
+using Elsa.Expressions.Features;
+using Elsa.Features.Abstractions;
+using Elsa.Features.Attributes;
+using Elsa.Features.Services;
+using Elsa.JavaScript.Features;
+using Microsoft.Extensions.DependencyInjection;
+
+namespace Elsa.Dsl.Features;
+
+[DependsOn(typeof(JavaScriptFeature))]
+[DependsOn(typeof(ExpressionsFeature))]
+public class DslFeature : FeatureBase
+{
+ public DslFeature(IModule module) : base(module)
+ {
+ }
+
+ public override void Configure()
+ {
+ Services
+ .AddSingleton()
+ .AddSingleton()
+ .AddSingleton();
+ }
+}
\ No newline at end of file
diff --git a/src/common/Elsa.Expressions/DelegateExpression.cs b/src/modules/Elsa.Expressions/DelegateExpression.cs
similarity index 100%
rename from src/common/Elsa.Expressions/DelegateExpression.cs
rename to src/modules/Elsa.Expressions/DelegateExpression.cs
diff --git a/src/common/Elsa.Expressions/Elsa.Expressions.csproj b/src/modules/Elsa.Expressions/Elsa.Expressions.csproj
similarity index 84%
rename from src/common/Elsa.Expressions/Elsa.Expressions.csproj
rename to src/modules/Elsa.Expressions/Elsa.Expressions.csproj
index a391643df..48cdad468 100644
--- a/src/common/Elsa.Expressions/Elsa.Expressions.csproj
+++ b/src/modules/Elsa.Expressions/Elsa.Expressions.csproj
@@ -13,7 +13,7 @@
-
+
diff --git a/src/common/Elsa.Expressions/Exceptions/TypeConversionException.cs b/src/modules/Elsa.Expressions/Exceptions/TypeConversionException.cs
similarity index 100%
rename from src/common/Elsa.Expressions/Exceptions/TypeConversionException.cs
rename to src/modules/Elsa.Expressions/Exceptions/TypeConversionException.cs
diff --git a/src/common/Elsa.Expressions/Extensions/DependencyInjectionExtensions.cs b/src/modules/Elsa.Expressions/Extensions/DependencyInjectionExtensions.cs
similarity index 81%
rename from src/common/Elsa.Expressions/Extensions/DependencyInjectionExtensions.cs
rename to src/modules/Elsa.Expressions/Extensions/DependencyInjectionExtensions.cs
index 0aa42447f..d84b97cba 100644
--- a/src/common/Elsa.Expressions/Extensions/DependencyInjectionExtensions.cs
+++ b/src/modules/Elsa.Expressions/Extensions/DependencyInjectionExtensions.cs
@@ -1,7 +1,7 @@
-using Elsa.Expressions.Configuration;
+using Elsa.Expressions.Features;
using Elsa.Expressions.Options;
using Elsa.Expressions.Services;
-using Elsa.ServiceConfiguration.Services;
+using Elsa.Features.Services;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
@@ -9,7 +9,7 @@ namespace Elsa.Expressions.Extensions;
public static class DependencyInjectionExtensions
{
- public static IServiceConfiguration UseExpressions(this IServiceConfiguration configuration, Action? configure = default)
+ public static IModule UseExpressions(this IModule configuration, Action? configure = default)
{
configuration.Configure(configure);
return configuration;
diff --git a/src/common/Elsa.Expressions/Configuration/ExpressionsConfigurator.cs b/src/modules/Elsa.Expressions/Features/ExpressionsFeature.cs
similarity index 55%
rename from src/common/Elsa.Expressions/Configuration/ExpressionsConfigurator.cs
rename to src/modules/Elsa.Expressions/Features/ExpressionsFeature.cs
index 235a84960..96e1c03c0 100644
--- a/src/common/Elsa.Expressions/Configuration/ExpressionsConfigurator.cs
+++ b/src/modules/Elsa.Expressions/Features/ExpressionsFeature.cs
@@ -1,14 +1,14 @@
using Elsa.Expressions.Implementations;
using Elsa.Expressions.Services;
-using Elsa.ServiceConfiguration.Abstractions;
-using Elsa.ServiceConfiguration.Services;
+using Elsa.Features.Abstractions;
+using Elsa.Features.Services;
using Microsoft.Extensions.DependencyInjection;
-namespace Elsa.Expressions.Configuration;
+namespace Elsa.Expressions.Features;
-public class ExpressionsConfigurator : ConfiguratorBase
+public class ExpressionsFeature : FeatureBase
{
- public ExpressionsConfigurator(IServiceConfiguration serviceConfiguration) : base(serviceConfiguration)
+ public ExpressionsFeature(IModule module) : base(module)
{
}
diff --git a/src/common/Elsa.Expressions/Helpers/ObjectConverter.cs b/src/modules/Elsa.Expressions/Helpers/ObjectConverter.cs
similarity index 100%
rename from src/common/Elsa.Expressions/Helpers/ObjectConverter.cs
rename to src/modules/Elsa.Expressions/Helpers/ObjectConverter.cs
diff --git a/src/common/Elsa.Expressions/Implementations/ExpressionEvaluator.cs b/src/modules/Elsa.Expressions/Implementations/ExpressionEvaluator.cs
similarity index 100%
rename from src/common/Elsa.Expressions/Implementations/ExpressionEvaluator.cs
rename to src/modules/Elsa.Expressions/Implementations/ExpressionEvaluator.cs
diff --git a/src/common/Elsa.Expressions/Implementations/ExpressionHandlerRegistry.cs b/src/modules/Elsa.Expressions/Implementations/ExpressionHandlerRegistry.cs
similarity index 100%
rename from src/common/Elsa.Expressions/Implementations/ExpressionHandlerRegistry.cs
rename to src/modules/Elsa.Expressions/Implementations/ExpressionHandlerRegistry.cs
diff --git a/src/common/Elsa.Expressions/LiteralExpression.cs b/src/modules/Elsa.Expressions/LiteralExpression.cs
similarity index 100%
rename from src/common/Elsa.Expressions/LiteralExpression.cs
rename to src/modules/Elsa.Expressions/LiteralExpression.cs
diff --git a/src/common/Elsa.Expressions/Models/DelegateReference.cs b/src/modules/Elsa.Expressions/Models/DelegateReference.cs
similarity index 100%
rename from src/common/Elsa.Expressions/Models/DelegateReference.cs
rename to src/modules/Elsa.Expressions/Models/DelegateReference.cs
diff --git a/src/common/Elsa.Expressions/Models/ExpressionExecutionContext.cs b/src/modules/Elsa.Expressions/Models/ExpressionExecutionContext.cs
similarity index 100%
rename from src/common/Elsa.Expressions/Models/ExpressionExecutionContext.cs
rename to src/modules/Elsa.Expressions/Models/ExpressionExecutionContext.cs
diff --git a/src/common/Elsa.Expressions/Models/ExpressionSyntaxDescriptor.cs b/src/modules/Elsa.Expressions/Models/ExpressionSyntaxDescriptor.cs
similarity index 100%
rename from src/common/Elsa.Expressions/Models/ExpressionSyntaxDescriptor.cs
rename to src/modules/Elsa.Expressions/Models/ExpressionSyntaxDescriptor.cs
diff --git a/src/common/Elsa.Expressions/Models/Literal.cs b/src/modules/Elsa.Expressions/Models/Literal.cs
similarity index 100%
rename from src/common/Elsa.Expressions/Models/Literal.cs
rename to src/modules/Elsa.Expressions/Models/Literal.cs
diff --git a/src/common/Elsa.Expressions/Models/Register.cs b/src/modules/Elsa.Expressions/Models/Register.cs
similarity index 100%
rename from src/common/Elsa.Expressions/Models/Register.cs
rename to src/modules/Elsa.Expressions/Models/Register.cs
diff --git a/src/common/Elsa.Expressions/Models/RegisterLocation.cs b/src/modules/Elsa.Expressions/Models/RegisterLocation.cs
similarity index 100%
rename from src/common/Elsa.Expressions/Models/RegisterLocation.cs
rename to src/modules/Elsa.Expressions/Models/RegisterLocation.cs
diff --git a/src/common/Elsa.Expressions/Models/RegisterLocationReference.cs b/src/modules/Elsa.Expressions/Models/RegisterLocationReference.cs
similarity index 100%
rename from src/common/Elsa.Expressions/Models/RegisterLocationReference.cs
rename to src/modules/Elsa.Expressions/Models/RegisterLocationReference.cs
diff --git a/src/common/Elsa.Expressions/Options/ExpressionOptions.cs b/src/modules/Elsa.Expressions/Options/ExpressionOptions.cs
similarity index 100%
rename from src/common/Elsa.Expressions/Options/ExpressionOptions.cs
rename to src/modules/Elsa.Expressions/Options/ExpressionOptions.cs
diff --git a/src/common/Elsa.Expressions/Services/IExpression.cs b/src/modules/Elsa.Expressions/Services/IExpression.cs
similarity index 100%
rename from src/common/Elsa.Expressions/Services/IExpression.cs
rename to src/modules/Elsa.Expressions/Services/IExpression.cs
diff --git a/src/common/Elsa.Expressions/Services/IExpressionEvaluator.cs b/src/modules/Elsa.Expressions/Services/IExpressionEvaluator.cs
similarity index 100%
rename from src/common/Elsa.Expressions/Services/IExpressionEvaluator.cs
rename to src/modules/Elsa.Expressions/Services/IExpressionEvaluator.cs
diff --git a/src/common/Elsa.Expressions/Services/IExpressionHandler.cs b/src/modules/Elsa.Expressions/Services/IExpressionHandler.cs
similarity index 100%
rename from src/common/Elsa.Expressions/Services/IExpressionHandler.cs
rename to src/modules/Elsa.Expressions/Services/IExpressionHandler.cs
diff --git a/src/common/Elsa.Expressions/Services/IExpressionHandlerRegistry.cs b/src/modules/Elsa.Expressions/Services/IExpressionHandlerRegistry.cs
similarity index 100%
rename from src/common/Elsa.Expressions/Services/IExpressionHandlerRegistry.cs
rename to src/modules/Elsa.Expressions/Services/IExpressionHandlerRegistry.cs
diff --git a/src/common/Elsa.Expressions/Services/IExpressionSyntaxProvider.cs b/src/modules/Elsa.Expressions/Services/IExpressionSyntaxProvider.cs
similarity index 100%
rename from src/common/Elsa.Expressions/Services/IExpressionSyntaxProvider.cs
rename to src/modules/Elsa.Expressions/Services/IExpressionSyntaxProvider.cs
diff --git a/src/common/Elsa.Expressions/Services/IExpressionSyntaxRegistry.cs b/src/modules/Elsa.Expressions/Services/IExpressionSyntaxRegistry.cs
similarity index 100%
rename from src/common/Elsa.Expressions/Services/IExpressionSyntaxRegistry.cs
rename to src/modules/Elsa.Expressions/Services/IExpressionSyntaxRegistry.cs
diff --git a/src/common/Elsa.Expressions/Services/IExpressionSyntaxRegistryPopulator.cs b/src/modules/Elsa.Expressions/Services/IExpressionSyntaxRegistryPopulator.cs
similarity index 100%
rename from src/common/Elsa.Expressions/Services/IExpressionSyntaxRegistryPopulator.cs
rename to src/modules/Elsa.Expressions/Services/IExpressionSyntaxRegistryPopulator.cs
diff --git a/src/modules/Elsa.Http/Extensions/DependencyInjectionExtensions.cs b/src/modules/Elsa.Http/Extensions/DependencyInjectionExtensions.cs
index 0e24ba810..e3f5985d1 100644
--- a/src/modules/Elsa.Http/Extensions/DependencyInjectionExtensions.cs
+++ b/src/modules/Elsa.Http/Extensions/DependencyInjectionExtensions.cs
@@ -1,15 +1,15 @@
using System;
-using Elsa.Http.Configuration;
-using Elsa.ServiceConfiguration.Services;
+using Elsa.Features.Services;
+using Elsa.Http.Features;
// ReSharper disable once CheckNamespace
namespace Microsoft.Extensions.DependencyInjection;
public static class DependencyInjectionExtensions
{
- public static IServiceConfiguration UseHttp(this IServiceConfiguration configuration, Action? configure = default)
+ public static IModule UseHttp(this IModule module, Action? configure = default)
{
- configuration.Configure(configure);
- return configuration;
+ module.Configure(configure);
+ return module;
}
}
\ No newline at end of file
diff --git a/src/modules/Elsa.Http/Configuration/HttpConfigurator.cs b/src/modules/Elsa.Http/Features/HttpFeature.cs
similarity index 69%
rename from src/modules/Elsa.Http/Configuration/HttpConfigurator.cs
rename to src/modules/Elsa.Http/Features/HttpFeature.cs
index d03efa739..a3bdeaebf 100644
--- a/src/modules/Elsa.Http/Configuration/HttpConfigurator.cs
+++ b/src/modules/Elsa.Http/Features/HttpFeature.cs
@@ -1,18 +1,18 @@
using System;
+using Elsa.Features.Abstractions;
+using Elsa.Features.Services;
using Elsa.Http.Handlers;
using Elsa.Http.Implementations;
using Elsa.Http.Options;
using Elsa.Http.Services;
using Elsa.Mediator.Extensions;
-using Elsa.ServiceConfiguration.Abstractions;
-using Elsa.ServiceConfiguration.Services;
using Microsoft.Extensions.DependencyInjection;
-namespace Elsa.Http.Configuration;
+namespace Elsa.Http.Features;
-public class HttpConfigurator : ConfiguratorBase
+public class HttpFeature : FeatureBase
{
- public HttpConfigurator(IServiceConfiguration serviceConfiguration) : base(serviceConfiguration)
+ public HttpFeature(IModule module) : base(module)
{
}
@@ -20,19 +20,19 @@ public class HttpConfigurator : ConfiguratorBase
public Func HttpEndpointAuthorizationHandlerFactory { get; set; } = ActivatorUtilities.GetServiceOrCreateInstance;
public Func HttpEndpointWorkflowFaultHandlerFactory { get; set; } = ActivatorUtilities.GetServiceOrCreateInstance;
- public HttpConfigurator WithBasePath(string value)
+ public HttpFeature WithBasePath(string value)
{
BasePath = value;
return this;
}
- public HttpConfigurator WithAuthorizationHandlerFactory(Func value)
+ public HttpFeature WithAuthorizationHandlerFactory(Func value)
{
HttpEndpointAuthorizationHandlerFactory = value;
return this;
}
- public HttpConfigurator WithWorkflowFaultHandlerFactory(Func value)
+ public HttpFeature WithWorkflowFaultHandlerFactory(Func value)
{
HttpEndpointWorkflowFaultHandlerFactory = value;
return this;
diff --git a/src/modules/Elsa.JavaScript/Elsa.JavaScript.csproj b/src/modules/Elsa.JavaScript/Elsa.JavaScript.csproj
index 826ca967e..a3205d4f2 100644
--- a/src/modules/Elsa.JavaScript/Elsa.JavaScript.csproj
+++ b/src/modules/Elsa.JavaScript/Elsa.JavaScript.csproj
@@ -7,8 +7,8 @@
-
-
+
+
diff --git a/src/modules/Elsa.JavaScript/Extensions/DependencyInjectionExtensions.cs b/src/modules/Elsa.JavaScript/Extensions/DependencyInjectionExtensions.cs
index 549c8eb8c..ad5040980 100644
--- a/src/modules/Elsa.JavaScript/Extensions/DependencyInjectionExtensions.cs
+++ b/src/modules/Elsa.JavaScript/Extensions/DependencyInjectionExtensions.cs
@@ -1,13 +1,13 @@
-using Elsa.JavaScript.Configuration;
-using Elsa.ServiceConfiguration.Services;
+using Elsa.Features.Services;
+using Elsa.JavaScript.Features;
namespace Elsa.JavaScript.Extensions;
public static class DependencyInjectionExtensions
{
- public static IServiceConfiguration UseJavaScript(this IServiceConfiguration serviceConfiguration, Action? configure = default)
+ public static IModule UseJavaScript(this IModule module, Action? configure = default)
{
- serviceConfiguration.Configure(configure);
- return serviceConfiguration;
+ module.Configure(configure);
+ return module;
}
}
\ No newline at end of file
diff --git a/src/modules/Elsa.JavaScript/Configuration/JavaScriptConfigurator.cs b/src/modules/Elsa.JavaScript/Features/JavaScriptFeature.cs
similarity index 59%
rename from src/modules/Elsa.JavaScript/Configuration/JavaScriptConfigurator.cs
rename to src/modules/Elsa.JavaScript/Features/JavaScriptFeature.cs
index 538c9bbf0..c39dce548 100644
--- a/src/modules/Elsa.JavaScript/Configuration/JavaScriptConfigurator.cs
+++ b/src/modules/Elsa.JavaScript/Features/JavaScriptFeature.cs
@@ -1,25 +1,25 @@
-using Elsa.Expressions.Configuration;
using Elsa.Expressions.Extensions;
+using Elsa.Expressions.Features;
using Elsa.Expressions.Services;
+using Elsa.Features.Abstractions;
+using Elsa.Features.Attributes;
+using Elsa.Features.Services;
using Elsa.JavaScript.Expressions;
using Elsa.JavaScript.Handlers;
using Elsa.JavaScript.Implementations;
using Elsa.JavaScript.Providers;
using Elsa.JavaScript.Services;
-using Elsa.Mediator.Configuration;
using Elsa.Mediator.Extensions;
-using Elsa.ServiceConfiguration.Abstractions;
-using Elsa.ServiceConfiguration.Attributes;
-using Elsa.ServiceConfiguration.Services;
+using Elsa.Mediator.Features;
using Microsoft.Extensions.DependencyInjection;
-namespace Elsa.JavaScript.Configuration;
+namespace Elsa.JavaScript.Features;
-[Dependency(typeof(MediatorConfigurator))]
-[Dependency(typeof(ExpressionsConfigurator))]
-public class JavaScriptConfigurator : ConfiguratorBase
+[DependsOn(typeof(MediatorFeature))]
+[DependsOn(typeof(ExpressionsFeature))]
+public class JavaScriptFeature : FeatureBase
{
- public JavaScriptConfigurator(IServiceConfiguration serviceConfiguration) : base(serviceConfiguration)
+ public JavaScriptFeature(IModule module) : base(module)
{
}
diff --git a/src/modules/Elsa.Labels.EntityFrameworkCore.Sqlite/DependencyInjectionExtensions.cs b/src/modules/Elsa.Labels.EntityFrameworkCore.Sqlite/DependencyInjectionExtensions.cs
index 1e928b0f7..6ef14bb06 100644
--- a/src/modules/Elsa.Labels.EntityFrameworkCore.Sqlite/DependencyInjectionExtensions.cs
+++ b/src/modules/Elsa.Labels.EntityFrameworkCore.Sqlite/DependencyInjectionExtensions.cs
@@ -1,13 +1,14 @@
using Elsa.Labels.EntityFrameworkCore.Configuration;
+using Elsa.Labels.EntityFrameworkCore.Features;
namespace Elsa.Labels.EntityFrameworkCore.Sqlite
{
public static class DependencyInjectionExtensions
{
- public static EFCoreLabelPersistenceConfigurator UseSqlite(this EFCoreLabelPersistenceConfigurator configurator, string connectionString = "Data Source=elsa.sqlite.db;Cache=Shared;")
+ public static EFCoreLabelPersistenceFeature UseSqlite(this EFCoreLabelPersistenceFeature feature, string connectionString = "Data Source=elsa.sqlite.db;Cache=Shared;")
{
- configurator.ConfigureDbContextOptions((_, db) => db.UseSqlite(connectionString));
- return configurator;
+ feature.ConfigureDbContextOptions((_, db) => db.UseSqlite(connectionString));
+ return feature;
}
}
}
\ No newline at end of file
diff --git a/src/modules/Elsa.Labels.EntityFrameworkCore/Extensions/DependencyInjectionExtensions.cs b/src/modules/Elsa.Labels.EntityFrameworkCore/Extensions/DependencyInjectionExtensions.cs
index a8a2808cd..958e3a371 100644
--- a/src/modules/Elsa.Labels.EntityFrameworkCore/Extensions/DependencyInjectionExtensions.cs
+++ b/src/modules/Elsa.Labels.EntityFrameworkCore/Extensions/DependencyInjectionExtensions.cs
@@ -1,13 +1,13 @@
-using Elsa.Labels.Configuration;
-using Elsa.Labels.EntityFrameworkCore.Configuration;
+using Elsa.Labels.EntityFrameworkCore.Features;
+using Elsa.Labels.Features;
namespace Elsa.Labels.EntityFrameworkCore.Extensions;
public static class DependencyInjectionExtensions
{
- public static LabelsConfigurator UseEntityFrameworkCore(this LabelsConfigurator configurator, Action configure)
+ public static LabelsFeature UseEntityFrameworkCore(this LabelsFeature feature, Action configure)
{
- configurator.ServiceConfiguration.Configure(configure);
- return configurator;
+ feature.Module.Configure(configure);
+ return feature;
}
}
\ No newline at end of file
diff --git a/src/modules/Elsa.Labels.EntityFrameworkCore/Configuration/EFCoreLabelPersistenceConfigurator.cs b/src/modules/Elsa.Labels.EntityFrameworkCore/Features/EFCoreLabelPersistenceFeature.cs
similarity index 59%
rename from src/modules/Elsa.Labels.EntityFrameworkCore/Configuration/EFCoreLabelPersistenceConfigurator.cs
rename to src/modules/Elsa.Labels.EntityFrameworkCore/Features/EFCoreLabelPersistenceFeature.cs
index 75837697f..432f71502 100644
--- a/src/modules/Elsa.Labels.EntityFrameworkCore/Configuration/EFCoreLabelPersistenceConfigurator.cs
+++ b/src/modules/Elsa.Labels.EntityFrameworkCore/Features/EFCoreLabelPersistenceFeature.cs
@@ -1,24 +1,24 @@
-using Elsa.Labels.Configuration;
+using Elsa.Features.Attributes;
+using Elsa.Features.Services;
using Elsa.Labels.Entities;
using Elsa.Labels.EntityFrameworkCore.Implementations;
using Elsa.Labels.Extensions;
+using Elsa.Labels.Features;
using Elsa.Persistence.EntityFrameworkCore.Common.Abstractions;
-using Elsa.ServiceConfiguration.Attributes;
-using Elsa.ServiceConfiguration.Services;
using Microsoft.Extensions.DependencyInjection;
-namespace Elsa.Labels.EntityFrameworkCore.Configuration;
+namespace Elsa.Labels.EntityFrameworkCore.Features;
-[Dependency(typeof(LabelsConfigurator))]
-public class EFCoreLabelPersistenceConfigurator : EFCorePersistenceConfigurator
+[DependsOn(typeof(LabelsFeature))]
+public class EFCoreLabelPersistenceFeature : EFCorePersistenceFeature
{
- public EFCoreLabelPersistenceConfigurator(IServiceConfiguration serviceConfiguration) : base(serviceConfiguration)
+ public EFCoreLabelPersistenceFeature(IModule module) : base(module)
{
}
public override void Configure()
{
- ServiceConfiguration.UseLabels(labels => labels
+ Module.UseLabels(labels => labels
.WithLabelStore(sp => sp.GetRequiredService())
.WithWorkflowDefinitionLabelStore(sp => sp.GetRequiredService())
);
diff --git a/src/modules/Elsa.Labels/Elsa.Labels.csproj b/src/modules/Elsa.Labels/Elsa.Labels.csproj
index a305aea0f..e36a72d0f 100644
--- a/src/modules/Elsa.Labels/Elsa.Labels.csproj
+++ b/src/modules/Elsa.Labels/Elsa.Labels.csproj
@@ -15,8 +15,8 @@
-
-
+
+
diff --git a/src/modules/Elsa.Labels/Extensions/DependencyInjectionExtensions.cs b/src/modules/Elsa.Labels/Extensions/DependencyInjectionExtensions.cs
index 8e38d5b3d..e832b7d6a 100644
--- a/src/modules/Elsa.Labels/Extensions/DependencyInjectionExtensions.cs
+++ b/src/modules/Elsa.Labels/Extensions/DependencyInjectionExtensions.cs
@@ -1,11 +1,11 @@
-using Elsa.Labels.Configuration;
-using Elsa.ServiceConfiguration.Services;
+using Elsa.Features.Services;
+using Elsa.Labels.Features;
namespace Elsa.Labels.Extensions;
public static class DependencyInjectionExtensions
{
- public static IServiceConfiguration UseLabels(this IServiceConfiguration configuration, Action? configure = default)
+ public static IModule UseLabels(this IModule configuration, Action? configure = default)
{
configuration.Configure(configure);
return configuration;
diff --git a/src/modules/Elsa.Labels/Configuration/LabelsConfigurator.cs b/src/modules/Elsa.Labels/Features/LabelsFeature.cs
similarity index 63%
rename from src/modules/Elsa.Labels/Configuration/LabelsConfigurator.cs
rename to src/modules/Elsa.Labels/Features/LabelsFeature.cs
index 319d4a4e5..d525ef84c 100644
--- a/src/modules/Elsa.Labels/Configuration/LabelsConfigurator.cs
+++ b/src/modules/Elsa.Labels/Features/LabelsFeature.cs
@@ -1,33 +1,33 @@
+using Elsa.Features.Abstractions;
+using Elsa.Features.Attributes;
+using Elsa.Features.Services;
using Elsa.Labels.Entities;
using Elsa.Labels.Implementations;
using Elsa.Labels.Services;
-using Elsa.Mediator.Configuration;
using Elsa.Mediator.Extensions;
+using Elsa.Mediator.Features;
using Elsa.Persistence.Common.Extensions;
-using Elsa.ServiceConfiguration.Abstractions;
-using Elsa.ServiceConfiguration.Attributes;
-using Elsa.ServiceConfiguration.Services;
using Microsoft.Extensions.DependencyInjection;
-namespace Elsa.Labels.Configuration;
+namespace Elsa.Labels.Features;
-[Dependency(typeof(MediatorConfigurator))]
-public class LabelsConfigurator : ConfiguratorBase
+[DependsOn(typeof(MediatorFeature))]
+public class LabelsFeature : FeatureBase
{
- public LabelsConfigurator(IServiceConfiguration serviceConfiguration) : base(serviceConfiguration)
+ public LabelsFeature(IModule module) : base(module)
{
}
public Func LabelStore { get; set; } = sp => sp.GetRequiredService();
public Func WorkflowDefinitionLabelStore { get; set; } = sp => sp.GetRequiredService();
- public LabelsConfigurator WithLabelStore(Func factory)
+ public LabelsFeature WithLabelStore(Func factory)
{
LabelStore = factory;
return this;
}
- public LabelsConfigurator WithWorkflowDefinitionLabelStore(Func factory)
+ public LabelsFeature WithWorkflowDefinitionLabelStore(Func factory)
{
WorkflowDefinitionLabelStore = factory;
return this;
diff --git a/src/modules/Elsa.Liquid/Elsa.Liquid.csproj b/src/modules/Elsa.Liquid/Elsa.Liquid.csproj
index 89d641c1a..a08d80c15 100644
--- a/src/modules/Elsa.Liquid/Elsa.Liquid.csproj
+++ b/src/modules/Elsa.Liquid/Elsa.Liquid.csproj
@@ -13,8 +13,8 @@
-
-
+
+
diff --git a/src/modules/Elsa.Liquid/Extensions/DependencyInjectionExtensions.cs b/src/modules/Elsa.Liquid/Extensions/DependencyInjectionExtensions.cs
index c0bb38bbf..c206046c8 100644
--- a/src/modules/Elsa.Liquid/Extensions/DependencyInjectionExtensions.cs
+++ b/src/modules/Elsa.Liquid/Extensions/DependencyInjectionExtensions.cs
@@ -1,18 +1,18 @@
-using Elsa.Liquid.Configuration;
+using Elsa.Features.Services;
+using Elsa.Liquid.Features;
using Elsa.Liquid.Implementations;
using Elsa.Liquid.Options;
using Elsa.Liquid.Services;
-using Elsa.ServiceConfiguration.Services;
using Microsoft.Extensions.DependencyInjection;
namespace Elsa.Liquid.Extensions;
public static class DependencyInjectionExtensions
{
- public static IServiceConfiguration UseLiquid(this IServiceConfiguration configuration, Action? configure = default)
+ public static IModule UseLiquid(this IModule module, Action? configure = default)
{
- configuration.Configure(configure);
- return configuration;
+ module.Configure(configure);
+ return module;
}
public static IServiceCollection AddLiquidFilter(this IServiceCollection services, string name) where T : class, ILiquidFilter
diff --git a/src/modules/Elsa.Liquid/Configuration/JavaScriptConfigurator.cs b/src/modules/Elsa.Liquid/Features/LiquidConfigurator.cs
similarity index 60%
rename from src/modules/Elsa.Liquid/Configuration/JavaScriptConfigurator.cs
rename to src/modules/Elsa.Liquid/Features/LiquidConfigurator.cs
index 67fcb0990..a80637584 100644
--- a/src/modules/Elsa.Liquid/Configuration/JavaScriptConfigurator.cs
+++ b/src/modules/Elsa.Liquid/Features/LiquidConfigurator.cs
@@ -1,6 +1,9 @@
-using Elsa.Expressions.Configuration;
using Elsa.Expressions.Extensions;
+using Elsa.Expressions.Features;
using Elsa.Expressions.Services;
+using Elsa.Features.Abstractions;
+using Elsa.Features.Attributes;
+using Elsa.Features.Services;
using Elsa.Liquid.Expressions;
using Elsa.Liquid.Extensions;
using Elsa.Liquid.Filters;
@@ -8,22 +11,19 @@ using Elsa.Liquid.Handlers;
using Elsa.Liquid.Implementations;
using Elsa.Liquid.Providers;
using Elsa.Liquid.Services;
-using Elsa.Mediator.Configuration;
using Elsa.Mediator.Extensions;
-using Elsa.MemoryCache.Configuration;
-using Elsa.ServiceConfiguration.Abstractions;
-using Elsa.ServiceConfiguration.Attributes;
-using Elsa.ServiceConfiguration.Services;
+using Elsa.Mediator.Features;
+using Elsa.MemoryCache.Features;
using Microsoft.Extensions.DependencyInjection;
-namespace Elsa.Liquid.Configuration;
+namespace Elsa.Liquid.Features;
-[Dependency(typeof(MemoryCacheConfigurator))]
-[Dependency(typeof(MediatorConfigurator))]
-[Dependency(typeof(ExpressionsConfigurator))]
-public class LiquidConfigurator : ConfiguratorBase
+[DependsOn(typeof(MemoryCacheFeature))]
+[DependsOn(typeof(MediatorFeature))]
+[DependsOn(typeof(ExpressionsFeature))]
+public class LiquidConfigurator : FeatureBase
{
- public LiquidConfigurator(IServiceConfiguration serviceConfiguration) : base(serviceConfiguration)
+ public LiquidConfigurator(IModule serviceConfiguration) : base(serviceConfiguration)
{
}
diff --git a/src/common/Elsa.Mediator/Elsa.Mediator.csproj b/src/modules/Elsa.Mediator/Elsa.Mediator.csproj
similarity index 80%
rename from src/common/Elsa.Mediator/Elsa.Mediator.csproj
rename to src/modules/Elsa.Mediator/Elsa.Mediator.csproj
index dc7d916fb..4acb383cb 100644
--- a/src/common/Elsa.Mediator/Elsa.Mediator.csproj
+++ b/src/modules/Elsa.Mediator/Elsa.Mediator.csproj
@@ -11,7 +11,7 @@
-
+
diff --git a/src/common/Elsa.Mediator/Extensions/DependencyInjectionExtensions.cs b/src/modules/Elsa.Mediator/Extensions/DependencyInjectionExtensions.cs
similarity index 94%
rename from src/common/Elsa.Mediator/Extensions/DependencyInjectionExtensions.cs
rename to src/modules/Elsa.Mediator/Extensions/DependencyInjectionExtensions.cs
index 37712efa7..a328e86ba 100644
--- a/src/common/Elsa.Mediator/Extensions/DependencyInjectionExtensions.cs
+++ b/src/modules/Elsa.Mediator/Extensions/DependencyInjectionExtensions.cs
@@ -1,5 +1,4 @@
using System.Reflection;
-using Elsa.Mediator.Configuration;
using Elsa.Mediator.Implementations;
using Elsa.Mediator.Middleware.Command;
using Elsa.Mediator.Middleware.Command.Contracts;
@@ -9,17 +8,18 @@ using Elsa.Mediator.Middleware.Request;
using Elsa.Mediator.Middleware.Request.Contracts;
using Elsa.Mediator.Models;
using Elsa.Mediator.Services;
-using Elsa.ServiceConfiguration.Services;
+using Elsa.Features.Services;
+using Elsa.Mediator.Features;
using Microsoft.Extensions.DependencyInjection;
namespace Elsa.Mediator.Extensions;
public static class DependencyInjectionExtensions
{
- public static IServiceConfiguration AddMediator(this IServiceConfiguration serviceConfiguration, Action? configure = default)
+ public static IModule AddMediator(this IModule module, Action? configure = default)
{
- serviceConfiguration.Configure(configure);
- return serviceConfiguration;
+ module.Configure(configure);
+ return module;
}
public static IServiceCollection AddMediator(this IServiceCollection services)
diff --git a/src/modules/Elsa.Mediator/Features/MediatorFeature.cs b/src/modules/Elsa.Mediator/Features/MediatorFeature.cs
new file mode 100644
index 000000000..3acf231d7
--- /dev/null
+++ b/src/modules/Elsa.Mediator/Features/MediatorFeature.cs
@@ -0,0 +1,17 @@
+using Elsa.Features.Abstractions;
+using Elsa.Features.Services;
+using Elsa.Mediator.Extensions;
+
+namespace Elsa.Mediator.Features;
+
+public class MediatorFeature : FeatureBase
+{
+ public MediatorFeature(IModule module) : base(module)
+ {
+ }
+
+ public override void Apply()
+ {
+ Services.AddMediator();
+ }
+}
\ No newline at end of file
diff --git a/src/common/Elsa.Mediator/Implementations/DefaultMediator.cs b/src/modules/Elsa.Mediator/Implementations/DefaultMediator.cs
similarity index 100%
rename from src/common/Elsa.Mediator/Implementations/DefaultMediator.cs
rename to src/modules/Elsa.Mediator/Implementations/DefaultMediator.cs
diff --git a/src/common/Elsa.Mediator/Middleware/Command/CommandContext.cs b/src/modules/Elsa.Mediator/Middleware/Command/CommandContext.cs
similarity index 100%
rename from src/common/Elsa.Mediator/Middleware/Command/CommandContext.cs
rename to src/modules/Elsa.Mediator/Middleware/Command/CommandContext.cs
diff --git a/src/common/Elsa.Mediator/Middleware/Command/CommandMiddlewareDelegate.cs b/src/modules/Elsa.Mediator/Middleware/Command/CommandMiddlewareDelegate.cs
similarity index 100%
rename from src/common/Elsa.Mediator/Middleware/Command/CommandMiddlewareDelegate.cs
rename to src/modules/Elsa.Mediator/Middleware/Command/CommandMiddlewareDelegate.cs
diff --git a/src/common/Elsa.Mediator/Middleware/Command/CommandPipeline.cs b/src/modules/Elsa.Mediator/Middleware/Command/CommandPipeline.cs
similarity index 100%
rename from src/common/Elsa.Mediator/Middleware/Command/CommandPipeline.cs
rename to src/modules/Elsa.Mediator/Middleware/Command/CommandPipeline.cs
diff --git a/src/common/Elsa.Mediator/Middleware/Command/CommandPipelineBuilder.cs b/src/modules/Elsa.Mediator/Middleware/Command/CommandPipelineBuilder.cs
similarity index 100%
rename from src/common/Elsa.Mediator/Middleware/Command/CommandPipelineBuilder.cs
rename to src/modules/Elsa.Mediator/Middleware/Command/CommandPipelineBuilder.cs
diff --git a/src/common/Elsa.Mediator/Middleware/Command/CommandPipelineBuilderExtensions.cs b/src/modules/Elsa.Mediator/Middleware/Command/CommandPipelineBuilderExtensions.cs
similarity index 100%
rename from src/common/Elsa.Mediator/Middleware/Command/CommandPipelineBuilderExtensions.cs
rename to src/modules/Elsa.Mediator/Middleware/Command/CommandPipelineBuilderExtensions.cs
diff --git a/src/common/Elsa.Mediator/Middleware/Command/Components/CommandHandlerInvokerMiddleware.cs b/src/modules/Elsa.Mediator/Middleware/Command/Components/CommandHandlerInvokerMiddleware.cs
similarity index 100%
rename from src/common/Elsa.Mediator/Middleware/Command/Components/CommandHandlerInvokerMiddleware.cs
rename to src/modules/Elsa.Mediator/Middleware/Command/Components/CommandHandlerInvokerMiddleware.cs
diff --git a/src/common/Elsa.Mediator/Middleware/Command/Components/CommandLoggingMiddleware.cs b/src/modules/Elsa.Mediator/Middleware/Command/Components/CommandLoggingMiddleware.cs
similarity index 100%
rename from src/common/Elsa.Mediator/Middleware/Command/Components/CommandLoggingMiddleware.cs
rename to src/modules/Elsa.Mediator/Middleware/Command/Components/CommandLoggingMiddleware.cs
diff --git a/src/common/Elsa.Mediator/Middleware/Command/Contracts/ICommandMiddleware.cs b/src/modules/Elsa.Mediator/Middleware/Command/Contracts/ICommandMiddleware.cs
similarity index 100%
rename from src/common/Elsa.Mediator/Middleware/Command/Contracts/ICommandMiddleware.cs
rename to src/modules/Elsa.Mediator/Middleware/Command/Contracts/ICommandMiddleware.cs
diff --git a/src/common/Elsa.Mediator/Middleware/Command/Contracts/ICommandPipeline.cs b/src/modules/Elsa.Mediator/Middleware/Command/Contracts/ICommandPipeline.cs
similarity index 100%
rename from src/common/Elsa.Mediator/Middleware/Command/Contracts/ICommandPipeline.cs
rename to src/modules/Elsa.Mediator/Middleware/Command/Contracts/ICommandPipeline.cs
diff --git a/src/common/Elsa.Mediator/Middleware/Command/Contracts/ICommandPipelineBuilder.cs b/src/modules/Elsa.Mediator/Middleware/Command/Contracts/ICommandPipelineBuilder.cs
similarity index 100%
rename from src/common/Elsa.Mediator/Middleware/Command/Contracts/ICommandPipelineBuilder.cs
rename to src/modules/Elsa.Mediator/Middleware/Command/Contracts/ICommandPipelineBuilder.cs
diff --git a/src/common/Elsa.Mediator/Middleware/Command/MiddlewareExtensions.cs b/src/modules/Elsa.Mediator/Middleware/Command/MiddlewareExtensions.cs
similarity index 100%
rename from src/common/Elsa.Mediator/Middleware/Command/MiddlewareExtensions.cs
rename to src/modules/Elsa.Mediator/Middleware/Command/MiddlewareExtensions.cs
diff --git a/src/common/Elsa.Mediator/Middleware/MiddlewareHelpers.cs b/src/modules/Elsa.Mediator/Middleware/MiddlewareHelpers.cs
similarity index 100%
rename from src/common/Elsa.Mediator/Middleware/MiddlewareHelpers.cs
rename to src/modules/Elsa.Mediator/Middleware/MiddlewareHelpers.cs
diff --git a/src/common/Elsa.Mediator/Middleware/Notification/Components/NotificationHandlerInvokerMiddleware.cs b/src/modules/Elsa.Mediator/Middleware/Notification/Components/NotificationHandlerInvokerMiddleware.cs
similarity index 100%
rename from src/common/Elsa.Mediator/Middleware/Notification/Components/NotificationHandlerInvokerMiddleware.cs
rename to src/modules/Elsa.Mediator/Middleware/Notification/Components/NotificationHandlerInvokerMiddleware.cs
diff --git a/src/common/Elsa.Mediator/Middleware/Notification/Components/NotificationLoggingMiddleware.cs b/src/modules/Elsa.Mediator/Middleware/Notification/Components/NotificationLoggingMiddleware.cs
similarity index 100%
rename from src/common/Elsa.Mediator/Middleware/Notification/Components/NotificationLoggingMiddleware.cs
rename to src/modules/Elsa.Mediator/Middleware/Notification/Components/NotificationLoggingMiddleware.cs
diff --git a/src/common/Elsa.Mediator/Middleware/Notification/Contracts/INotificationMiddleware.cs b/src/modules/Elsa.Mediator/Middleware/Notification/Contracts/INotificationMiddleware.cs
similarity index 100%
rename from src/common/Elsa.Mediator/Middleware/Notification/Contracts/INotificationMiddleware.cs
rename to src/modules/Elsa.Mediator/Middleware/Notification/Contracts/INotificationMiddleware.cs
diff --git a/src/common/Elsa.Mediator/Middleware/Notification/Contracts/INotificationPipeline.cs b/src/modules/Elsa.Mediator/Middleware/Notification/Contracts/INotificationPipeline.cs
similarity index 100%
rename from src/common/Elsa.Mediator/Middleware/Notification/Contracts/INotificationPipeline.cs
rename to src/modules/Elsa.Mediator/Middleware/Notification/Contracts/INotificationPipeline.cs
diff --git a/src/common/Elsa.Mediator/Middleware/Notification/Contracts/INotificationPipelineBuilder.cs b/src/modules/Elsa.Mediator/Middleware/Notification/Contracts/INotificationPipelineBuilder.cs
similarity index 100%
rename from src/common/Elsa.Mediator/Middleware/Notification/Contracts/INotificationPipelineBuilder.cs
rename to src/modules/Elsa.Mediator/Middleware/Notification/Contracts/INotificationPipelineBuilder.cs
diff --git a/src/common/Elsa.Mediator/Middleware/Notification/MiddlewareExtensions.cs b/src/modules/Elsa.Mediator/Middleware/Notification/MiddlewareExtensions.cs
similarity index 100%
rename from src/common/Elsa.Mediator/Middleware/Notification/MiddlewareExtensions.cs
rename to src/modules/Elsa.Mediator/Middleware/Notification/MiddlewareExtensions.cs
diff --git a/src/common/Elsa.Mediator/Middleware/Notification/NotificationContext.cs b/src/modules/Elsa.Mediator/Middleware/Notification/NotificationContext.cs
similarity index 100%
rename from src/common/Elsa.Mediator/Middleware/Notification/NotificationContext.cs
rename to src/modules/Elsa.Mediator/Middleware/Notification/NotificationContext.cs
diff --git a/src/common/Elsa.Mediator/Middleware/Notification/NotificationMiddlewareDelegate.cs b/src/modules/Elsa.Mediator/Middleware/Notification/NotificationMiddlewareDelegate.cs
similarity index 100%
rename from src/common/Elsa.Mediator/Middleware/Notification/NotificationMiddlewareDelegate.cs
rename to src/modules/Elsa.Mediator/Middleware/Notification/NotificationMiddlewareDelegate.cs
diff --git a/src/common/Elsa.Mediator/Middleware/Notification/NotificationPipeline.cs b/src/modules/Elsa.Mediator/Middleware/Notification/NotificationPipeline.cs
similarity index 100%
rename from src/common/Elsa.Mediator/Middleware/Notification/NotificationPipeline.cs
rename to src/modules/Elsa.Mediator/Middleware/Notification/NotificationPipeline.cs
diff --git a/src/common/Elsa.Mediator/Middleware/Notification/NotificationPipelineBuilder.cs b/src/modules/Elsa.Mediator/Middleware/Notification/NotificationPipelineBuilder.cs
similarity index 100%
rename from src/common/Elsa.Mediator/Middleware/Notification/NotificationPipelineBuilder.cs
rename to src/modules/Elsa.Mediator/Middleware/Notification/NotificationPipelineBuilder.cs
diff --git a/src/common/Elsa.Mediator/Middleware/Notification/NotificationPipelineBuilderExtensions.cs b/src/modules/Elsa.Mediator/Middleware/Notification/NotificationPipelineBuilderExtensions.cs
similarity index 100%
rename from src/common/Elsa.Mediator/Middleware/Notification/NotificationPipelineBuilderExtensions.cs
rename to src/modules/Elsa.Mediator/Middleware/Notification/NotificationPipelineBuilderExtensions.cs
diff --git a/src/common/Elsa.Mediator/Middleware/Request/Components/RequestHandlerInvokerMiddleware.cs b/src/modules/Elsa.Mediator/Middleware/Request/Components/RequestHandlerInvokerMiddleware.cs
similarity index 100%
rename from src/common/Elsa.Mediator/Middleware/Request/Components/RequestHandlerInvokerMiddleware.cs
rename to src/modules/Elsa.Mediator/Middleware/Request/Components/RequestHandlerInvokerMiddleware.cs
diff --git a/src/common/Elsa.Mediator/Middleware/Request/Components/RequestLoggingMiddleware.cs b/src/modules/Elsa.Mediator/Middleware/Request/Components/RequestLoggingMiddleware.cs
similarity index 100%
rename from src/common/Elsa.Mediator/Middleware/Request/Components/RequestLoggingMiddleware.cs
rename to src/modules/Elsa.Mediator/Middleware/Request/Components/RequestLoggingMiddleware.cs
diff --git a/src/common/Elsa.Mediator/Middleware/Request/Contracts/IRequestMiddleware.cs b/src/modules/Elsa.Mediator/Middleware/Request/Contracts/IRequestMiddleware.cs
similarity index 100%
rename from src/common/Elsa.Mediator/Middleware/Request/Contracts/IRequestMiddleware.cs
rename to src/modules/Elsa.Mediator/Middleware/Request/Contracts/IRequestMiddleware.cs
diff --git a/src/common/Elsa.Mediator/Middleware/Request/Contracts/IRequestPipeline.cs b/src/modules/Elsa.Mediator/Middleware/Request/Contracts/IRequestPipeline.cs
similarity index 100%
rename from src/common/Elsa.Mediator/Middleware/Request/Contracts/IRequestPipeline.cs
rename to src/modules/Elsa.Mediator/Middleware/Request/Contracts/IRequestPipeline.cs
diff --git a/src/common/Elsa.Mediator/Middleware/Request/Contracts/IRequestPipelineBuilder.cs b/src/modules/Elsa.Mediator/Middleware/Request/Contracts/IRequestPipelineBuilder.cs
similarity index 100%
rename from src/common/Elsa.Mediator/Middleware/Request/Contracts/IRequestPipelineBuilder.cs
rename to src/modules/Elsa.Mediator/Middleware/Request/Contracts/IRequestPipelineBuilder.cs
diff --git a/src/common/Elsa.Mediator/Middleware/Request/MiddlewareExtensions.cs b/src/modules/Elsa.Mediator/Middleware/Request/MiddlewareExtensions.cs
similarity index 100%
rename from src/common/Elsa.Mediator/Middleware/Request/MiddlewareExtensions.cs
rename to src/modules/Elsa.Mediator/Middleware/Request/MiddlewareExtensions.cs
diff --git a/src/common/Elsa.Mediator/Middleware/Request/RequestContext.cs b/src/modules/Elsa.Mediator/Middleware/Request/RequestContext.cs
similarity index 100%
rename from src/common/Elsa.Mediator/Middleware/Request/RequestContext.cs
rename to src/modules/Elsa.Mediator/Middleware/Request/RequestContext.cs
diff --git a/src/common/Elsa.Mediator/Middleware/Request/RequestMiddlewareDelegate.cs b/src/modules/Elsa.Mediator/Middleware/Request/RequestMiddlewareDelegate.cs
similarity index 100%
rename from src/common/Elsa.Mediator/Middleware/Request/RequestMiddlewareDelegate.cs
rename to src/modules/Elsa.Mediator/Middleware/Request/RequestMiddlewareDelegate.cs
diff --git a/src/common/Elsa.Mediator/Middleware/Request/RequestPipeline.cs b/src/modules/Elsa.Mediator/Middleware/Request/RequestPipeline.cs
similarity index 100%
rename from src/common/Elsa.Mediator/Middleware/Request/RequestPipeline.cs
rename to src/modules/Elsa.Mediator/Middleware/Request/RequestPipeline.cs
diff --git a/src/common/Elsa.Mediator/Middleware/Request/RequestPipelineBuilder.cs b/src/modules/Elsa.Mediator/Middleware/Request/RequestPipelineBuilder.cs
similarity index 100%
rename from src/common/Elsa.Mediator/Middleware/Request/RequestPipelineBuilder.cs
rename to src/modules/Elsa.Mediator/Middleware/Request/RequestPipelineBuilder.cs
diff --git a/src/common/Elsa.Mediator/Middleware/Request/RequestPipelineBuilderExtensions.cs b/src/modules/Elsa.Mediator/Middleware/Request/RequestPipelineBuilderExtensions.cs
similarity index 100%
rename from src/common/Elsa.Mediator/Middleware/Request/RequestPipelineBuilderExtensions.cs
rename to src/modules/Elsa.Mediator/Middleware/Request/RequestPipelineBuilderExtensions.cs
diff --git a/src/common/Elsa.Mediator/Models/Unit.cs b/src/modules/Elsa.Mediator/Models/Unit.cs
similarity index 100%
rename from src/common/Elsa.Mediator/Models/Unit.cs
rename to src/modules/Elsa.Mediator/Models/Unit.cs
diff --git a/src/common/Elsa.Mediator/Services/ICommand.cs b/src/modules/Elsa.Mediator/Services/ICommand.cs
similarity index 100%
rename from src/common/Elsa.Mediator/Services/ICommand.cs
rename to src/modules/Elsa.Mediator/Services/ICommand.cs
diff --git a/src/common/Elsa.Mediator/Services/ICommandHandler.cs b/src/modules/Elsa.Mediator/Services/ICommandHandler.cs
similarity index 100%
rename from src/common/Elsa.Mediator/Services/ICommandHandler.cs
rename to src/modules/Elsa.Mediator/Services/ICommandHandler.cs
diff --git a/src/common/Elsa.Mediator/Services/ICommandSender.cs b/src/modules/Elsa.Mediator/Services/ICommandSender.cs
similarity index 100%
rename from src/common/Elsa.Mediator/Services/ICommandSender.cs
rename to src/modules/Elsa.Mediator/Services/ICommandSender.cs
diff --git a/src/common/Elsa.Mediator/Services/IEventPublisher.cs b/src/modules/Elsa.Mediator/Services/IEventPublisher.cs
similarity index 100%
rename from src/common/Elsa.Mediator/Services/IEventPublisher.cs
rename to src/modules/Elsa.Mediator/Services/IEventPublisher.cs
diff --git a/src/common/Elsa.Mediator/Services/IMediator.cs b/src/modules/Elsa.Mediator/Services/IMediator.cs
similarity index 100%
rename from src/common/Elsa.Mediator/Services/IMediator.cs
rename to src/modules/Elsa.Mediator/Services/IMediator.cs
diff --git a/src/common/Elsa.Mediator/Services/INotification.cs b/src/modules/Elsa.Mediator/Services/INotification.cs
similarity index 100%
rename from src/common/Elsa.Mediator/Services/INotification.cs
rename to src/modules/Elsa.Mediator/Services/INotification.cs
diff --git a/src/common/Elsa.Mediator/Services/INotificationHandler.cs b/src/modules/Elsa.Mediator/Services/INotificationHandler.cs
similarity index 100%
rename from src/common/Elsa.Mediator/Services/INotificationHandler.cs
rename to src/modules/Elsa.Mediator/Services/INotificationHandler.cs
diff --git a/src/common/Elsa.Mediator/Services/IRequest.cs b/src/modules/Elsa.Mediator/Services/IRequest.cs
similarity index 100%
rename from src/common/Elsa.Mediator/Services/IRequest.cs
rename to src/modules/Elsa.Mediator/Services/IRequest.cs
diff --git a/src/common/Elsa.Mediator/Services/IRequestHandler.cs b/src/modules/Elsa.Mediator/Services/IRequestHandler.cs
similarity index 100%
rename from src/common/Elsa.Mediator/Services/IRequestHandler.cs
rename to src/modules/Elsa.Mediator/Services/IRequestHandler.cs
diff --git a/src/common/Elsa.Mediator/Services/IRequestSender.cs b/src/modules/Elsa.Mediator/Services/IRequestSender.cs
similarity index 100%
rename from src/common/Elsa.Mediator/Services/IRequestSender.cs
rename to src/modules/Elsa.Mediator/Services/IRequestSender.cs
diff --git a/src/modules/Elsa.MemoryCache/Configuration/MemoryCacheConfigurator.cs b/src/modules/Elsa.MemoryCache/Configuration/MemoryCacheConfigurator.cs
deleted file mode 100644
index 87e80a6e6..000000000
--- a/src/modules/Elsa.MemoryCache/Configuration/MemoryCacheConfigurator.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using Elsa.ServiceConfiguration.Abstractions;
-using Elsa.ServiceConfiguration.Services;
-using Microsoft.Extensions.DependencyInjection;
-
-namespace Elsa.MemoryCache.Configuration;
-
-public class MemoryCacheConfigurator : ConfiguratorBase
-{
- public MemoryCacheConfigurator(IServiceConfiguration serviceConfiguration) : base(serviceConfiguration)
- {
- }
-
- public override void Configure()
- {
- Services.AddMemoryCache();
- }
-}
\ No newline at end of file
diff --git a/src/modules/Elsa.MemoryCache/Elsa.MemoryCache.csproj b/src/modules/Elsa.MemoryCache/Elsa.MemoryCache.csproj
index 8f4b53dd4..a2e8506ab 100644
--- a/src/modules/Elsa.MemoryCache/Elsa.MemoryCache.csproj
+++ b/src/modules/Elsa.MemoryCache/Elsa.MemoryCache.csproj
@@ -11,7 +11,7 @@
-
+
diff --git a/src/modules/Elsa.MemoryCache/Features/MemoryCacheFeature.cs b/src/modules/Elsa.MemoryCache/Features/MemoryCacheFeature.cs
new file mode 100644
index 000000000..199958a12
--- /dev/null
+++ b/src/modules/Elsa.MemoryCache/Features/MemoryCacheFeature.cs
@@ -0,0 +1,17 @@
+using Elsa.Features.Abstractions;
+using Elsa.Features.Services;
+using Microsoft.Extensions.DependencyInjection;
+
+namespace Elsa.MemoryCache.Features;
+
+public class MemoryCacheFeature : FeatureBase
+{
+ public MemoryCacheFeature(IModule module) : base(module)
+ {
+ }
+
+ public override void Configure()
+ {
+ Services.AddMemoryCache();
+ }
+}
\ No newline at end of file
diff --git a/src/modules/Elsa.ProtoActor/Configuration/ProtoActorConfigurator.cs b/src/modules/Elsa.ProtoActor/Configuration/ProtoActorFeature.cs
similarity index 89%
rename from src/modules/Elsa.ProtoActor/Configuration/ProtoActorConfigurator.cs
rename to src/modules/Elsa.ProtoActor/Configuration/ProtoActorFeature.cs
index 8b2eecec4..2e7d0635e 100644
--- a/src/modules/Elsa.ProtoActor/Configuration/ProtoActorConfigurator.cs
+++ b/src/modules/Elsa.ProtoActor/Configuration/ProtoActorFeature.cs
@@ -1,11 +1,12 @@
using System;
+using Elsa.Features.Abstractions;
+using Elsa.Features.Attributes;
+using Elsa.Features.Services;
using Elsa.ProtoActor.Grains;
using Elsa.ProtoActor.HostedServices;
using Elsa.ProtoActor.Implementations;
using Elsa.Runtime.Protos;
-using Elsa.ServiceConfiguration.Abstractions;
-using Elsa.ServiceConfiguration.Services;
-using Elsa.Workflows.Runtime.Configuration;
+using Elsa.Workflows.Runtime.Features;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Proto;
@@ -18,12 +19,19 @@ using Proto.Remote.GrpcNet;
namespace Elsa.ProtoActor.Configuration;
-public class ProtoActorConfigurator : ConfiguratorBase
+[DependsOn(typeof(WorkflowRuntimeFeature))]
+public class ProtoActorFeature : FeatureBase
{
- public ProtoActorConfigurator(IServiceConfiguration serviceConfiguration) : base(serviceConfiguration)
+ public ProtoActorFeature(IModule module) : base(module)
{
}
+ public override void Configure()
+ {
+ // Configure runtime with ProtoActor workflow invoker.
+ Module.Configure().WorkflowInvokerFactory = sp => ActivatorUtilities.CreateInstance(sp);
+ }
+
public override void Apply()
{
var services = Services;
@@ -56,9 +64,6 @@ public class ProtoActorConfigurator : ConfiguratorBase
// Client factory.
services.AddSingleton();
-
- // Configure runtime with ProtoActor workflow invoker.
- ServiceConfiguration.Configure().WorkflowInvokerFactory = sp => ActivatorUtilities.CreateInstance(sp);
}
public override void ConfigureHostedServices()
diff --git a/src/modules/Elsa.ProtoActor/Extensions/DependencyInjectionExtensions.cs b/src/modules/Elsa.ProtoActor/Extensions/DependencyInjectionExtensions.cs
index c4cc0aa47..dc3b9dc27 100644
--- a/src/modules/Elsa.ProtoActor/Extensions/DependencyInjectionExtensions.cs
+++ b/src/modules/Elsa.ProtoActor/Extensions/DependencyInjectionExtensions.cs
@@ -1,14 +1,14 @@
using System;
using Elsa.ProtoActor.Configuration;
-using Elsa.Workflows.Runtime.Configuration;
+using Elsa.Workflows.Runtime.Features;
namespace Elsa.ProtoActor.Extensions;
public static class DependencyInjectionExtensions
{
- public static WorkflowRuntimeConfigurator UseProtoActor(this WorkflowRuntimeConfigurator configurator, Action? configure = default)
+ public static WorkflowRuntimeFeature UseProtoActor(this WorkflowRuntimeFeature feature, Action? configure = default)
{
- configurator.ServiceConfiguration.Configure(configure);
- return configurator;
+ feature.Module.Configure(configure);
+ return feature;
}
}
\ No newline at end of file
diff --git a/src/modules/Elsa.Workflows.Api/Elsa.Workflows.Api.csproj b/src/modules/Elsa.Workflows.Api/Elsa.Workflows.Api.csproj
index 88cfdd531..5d976639b 100644
--- a/src/modules/Elsa.Workflows.Api/Elsa.Workflows.Api.csproj
+++ b/src/modules/Elsa.Workflows.Api/Elsa.Workflows.Api.csproj
@@ -11,7 +11,7 @@
-
+
diff --git a/src/modules/Elsa.Workflows.Core/Elsa.Workflows.Core.csproj b/src/modules/Elsa.Workflows.Core/Elsa.Workflows.Core.csproj
index 4e5ace236..2fcf7a69d 100644
--- a/src/modules/Elsa.Workflows.Core/Elsa.Workflows.Core.csproj
+++ b/src/modules/Elsa.Workflows.Core/Elsa.Workflows.Core.csproj
@@ -18,8 +18,8 @@
-
-
+
+
diff --git a/src/modules/Elsa.Workflows.Core/Extensions/DependencyInjectionExtensions.cs b/src/modules/Elsa.Workflows.Core/Extensions/DependencyInjectionExtensions.cs
index 0fd74d81d..c59125510 100644
--- a/src/modules/Elsa.Workflows.Core/Extensions/DependencyInjectionExtensions.cs
+++ b/src/modules/Elsa.Workflows.Core/Extensions/DependencyInjectionExtensions.cs
@@ -1,11 +1,11 @@
-using Elsa.ServiceConfiguration.Services;
-using Elsa.Workflows.Core.Configuration;
+using Elsa.Features.Services;
+using Elsa.Workflows.Core.Features;
namespace Elsa.Workflows.Core;
public static class DependencyInjectionExtensions
{
- public static IServiceConfiguration UseWorkflows(this IServiceConfiguration configuration, Action? configure = default)
+ public static IModule UseWorkflows(this IModule configuration, Action? configure = default)
{
configuration.Configure(configure);
return configuration;
diff --git a/src/modules/Elsa.Workflows.Core/Configuration/WorkflowsConfigurator.cs b/src/modules/Elsa.Workflows.Core/Features/WorkflowsFeature.cs
similarity index 83%
rename from src/modules/Elsa.Workflows.Core/Configuration/WorkflowsConfigurator.cs
rename to src/modules/Elsa.Workflows.Core/Features/WorkflowsFeature.cs
index f3842b705..e87c8c2eb 100644
--- a/src/modules/Elsa.Workflows.Core/Configuration/WorkflowsConfigurator.cs
+++ b/src/modules/Elsa.Workflows.Core/Features/WorkflowsFeature.cs
@@ -1,9 +1,9 @@
using Elsa.Expressions;
-using Elsa.Expressions.Configuration;
using Elsa.Expressions.Extensions;
-using Elsa.ServiceConfiguration.Abstractions;
-using Elsa.ServiceConfiguration.Attributes;
-using Elsa.ServiceConfiguration.Services;
+using Elsa.Expressions.Features;
+using Elsa.Features.Abstractions;
+using Elsa.Features.Attributes;
+using Elsa.Features.Services;
using Elsa.Workflows.Core.ActivityNodeResolvers;
using Elsa.Workflows.Core.Expressions;
using Elsa.Workflows.Core.Implementations;
@@ -13,12 +13,12 @@ using Elsa.Workflows.Core.Serialization;
using Elsa.Workflows.Core.Services;
using Microsoft.Extensions.DependencyInjection;
-namespace Elsa.Workflows.Core.Configuration;
+namespace Elsa.Workflows.Core.Features;
-[Dependency(typeof(ExpressionsConfigurator))]
-public class WorkflowsConfigurator : ConfiguratorBase
+[DependsOn(typeof(ExpressionsFeature))]
+public class WorkflowsFeature : FeatureBase
{
- public WorkflowsConfigurator(IServiceConfiguration serviceConfiguration) : base(serviceConfiguration)
+ public WorkflowsFeature(IModule module) : base(module)
{
}
@@ -32,13 +32,13 @@ public class WorkflowsConfigurator : ConfiguratorBase
///
public Func StandardOutStreamProvider { get; set; } = _ => new StandardOutStreamProvider(Console.Out);
- public WorkflowsConfigurator WithStandardInStreamProvider(Func provider)
+ public WorkflowsFeature WithStandardInStreamProvider(Func provider)
{
StandardInStreamProvider = provider;
return this;
}
- public WorkflowsConfigurator WithStandardOutStreamProvider(Func provider)
+ public WorkflowsFeature WithStandardOutStreamProvider(Func provider)
{
StandardOutStreamProvider = provider;
return this;
diff --git a/src/modules/Elsa.Workflows.Management/Elsa.Workflows.Management.csproj b/src/modules/Elsa.Workflows.Management/Elsa.Workflows.Management.csproj
index 411a5277a..e39e3271f 100644
--- a/src/modules/Elsa.Workflows.Management/Elsa.Workflows.Management.csproj
+++ b/src/modules/Elsa.Workflows.Management/Elsa.Workflows.Management.csproj
@@ -13,7 +13,7 @@
-
+
diff --git a/src/modules/Elsa.Workflows.Management/Extensions/DependencyInjectionExtensions.cs b/src/modules/Elsa.Workflows.Management/Extensions/DependencyInjectionExtensions.cs
index 8a98cad02..1592afb8b 100644
--- a/src/modules/Elsa.Workflows.Management/Extensions/DependencyInjectionExtensions.cs
+++ b/src/modules/Elsa.Workflows.Management/Extensions/DependencyInjectionExtensions.cs
@@ -1,13 +1,13 @@
-using Elsa.ServiceConfiguration.Services;
-using Elsa.Workflows.Management.Configuration;
+using Elsa.Features.Services;
+using Elsa.Workflows.Management.Features;
namespace Elsa.Workflows.Management.Extensions;
public static class DependencyInjectionExtensions
{
- public static IServiceConfiguration UseManagement(this IServiceConfiguration serviceConfiguration, Action? configure = default)
+ public static IModule UseManagement(this IModule module, Action? configure = default)
{
- serviceConfiguration.Configure(configure);
- return serviceConfiguration;
+ module.Configure(configure);
+ return module;
}
}
\ No newline at end of file
diff --git a/src/modules/Elsa.Workflows.Management/Configuration/WorkflowManagementConfigurator.cs b/src/modules/Elsa.Workflows.Management/Features/WorkflowManagementFeature.cs
similarity index 73%
rename from src/modules/Elsa.Workflows.Management/Configuration/WorkflowManagementConfigurator.cs
rename to src/modules/Elsa.Workflows.Management/Features/WorkflowManagementFeature.cs
index 946270bb9..224239c86 100644
--- a/src/modules/Elsa.Workflows.Management/Configuration/WorkflowManagementConfigurator.cs
+++ b/src/modules/Elsa.Workflows.Management/Features/WorkflowManagementFeature.cs
@@ -1,10 +1,9 @@
using Elsa.Expressions.Services;
-using Elsa.Mediator.Configuration;
-using Elsa.Mediator.Extensions;
-using Elsa.ServiceConfiguration.Abstractions;
-using Elsa.ServiceConfiguration.Attributes;
-using Elsa.ServiceConfiguration.Services;
-using Elsa.Workflows.Core.Configuration;
+using Elsa.Features.Abstractions;
+using Elsa.Features.Attributes;
+using Elsa.Features.Services;
+using Elsa.Mediator.Features;
+using Elsa.Workflows.Core.Features;
using Elsa.Workflows.Core.Serialization;
using Elsa.Workflows.Core.Services;
using Elsa.Workflows.Management.Implementations;
@@ -13,23 +12,23 @@ using Elsa.Workflows.Management.Options;
using Elsa.Workflows.Management.Providers;
using Elsa.Workflows.Management.Serialization;
using Elsa.Workflows.Management.Services;
-using Elsa.Workflows.Persistence.Configuration;
+using Elsa.Workflows.Persistence.Features;
using Microsoft.Extensions.DependencyInjection;
-namespace Elsa.Workflows.Management.Configuration;
+namespace Elsa.Workflows.Management.Features;
-[Dependency(typeof(MediatorConfigurator))]
-[Dependency(typeof(WorkflowsConfigurator))]
-[Dependency(typeof(WorkflowPersistenceConfigurator))]
-public class WorkflowManagementConfigurator : ConfiguratorBase
+[DependsOn(typeof(MediatorFeature))]
+[DependsOn(typeof(WorkflowsFeature))]
+[DependsOn(typeof(WorkflowPersistenceFeature))]
+public class WorkflowManagementFeature : FeatureBase
{
- public WorkflowManagementConfigurator(IServiceConfiguration serviceConfiguration) : base(serviceConfiguration)
+ public WorkflowManagementFeature(IModule module) : base(module)
{
}
public HashSet ActivityTypes { get; } = new();
- public WorkflowManagementConfigurator AddActivity() where T : IActivity
+ public WorkflowManagementFeature AddActivity() where T : IActivity
{
ActivityTypes.Add(typeof(T));
return this;
diff --git a/src/modules/Elsa.Workflows.Persistence.EntityFrameworkCore.Sqlite/DbContextOptionsBuilderExtensions.cs b/src/modules/Elsa.Workflows.Persistence.EntityFrameworkCore.Sqlite/DbContextOptionsBuilderExtensions.cs
index e2b8abdda..dc94421ea 100644
--- a/src/modules/Elsa.Workflows.Persistence.EntityFrameworkCore.Sqlite/DbContextOptionsBuilderExtensions.cs
+++ b/src/modules/Elsa.Workflows.Persistence.EntityFrameworkCore.Sqlite/DbContextOptionsBuilderExtensions.cs
@@ -1,15 +1,15 @@
using Elsa.Persistence.EntityFrameworkCore.Common.Abstractions;
-using Elsa.Workflows.Persistence.EntityFrameworkCore.Configuration;
+using Elsa.Workflows.Persistence.EntityFrameworkCore.Features;
using Microsoft.EntityFrameworkCore;
namespace Elsa.Workflows.Persistence.EntityFrameworkCore.Sqlite
{
public static class DbContextOptionsBuilderExtensions
{
- public static EFCoreWorkflowPersistenceConfigurator UseSqlite(this EFCoreWorkflowPersistenceConfigurator configurator, string connectionString = "Data Source=elsa.sqlite.db;Cache=Shared;")
+ public static EFCoreWorkflowPersistenceFeature UseSqlite(this EFCoreWorkflowPersistenceFeature feature, string connectionString = "Data Source=elsa.sqlite.db;Cache=Shared;")
{
- configurator.ConfigureDbContextOptions((_, db) => db.UseSqlite(connectionString));
- return configurator;
+ feature.ConfigureDbContextOptions((_, db) => db.UseSqlite(connectionString));
+ return feature;
}
public static DbContextOptionsBuilder UseSqlite(this DbContextOptionsBuilder builder, string connectionString = "Data Source=elsa.sqlite.db;Cache=Shared;") =>
diff --git a/src/modules/Elsa.Workflows.Persistence.EntityFrameworkCore/Extensions/DependencyInjectionExtensions.cs b/src/modules/Elsa.Workflows.Persistence.EntityFrameworkCore/Extensions/DependencyInjectionExtensions.cs
index 3919549c1..1d8d1211f 100644
--- a/src/modules/Elsa.Workflows.Persistence.EntityFrameworkCore/Extensions/DependencyInjectionExtensions.cs
+++ b/src/modules/Elsa.Workflows.Persistence.EntityFrameworkCore/Extensions/DependencyInjectionExtensions.cs
@@ -1,13 +1,13 @@
-using Elsa.Workflows.Persistence.Configuration;
-using Elsa.Workflows.Persistence.EntityFrameworkCore.Configuration;
+using Elsa.Workflows.Persistence.EntityFrameworkCore.Features;
+using Elsa.Workflows.Persistence.Features;
namespace Elsa.Workflows.Persistence.EntityFrameworkCore.Extensions;
public static class DependencyInjectionExtensions
{
- public static WorkflowPersistenceConfigurator UseEntityFrameworkCore(this WorkflowPersistenceConfigurator configurator, Action configure)
+ public static WorkflowPersistenceFeature UseEntityFrameworkCore(this WorkflowPersistenceFeature feature, Action configure)
{
- configurator.ServiceConfiguration.Configure(configure);
- return configurator;
+ feature.Module.Configure(configure);
+ return feature;
}
}
\ No newline at end of file
diff --git a/src/modules/Elsa.Workflows.Persistence.EntityFrameworkCore/Configuration/EFCoreWorkflowPersistenceConfigurator.cs b/src/modules/Elsa.Workflows.Persistence.EntityFrameworkCore/Features/EFCoreWorkflowPersistenceFeature.cs
similarity index 75%
rename from src/modules/Elsa.Workflows.Persistence.EntityFrameworkCore/Configuration/EFCoreWorkflowPersistenceConfigurator.cs
rename to src/modules/Elsa.Workflows.Persistence.EntityFrameworkCore/Features/EFCoreWorkflowPersistenceFeature.cs
index f4f719ce5..2e0365462 100644
--- a/src/modules/Elsa.Workflows.Persistence.EntityFrameworkCore/Configuration/EFCoreWorkflowPersistenceConfigurator.cs
+++ b/src/modules/Elsa.Workflows.Persistence.EntityFrameworkCore/Features/EFCoreWorkflowPersistenceFeature.cs
@@ -1,23 +1,23 @@
+using Elsa.Features.Services;
using Elsa.Persistence.EntityFrameworkCore.Common.Abstractions;
using Elsa.Persistence.EntityFrameworkCore.Common.Services;
-using Elsa.ServiceConfiguration.Services;
-using Elsa.Workflows.Persistence.Configuration;
using Elsa.Workflows.Persistence.Entities;
using Elsa.Workflows.Persistence.EntityFrameworkCore.Handlers;
using Elsa.Workflows.Persistence.EntityFrameworkCore.Implementations;
+using Elsa.Workflows.Persistence.Features;
using Microsoft.Extensions.DependencyInjection;
-namespace Elsa.Workflows.Persistence.EntityFrameworkCore.Configuration;
+namespace Elsa.Workflows.Persistence.EntityFrameworkCore.Features;
-public class EFCoreWorkflowPersistenceConfigurator : EFCorePersistenceConfigurator
+public class EFCoreWorkflowPersistenceFeature : EFCorePersistenceFeature
{
- public EFCoreWorkflowPersistenceConfigurator(IServiceConfiguration serviceConfiguration) : base(serviceConfiguration)
+ public EFCoreWorkflowPersistenceFeature(IModule module) : base(module)
{
}
public override void Configure()
{
- ServiceConfiguration.Configure().WithWorkflowDefinitionStore(sp => sp.GetRequiredService())
+ Module.Configure().WithWorkflowDefinitionStore(sp => sp.GetRequiredService())
.WithWorkflowInstanceStore(sp => sp.GetRequiredService())
.WithWorkflowBookmarkStore(sp => sp.GetRequiredService())
.WithWorkflowTriggerStore(sp => sp.GetRequiredService())
diff --git a/src/modules/Elsa.Workflows.Persistence/Extensions/DependencyInjectionExtensions.cs b/src/modules/Elsa.Workflows.Persistence/Extensions/DependencyInjectionExtensions.cs
index 804c80594..f614c0c1e 100644
--- a/src/modules/Elsa.Workflows.Persistence/Extensions/DependencyInjectionExtensions.cs
+++ b/src/modules/Elsa.Workflows.Persistence/Extensions/DependencyInjectionExtensions.cs
@@ -1,13 +1,13 @@
-using Elsa.ServiceConfiguration.Services;
-using Elsa.Workflows.Persistence.Configuration;
+using Elsa.Features.Services;
+using Elsa.Workflows.Persistence.Features;
namespace Elsa.Workflows.Persistence.Extensions;
public static class DependencyInjectionExtensions
{
- public static IServiceConfiguration UsePersistence(this IServiceConfiguration serviceConfiguration, Action? configure = default )
+ public static IModule UseWorkflowPersistence(this IModule module, Action? configure = default )
{
- serviceConfiguration.Configure(configure);
- return serviceConfiguration;
+ module.Configure(configure);
+ return module;
}
}
\ No newline at end of file
diff --git a/src/modules/Elsa.Workflows.Persistence/Configuration/WorkflowPersistenceConfigurator.cs b/src/modules/Elsa.Workflows.Persistence/Features/WorkflowPersistenceFeature.cs
similarity index 66%
rename from src/modules/Elsa.Workflows.Persistence/Configuration/WorkflowPersistenceConfigurator.cs
rename to src/modules/Elsa.Workflows.Persistence/Features/WorkflowPersistenceFeature.cs
index dceb260de..fff15a62b 100644
--- a/src/modules/Elsa.Workflows.Persistence/Configuration/WorkflowPersistenceConfigurator.cs
+++ b/src/modules/Elsa.Workflows.Persistence/Features/WorkflowPersistenceFeature.cs
@@ -1,19 +1,19 @@
+using Elsa.Features.Abstractions;
+using Elsa.Features.Attributes;
+using Elsa.Features.Services;
using Elsa.Persistence.Common.Extensions;
-using Elsa.ServiceConfiguration.Abstractions;
-using Elsa.ServiceConfiguration.Attributes;
-using Elsa.ServiceConfiguration.Services;
-using Elsa.Workflows.Core.Configuration;
+using Elsa.Workflows.Core.Features;
using Elsa.Workflows.Persistence.Entities;
using Elsa.Workflows.Persistence.Implementations;
using Elsa.Workflows.Persistence.Services;
using Microsoft.Extensions.DependencyInjection;
-namespace Elsa.Workflows.Persistence.Configuration;
+namespace Elsa.Workflows.Persistence.Features;
-[Dependency(typeof(WorkflowsConfigurator))]
-public class WorkflowPersistenceConfigurator : ConfiguratorBase
+[DependsOn(typeof(WorkflowsFeature))]
+public class WorkflowPersistenceFeature : FeatureBase
{
- public WorkflowPersistenceConfigurator(IServiceConfiguration serviceConfiguration) : base(serviceConfiguration)
+ public WorkflowPersistenceFeature(IModule module) : base(module)
{
}
@@ -23,31 +23,31 @@ public class WorkflowPersistenceConfigurator : ConfiguratorBase
public Func WorkflowTriggerStore { get; set; } = sp => sp.GetRequiredService();
public Func WorkflowExecutionLogStore { get; set; } = sp => sp.GetRequiredService();
- public WorkflowPersistenceConfigurator WithWorkflowDefinitionStore(Func factory)
+ public WorkflowPersistenceFeature WithWorkflowDefinitionStore(Func factory)
{
WorkflowDefinitionStore = factory;
return this;
}
- public WorkflowPersistenceConfigurator WithWorkflowInstanceStore(Func factory)
+ public WorkflowPersistenceFeature WithWorkflowInstanceStore(Func factory)
{
WorkflowInstanceStore = factory;
return this;
}
- public WorkflowPersistenceConfigurator WithWorkflowBookmarkStore(Func factory)
+ public WorkflowPersistenceFeature WithWorkflowBookmarkStore(Func factory)
{
WorkflowBookmarkStore = factory;
return this;
}
- public WorkflowPersistenceConfigurator WithWorkflowTriggerStore(Func factory)
+ public WorkflowPersistenceFeature WithWorkflowTriggerStore(Func factory)
{
WorkflowTriggerStore = factory;
return this;
}
- public WorkflowPersistenceConfigurator WithWorkflowExecutionLogStore(Func factory)
+ public WorkflowPersistenceFeature WithWorkflowExecutionLogStore(Func factory)
{
WorkflowExecutionLogStore = factory;
return this;
diff --git a/src/modules/Elsa.Workflows.Runtime/Elsa.Workflows.Runtime.csproj b/src/modules/Elsa.Workflows.Runtime/Elsa.Workflows.Runtime.csproj
index 3b520caff..e8f71d3a5 100644
--- a/src/modules/Elsa.Workflows.Runtime/Elsa.Workflows.Runtime.csproj
+++ b/src/modules/Elsa.Workflows.Runtime/Elsa.Workflows.Runtime.csproj
@@ -8,7 +8,7 @@
-
+
diff --git a/src/modules/Elsa.Workflows.Runtime/Extensions/DependencyInjectionExtensions.cs b/src/modules/Elsa.Workflows.Runtime/Extensions/DependencyInjectionExtensions.cs
index 6343b6245..7ec7dfdbb 100644
--- a/src/modules/Elsa.Workflows.Runtime/Extensions/DependencyInjectionExtensions.cs
+++ b/src/modules/Elsa.Workflows.Runtime/Extensions/DependencyInjectionExtensions.cs
@@ -1,6 +1,6 @@
using System.Threading.Channels;
-using Elsa.ServiceConfiguration.Services;
-using Elsa.Workflows.Runtime.Configuration;
+using Elsa.Features.Services;
+using Elsa.Workflows.Runtime.Features;
using Elsa.Workflows.Runtime.Services;
using Microsoft.Extensions.DependencyInjection;
@@ -8,10 +8,10 @@ namespace Elsa.Workflows.Runtime.Extensions;
public static class DependencyInjectionExtensions
{
- public static IServiceConfiguration UseRuntime(this IServiceConfiguration serviceConfiguration, Action? configure = default)
+ public static IModule UseRuntime(this IModule module, Action? configure = default)
{
- serviceConfiguration.Configure(configure);
- return serviceConfiguration;
+ module.Configure(configure);
+ return module;
}
public static IServiceCollection CreateChannel(this IServiceCollection services) =>
diff --git a/src/modules/Elsa.Workflows.Runtime/Configuration/WorkflowRuntimeConfigurator.cs b/src/modules/Elsa.Workflows.Runtime/Features/WorkflowRuntimeFeature.cs
similarity index 88%
rename from src/modules/Elsa.Workflows.Runtime/Configuration/WorkflowRuntimeConfigurator.cs
rename to src/modules/Elsa.Workflows.Runtime/Features/WorkflowRuntimeFeature.cs
index 6009e9ad2..d643a9644 100644
--- a/src/modules/Elsa.Workflows.Runtime/Configuration/WorkflowRuntimeConfigurator.cs
+++ b/src/modules/Elsa.Workflows.Runtime/Features/WorkflowRuntimeFeature.cs
@@ -1,6 +1,6 @@
+using Elsa.Features.Abstractions;
+using Elsa.Features.Services;
using Elsa.Mediator.Extensions;
-using Elsa.ServiceConfiguration.Abstractions;
-using Elsa.ServiceConfiguration.Services;
using Elsa.Workflows.Core.Services;
using Elsa.Workflows.Runtime.Extensions;
using Elsa.Workflows.Runtime.HostedServices;
@@ -13,11 +13,11 @@ using Elsa.Workflows.Runtime.Stimuli.Handlers;
using Elsa.Workflows.Runtime.WorkflowProviders;
using Microsoft.Extensions.DependencyInjection;
-namespace Elsa.Workflows.Runtime.Configuration;
+namespace Elsa.Workflows.Runtime.Features;
-public class WorkflowRuntimeConfigurator : ConfiguratorBase
+public class WorkflowRuntimeFeature : FeatureBase
{
- public WorkflowRuntimeConfigurator(IServiceConfiguration serviceConfiguration) : base(serviceConfiguration)
+ public WorkflowRuntimeFeature(IModule module) : base(module)
{
}
@@ -36,6 +36,14 @@ public class WorkflowRuntimeConfigurator : ConfiguratorBase
///
public Func WorkflowDispatcherFactory { get; set; } = sp => ActivatorUtilities.CreateInstance(sp);
+ public override void ConfigureHostedServices() =>
+ Module
+ .ConfigureHostedService()
+ .ConfigureHostedService()
+ .ConfigureHostedService()
+ .ConfigureHostedService()
+ .ConfigureHostedService();
+
public override void Apply()
{
Services
@@ -64,7 +72,7 @@ public class WorkflowRuntimeConfigurator : ConfiguratorBase
.AddSingleton()
// Domain event handlers.
- .AddNotificationHandlersFrom(typeof(WorkflowRuntimeConfigurator))
+ .AddNotificationHandlersFrom(typeof(WorkflowRuntimeFeature))
// Channels for dispatching workflows in-memory.
.CreateChannel()
@@ -73,12 +81,4 @@ public class WorkflowRuntimeConfigurator : ConfiguratorBase
Services.Configure(options => options.Workflows = Workflows);
}
-
- public override void ConfigureHostedServices() =>
- ServiceConfiguration
- .ConfigureHostedService()
- .ConfigureHostedService()
- .ConfigureHostedService()
- .ConfigureHostedService()
- .ConfigureHostedService();
}
\ No newline at end of file
diff --git a/src/modules/Elsa.Workflows.Runtime/WorkflowProviders/ClrWorkflowDefinitionProvider.cs b/src/modules/Elsa.Workflows.Runtime/WorkflowProviders/ClrWorkflowDefinitionProvider.cs
index 213de0ca8..8f1c5e7a2 100644
--- a/src/modules/Elsa.Workflows.Runtime/WorkflowProviders/ClrWorkflowDefinitionProvider.cs
+++ b/src/modules/Elsa.Workflows.Runtime/WorkflowProviders/ClrWorkflowDefinitionProvider.cs
@@ -4,7 +4,7 @@ using Elsa.Workflows.Core.Builders;
using Elsa.Workflows.Core.Serialization;
using Elsa.Workflows.Core.Services;
using Elsa.Workflows.Persistence.Entities;
-using Elsa.Workflows.Runtime.Configuration;
+using Elsa.Workflows.Runtime.Features;
using Elsa.Workflows.Runtime.Options;
using Elsa.Workflows.Runtime.Services;
using Microsoft.Extensions.Options;
@@ -12,7 +12,7 @@ using Microsoft.Extensions.Options;
namespace Elsa.Workflows.Runtime.WorkflowProviders;
///
-/// Provides workflows to the system that are registered with
+/// Provides workflows to the system that are registered with
///
public class ClrWorkflowDefinitionProvider : IWorkflowDefinitionProvider
{
diff --git a/src/samples/aspnet/Elsa.Samples.Web1/Elsa.Samples.Web1.csproj b/src/samples/aspnet/Elsa.Samples.Web1/Elsa.Samples.Web1.csproj
index 1f0c54a12..043937f79 100644
--- a/src/samples/aspnet/Elsa.Samples.Web1/Elsa.Samples.Web1.csproj
+++ b/src/samples/aspnet/Elsa.Samples.Web1/Elsa.Samples.Web1.csproj
@@ -7,7 +7,7 @@
-
+
diff --git a/src/samples/aspnet/Elsa.Samples.Web1/Program.cs b/src/samples/aspnet/Elsa.Samples.Web1/Program.cs
index d83c64a89..105ac9ed0 100644
--- a/src/samples/aspnet/Elsa.Samples.Web1/Program.cs
+++ b/src/samples/aspnet/Elsa.Samples.Web1/Program.cs
@@ -36,7 +36,7 @@ var sqlServerConnectionString = configuration.GetConnectionString("SqlServer");
// Add Elsa services.
services
.AddElsa(elsa => elsa
- .UsePersistence(persistence => persistence.UseEntityFrameworkCore(ef => ef.UseSqlite()))
+ .UseWorkflowPersistence(persistence => persistence.UseEntityFrameworkCore(ef => ef.UseSqlite()))
.UseRuntime(runtime =>
{
runtime.Workflows.Add();