Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[New Activity] Command Executer #6322

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
12 changes: 10 additions & 2 deletions Elsa.sln
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.7.34003.232
Expand Down Expand Up @@ -84,14 +85,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docker", "docker", "{986E54
ProjectSection(SolutionItems) = preProject
docker\.dockerignore = docker\.dockerignore
docker\docker-compose-datadog.yml = docker\docker-compose-datadog.yml
docker\docker-compose-kafka.yml = docker\docker-compose-kafka.yml
docker\docker-compose.yml = docker\docker-compose.yml
docker\ElsaServer-Datadog.Dockerfile = docker\ElsaServer-Datadog.Dockerfile
docker\ElsaServer.Dockerfile = docker\ElsaServer.Dockerfile
docker\ElsaServerAndStudio.Dockerfile = docker\ElsaServerAndStudio.Dockerfile
docker\ElsaStudio.Dockerfile = docker\ElsaStudio.Dockerfile
docker\init-db.sh = docker\init-db.sh
docker\otel-collector-config.yaml = docker\otel-collector-config.yaml
docker\docker-compose-kafka.yml = docker\docker-compose-kafka.yml
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Elasticsearch", "src\modules\Elsa.Elasticsearch\Elsa.Elasticsearch.csproj", "{3246883E-2FA7-4B4A-BDC5-99039A2869BC}"
Expand Down Expand Up @@ -387,6 +388,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Agents.Persistence.Ent
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Kafka", "src\modules\Elsa.Kafka\Elsa.Kafka.csproj", "{BF934627-F531-44FB-BEC2-ECA801FF31E7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.CommandExecuter", "src\scripting\Elsa.Command\Elsa.CommandExecuter.csproj", "{E302FEE1-17B5-4CCE-B072-F543A00E4D39}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -823,6 +826,10 @@ Global
{BF934627-F531-44FB-BEC2-ECA801FF31E7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BF934627-F531-44FB-BEC2-ECA801FF31E7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BF934627-F531-44FB-BEC2-ECA801FF31E7}.Release|Any CPU.Build.0 = Release|Any CPU
{E302FEE1-17B5-4CCE-B072-F543A00E4D39}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E302FEE1-17B5-4CCE-B072-F543A00E4D39}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E302FEE1-17B5-4CCE-B072-F543A00E4D39}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E302FEE1-17B5-4CCE-B072-F543A00E4D39}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -929,6 +936,7 @@ Global
{690B0274-291F-4D9E-BA76-54EFF7D3E4BC} = {D92BEAB2-60D6-4BB4-885A-6BA681C6CCF1}
{060FD0BA-BD78-48E1-A8A7-4906A5AD5E39} = {D92BEAB2-60D6-4BB4-885A-6BA681C6CCF1}
{169A82A5-2DB3-40EA-801E-14C08D743DF7} = {D92BEAB2-60D6-4BB4-885A-6BA681C6CCF1}
{2CDF3E1C-267D-4198-B1C7-7E1F548FC120} = {5BA4A8FA-F7F4-45B3-AEC8-8886D35AAC79}
{01B96BB9-35E8-4364-ACB8-6D12A14D8DBA} = {5BA4A8FA-F7F4-45B3-AEC8-8886D35AAC79}
{47FBCB04-0C2D-453C-BE2F-7052CAC22524} = {EB3A7401-0DE3-476F-9E6F-057F1F4590FB}
{B32DB9B2-AD6C-48A5-8682-4373CB045185} = {C80C8231-D35C-4ACC-9ED6-9F3DB221535E}
Expand Down Expand Up @@ -966,8 +974,8 @@ Global
{2F3E1026-5054-4E1F-899B-F1A7F70F9912} = {5BA4A8FA-F7F4-45B3-AEC8-8886D35AAC79}
{D5720DBC-8C2B-42D5-9D9F-2FF6EAD4001C} = {2F3E1026-5054-4E1F-899B-F1A7F70F9912}
{2B939AC9-03A4-479E-AA0D-CB58F4A7F480} = {50470834-4CD8-479A-8B58-0A1869BA5D37}
{2CDF3E1C-267D-4198-B1C7-7E1F548FC120} = {5BA4A8FA-F7F4-45B3-AEC8-8886D35AAC79}
{BF934627-F531-44FB-BEC2-ECA801FF31E7} = {DD089B8B-DA73-492A-9010-F772D1C178DA}
{E302FEE1-17B5-4CCE-B072-F543A00E4D39} = {6EF07978-A6D2-40EB-891D-7D70C5F37E76}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D4B5CEAA-7D70-4FCB-A68E-B03FBE5E0E5E}
Expand Down
75 changes: 38 additions & 37 deletions src/apps/Elsa.Server.Web/Elsa.Server.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
<ProjectReference Include="..\..\modules\Elsa.Caching.Distributed.MassTransit\Elsa.Caching.Distributed.MassTransit.csproj" />
<ProjectReference Include="..\..\modules\Elsa.Caching.Distributed.ProtoActor\Elsa.Caching.Distributed.ProtoActor.csproj" />
<ProjectReference Include="..\..\modules\Elsa.EntityFrameworkCore.MySql\Elsa.EntityFrameworkCore.MySql.csproj" Condition=" '$(TargetFramework)' != 'net9.0' " />
<ProjectReference Include="..\..\modules\Elsa.EntityFrameworkCore.PostgreSql\Elsa.EntityFrameworkCore.PostgreSql.csproj"/>
<ProjectReference Include="..\..\modules\Elsa.EntityFrameworkCore.PostgreSql\Elsa.EntityFrameworkCore.PostgreSql.csproj" />
<ProjectReference Include="..\..\modules\Elsa.Kafka\Elsa.Kafka.csproj" />
<ProjectReference Include="..\..\modules\Elsa.MassTransit.AzureServiceBus\Elsa.MassTransit.AzureServiceBus.csproj"/>
<ProjectReference Include="..\..\modules\Elsa.MassTransit.AzureServiceBus\Elsa.MassTransit.AzureServiceBus.csproj" />
<ProjectReference Include="..\..\modules\Elsa.OpenTelemetry\Elsa.OpenTelemetry.csproj" />
<ProjectReference Include="..\..\modules\Elsa.Quartz.EntityFrameworkCore.MySql\Elsa.Quartz.EntityFrameworkCore.MySql.csproj" Condition=" '$(TargetFramework)' != 'net9.0' " />
<ProjectReference Include="..\..\modules\Elsa.Retention\Elsa.Retention.csproj" />
Expand All @@ -21,48 +21,49 @@
<ProjectReference Include="..\..\modules\Elsa.Secrets.Persistence.EntityFrameworkCore.SqlServer\Elsa.Secrets.Persistence.EntityFrameworkCore.SqlServer.csproj" />
<ProjectReference Include="..\..\modules\Elsa.Secrets.Scripting\Elsa.Secrets.Scripting.csproj" />
<ProjectReference Include="..\..\modules\Elsa.Tenants.AspNetCore\Elsa.Tenants.AspNetCore.csproj" />
<ProjectReference Include="..\..\modules\Elsa\Elsa.csproj"/>
<ProjectReference Include="..\..\common\Elsa.DropIns\Elsa.DropIns.csproj"/>
<ProjectReference Include="..\..\modules\Elsa.Alterations.MassTransit\Elsa.Alterations.MassTransit.csproj"/>
<ProjectReference Include="..\..\modules\Elsa.Alterations\Elsa.Alterations.csproj"/>
<ProjectReference Include="..\..\modules\Elsa.CSharp\Elsa.CSharp.csproj"/>
<ProjectReference Include="..\..\modules\Elsa.EntityFrameworkCore.Sqlite\Elsa.EntityFrameworkCore.Sqlite.csproj"/>
<ProjectReference Include="..\..\modules\Elsa.EntityFrameworkCore.SqlServer\Elsa.EntityFrameworkCore.SqlServer.csproj"/>
<ProjectReference Include="..\..\modules\Elsa.MassTransit.RabbitMq\Elsa.MassTransit.RabbitMq.csproj"/>
<ProjectReference Include="..\..\modules\Elsa.Python\Elsa.Python.csproj"/>
<ProjectReference Include="..\..\modules\Elsa.Quartz.EntityFrameworkCore.Sqlite\Elsa.Quartz.EntityFrameworkCore.Sqlite.csproj"/>
<ProjectReference Include="..\..\modules\Elsa.FileStorage\Elsa.FileStorage.csproj"/>
<ProjectReference Include="..\..\modules\Elsa.Dapper.Migrations\Elsa.Dapper.Migrations.csproj"/>
<ProjectReference Include="..\..\modules\Elsa.Dapper\Elsa.Dapper.csproj"/>
<ProjectReference Include="..\..\modules\Elsa.Elasticsearch\Elsa.Elasticsearch.csproj"/>
<ProjectReference Include="..\..\modules\Elsa.Email\Elsa.Email.csproj"/>
<ProjectReference Include="..\..\modules\Elsa.EntityFrameworkCore\Elsa.EntityFrameworkCore.csproj"/>
<ProjectReference Include="..\..\modules\Elsa.Environments\Elsa.Environments.csproj"/>
<ProjectReference Include="..\..\modules\Elsa.MassTransit\Elsa.MassTransit.csproj"/>
<ProjectReference Include="..\..\modules\Elsa.MongoDb\Elsa.MongoDb.csproj"/>
<ProjectReference Include="..\..\modules\Elsa\Elsa.csproj" />
<ProjectReference Include="..\..\common\Elsa.DropIns\Elsa.DropIns.csproj" />
<ProjectReference Include="..\..\modules\Elsa.Alterations.MassTransit\Elsa.Alterations.MassTransit.csproj" />
<ProjectReference Include="..\..\modules\Elsa.Alterations\Elsa.Alterations.csproj" />
<ProjectReference Include="..\..\modules\Elsa.CSharp\Elsa.CSharp.csproj" />
<ProjectReference Include="..\..\modules\Elsa.EntityFrameworkCore.Sqlite\Elsa.EntityFrameworkCore.Sqlite.csproj" />
<ProjectReference Include="..\..\modules\Elsa.EntityFrameworkCore.SqlServer\Elsa.EntityFrameworkCore.SqlServer.csproj" />
<ProjectReference Include="..\..\modules\Elsa.MassTransit.RabbitMq\Elsa.MassTransit.RabbitMq.csproj" />
<ProjectReference Include="..\..\modules\Elsa.Python\Elsa.Python.csproj" />
<ProjectReference Include="..\..\modules\Elsa.Quartz.EntityFrameworkCore.Sqlite\Elsa.Quartz.EntityFrameworkCore.Sqlite.csproj" />
<ProjectReference Include="..\..\modules\Elsa.FileStorage\Elsa.FileStorage.csproj" />
<ProjectReference Include="..\..\modules\Elsa.Dapper.Migrations\Elsa.Dapper.Migrations.csproj" />
<ProjectReference Include="..\..\modules\Elsa.Dapper\Elsa.Dapper.csproj" />
<ProjectReference Include="..\..\modules\Elsa.Elasticsearch\Elsa.Elasticsearch.csproj" />
<ProjectReference Include="..\..\modules\Elsa.Email\Elsa.Email.csproj" />
<ProjectReference Include="..\..\modules\Elsa.EntityFrameworkCore\Elsa.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\Elsa.Environments\Elsa.Environments.csproj" />
<ProjectReference Include="..\..\modules\Elsa.MassTransit\Elsa.MassTransit.csproj" />
<ProjectReference Include="..\..\modules\Elsa.MongoDb\Elsa.MongoDb.csproj" />
<ProjectReference Include="..\..\modules\Elsa.Workflows.Runtime.ProtoActor\Elsa.Workflows.Runtime.ProtoActor.csproj" />
<ProjectReference Include="..\..\modules\Elsa.Identity\Elsa.Identity.csproj"/>
<ProjectReference Include="..\..\modules\Elsa.WorkflowProviders.BlobStorage\Elsa.WorkflowProviders.BlobStorage.csproj"/>
<ProjectReference Include="..\..\modules\Elsa.Hangfire\Elsa.Hangfire.csproj"/>
<ProjectReference Include="..\..\modules\Elsa.Http\Elsa.Http.csproj"/>
<ProjectReference Include="..\..\modules\Elsa.Labels\Elsa.Labels.csproj"/>
<ProjectReference Include="..\..\modules\Elsa.Liquid\Elsa.Liquid.csproj"/>
<ProjectReference Include="..\..\modules\Elsa.Quartz\Elsa.Quartz.csproj"/>
<ProjectReference Include="..\..\modules\Elsa.WorkflowContexts\Elsa.WorkflowContexts.csproj"/>
<ProjectReference Include="..\..\modules\Elsa.Workflows.Api\Elsa.Workflows.Api.csproj"/>
<ProjectReference Include="..\..\modules\Elsa.Identity\Elsa.Identity.csproj" />
<ProjectReference Include="..\..\modules\Elsa.WorkflowProviders.BlobStorage\Elsa.WorkflowProviders.BlobStorage.csproj" />
<ProjectReference Include="..\..\modules\Elsa.Hangfire\Elsa.Hangfire.csproj" />
<ProjectReference Include="..\..\modules\Elsa.Http\Elsa.Http.csproj" />
<ProjectReference Include="..\..\modules\Elsa.Labels\Elsa.Labels.csproj" />
<ProjectReference Include="..\..\modules\Elsa.Liquid\Elsa.Liquid.csproj" />
<ProjectReference Include="..\..\modules\Elsa.Quartz\Elsa.Quartz.csproj" />
<ProjectReference Include="..\..\modules\Elsa.WorkflowContexts\Elsa.WorkflowContexts.csproj" />
<ProjectReference Include="..\..\modules\Elsa.Workflows.Api\Elsa.Workflows.Api.csproj" />
<ProjectReference Include="..\..\scripting\Elsa.Command\Elsa.CommandExecuter.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Azure.Identity"/>
<PackageReference Include="Bogus"/>
<PackageReference Include="DistributedLock.Postgres"/>
<PackageReference Include="DistributedLock.Redis"/>
<PackageReference Include="FluentStorage.Azure.Blobs"/>
<PackageReference Include="Azure.Identity" />
<PackageReference Include="Bogus" />
<PackageReference Include="DistributedLock.Postgres" />
<PackageReference Include="DistributedLock.Redis" />
<PackageReference Include="FluentStorage.Azure.Blobs" />
<PackageReference Include="Hangfire.PostgreSql" />
<PackageReference Include="Proto.Cluster.Kubernetes" />
<PackageReference Include="Grpc.Net.Client" />
<PackageReference Include="Proto.Persistence.Sqlite"/>
<PackageReference Include="Proto.Persistence.SqlServer"/>
<PackageReference Include="Proto.Persistence.Sqlite" />
<PackageReference Include="Proto.Persistence.SqlServer" />
</ItemGroup>

</Project>
10 changes: 7 additions & 3 deletions src/apps/Elsa.Server.Web/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Elsa.Alterations.Extensions;
using Elsa.Alterations.MassTransit.Extensions;
using Elsa.Caching.Options;
using Elsa.CommandExecuter.Contracts;
using Elsa.Common.DistributedHosting.DistributedLocks;
using Elsa.Common.RecurringTasks;
using Elsa.Common.Serialization;
Expand All @@ -21,6 +22,8 @@
using Elsa.Kafka;
using Elsa.Kafka.Factories;
using Elsa.MassTransit.Extensions;
using Elsa.Mediator.Contracts;
using Elsa.Mediator.Models;
using Elsa.MongoDb.Extensions;
using Elsa.MongoDb.Modules.Alterations;
using Elsa.MongoDb.Modules.Identity;
Expand Down Expand Up @@ -166,7 +169,7 @@
{
jobStorage = new MemoryStorage();
}

elsa.UseHangfire(hangfire => hangfire.UseJobStorage(jobStorage));
}

Expand Down Expand Up @@ -351,6 +354,7 @@
options.AppendScript("string Greet(string name) => $\"Hello {name}!\";");
options.AppendScript("string SayHelloWorld() => Greet(\"World\");");
})
.UseCommandExecuter()
.UseJavaScript(options =>
{
options.AllowClrAccess = true;
Expand All @@ -369,7 +373,7 @@
// Make sure to configure the path to the python DLL. E.g. /opt/homebrew/Cellar/[email protected]/3.11.6_1/Frameworks/Python.framework/Versions/3.11/bin/python3.11
// alternatively, you can set the PYTHONNET_PYDLL environment variable.
configuration.GetSection("Scripting:Python").Bind(options);

options.AddScript(sb =>
{
sb.AppendLine("def greet():");
Expand Down Expand Up @@ -558,7 +562,7 @@
.UseSecretsScripting()
;
}

elsa.UseRetention(r =>
{
r.SweepInterval = TimeSpan.FromHours(5);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
using System.Text.Json;
using Elsa.CommandExecuter.Providers;
using Elsa.CommandExecuter.Utils;
using Elsa.Mediator.Contracts;
using Elsa.Workflows;
using Elsa.Workflows.Attributes;
using Elsa.Workflows.Models;
using Elsa.Workflows.UIHints;
using Elsa.Extensions;
using Elsa.CommandExecuter.Contracts;
namespace Elsa.Command.Activities.RunCommandExecuter;

[Activity("Elsa", "Scripting", "Runs a command predefined from the code base", DisplayName = "Run C# Command")]
public class RunCommandExecuter : Activity
{
private IMediator _mediator;

[Input(UIHandler = typeof(WorkflowCommandProvider), UIHint = InputUIHints.DropDown, Description = "Command to be executed")]
public Input<string> Command
{
get;
set;
}

[Input(UIHint = InputUIHints.MultiLine, Description = "Requested Body")]
public Input<string> Payload
{
get;
set;
}

protected override async ValueTask ExecuteAsync(ActivityExecutionContext context)
{
var constructorsPotentialValues = new Dictionary<string, object?>();
constructorsPotentialValues.Add(nameof(ElsaWorkFlowCommand.WorkflowIntanceId), context.WorkflowExecutionContext.Id);
constructorsPotentialValues.Add(nameof(ElsaWorkFlowCommand.WorkflowCorrelationId), context.WorkflowExecutionContext.CorrelationId);

if (Payload != null)
{
var payloadItems = JsonSerializer.Deserialize<Dictionary<string, object>>(Payload.Get(context));
TypeUtils.AddRangeOrOverwrite(constructorsPotentialValues, payloadItems);
}

var commandType = TypeUtils.GetType(Command.Get(context));
var commandProperties = commandType.GetProperties();
var commandInstance = Activator.CreateInstance(commandType);

foreach (var prop in commandProperties)
{
var variable = constructorsPotentialValues.FirstOrDefault(x => x.Key.Equals(prop.Name, StringComparison.OrdinalIgnoreCase));

if (variable.Key == null)
continue;

object paramValue = null;

if (variable.Value is JsonElement jsonElement)
{
paramValue = HandleJsonElementValue(jsonElement, prop.PropertyType);
}
else
{
paramValue = TypeUtils.ChangeType(variable.Value, prop.PropertyType);
}

prop.SetValue(commandInstance, paramValue, null);
}

_mediator = context.GetRequiredService<IMediator>();
await _mediator.SendAsync((ICommand)commandInstance);
await context.CompleteActivityAsync();
}


// in case of having a complex object
private static object HandleJsonElementValue(JsonElement jsonElement, Type propertyType)
{
if (propertyType == typeof(DateOnly))
{
return TypeUtils.ChangeType(DateOnly.Parse(jsonElement.ToString()), propertyType);
}

if (propertyType == typeof(TimeOnly))
{
return TypeUtils.ChangeType(TimeOnly.ParseExact(jsonElement.ToString(), "HH:mm"), propertyType);
}

if (jsonElement.ValueKind.ToString().Equals("Undefined", StringComparison.OrdinalIgnoreCase))
{
return propertyType.IsValueType ? Activator.CreateInstance(propertyType) : null;
}

return TypeUtils.ChangeType(
Newtonsoft.Json.JsonConvert.DeserializeObject(jsonElement.GetRawText(), propertyType),
propertyType
);
}
}
13 changes: 13 additions & 0 deletions src/scripting/Elsa.Command/Contracts/ElsaWorkFlowCommand.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Elsa.Mediator.Contracts;

namespace Elsa.CommandExecuter.Contracts;
public class ElsaWorkFlowCommand : ICommand
{
public string WorkflowIntanceId { get; internal set; }
public string WorkflowCorrelationId { get; internal set; }
}
17 changes: 17 additions & 0 deletions src/scripting/Elsa.Command/Elsa.CommandExecuter.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Description>
Provides a Command execution provider.
</Description>
<PackageTags>elsa module executes custom made command provider.</PackageTags>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\modules\Elsa.Expressions\Elsa.Expressions.csproj" />
<ProjectReference Include="..\..\modules\Elsa.Workflows.Management\Elsa.Workflows.Management.csproj" />
<ProjectReference Include="..\..\modules\Elsa.Workflows.Core\Elsa.Workflows.Core.csproj" />
</ItemGroup>


</Project>
20 changes: 20 additions & 0 deletions src/scripting/Elsa.Command/Extensions/ModuleExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using Elsa.Command.Features;
using Elsa.Features.Services;

// ReSharper disable once CheckNamespace
namespace Elsa.Extensions;

/// <summary>
/// Adds extensions to <see cref="IModule"/> that installs the <see cref="CommandExecuterFeature"/> feature.
/// </summary>
public static class ModuleExtensions
{
/// <summary>
/// Setup the <see cref="CommandExecuterFeature"/> feature.
/// </summary>
public static IModule UseCommandExecuter(this IModule module, Action<CommandExecuterFeature>? configure = default)
{
module.Configure(configure);
return module;
}
}
33 changes: 33 additions & 0 deletions src/scripting/Elsa.Command/Features/CommandExecuterFeature.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Elsa.CommandExecuter.Providers;
using Elsa.Common.Features;
using Elsa.Extensions;
using Elsa.Features.Abstractions;
using Elsa.Features.Attributes;
using Elsa.Features.Services;
using Elsa.Workflows;
using Microsoft.Extensions.DependencyInjection;

namespace Elsa.Command.Features;
[DependsOn(typeof(MediatorFeature))]
public class CommandExecuterFeature : FeatureBase
{
/// <inheritdoc />
public CommandExecuterFeature(IModule module) : base(module)
{

}

/// <inheritdoc />
public override void Apply()
{

Services.AddNotificationHandlersFrom<CommandExecuterFeature>();
Module.AddActivitiesFrom<CommandExecuterFeature>();
Services.AddScoped<IPropertyUIHandler, WorkflowCommandProvider>();
}
}
Loading
Loading