Cleanup
This commit is contained in:
parent
41b1a3b275
commit
76b9ae96fb
7
Elsa.sln
7
Elsa.sln
|
|
@ -106,6 +106,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Workflows.Runtime", "s
|
|||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.ServiceConfiguration", "src\common\Elsa.ServiceConfiguration\Elsa.ServiceConfiguration.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
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
|
@ -276,6 +278,10 @@ Global
|
|||
{C237BA1A-3A7D-4AB2-BE09-2696F3C082A4}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C237BA1A-3A7D-4AB2-BE09-2696F3C082A4}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C237BA1A-3A7D-4AB2-BE09-2696F3C082A4}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{2570418D-1674-4DAE-9A24-9146D522450C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{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
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{155227F0-A33B-40AA-A4B4-06F813EB921B} = {61017E64-6D00-49CB-9E81-5002DC8F7D5F}
|
||||
|
|
@ -325,5 +331,6 @@ Global
|
|||
{7B9E8C76-814B-4912-A66E-7E0855B46389} = {5BA4A8FA-F7F4-45B3-AEC8-8886D35AAC79}
|
||||
{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}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
using Elsa.Workflows.Api.Extensions;
|
||||
using Elsa.AspNetCore;
|
||||
using Elsa.AspNetCore.Conventions;
|
||||
using Elsa.AspNetCore.Extensions;
|
||||
using Elsa.Extensions;
|
||||
using Elsa.Jobs.Extensions;
|
||||
using Elsa.Hangfire.Implementations;
|
||||
|
|
@ -24,42 +26,36 @@ var services = builder.Services;
|
|||
|
||||
// Add Elsa services.
|
||||
services
|
||||
.ConfigureElsa()
|
||||
.UseWorkflows()
|
||||
.UseRuntime()
|
||||
.UseManagement(management => management
|
||||
.AddActivity<Sequence>()
|
||||
.AddActivity<WriteLine>()
|
||||
.AddActivity<ReadLine>()
|
||||
.AddActivity<If>()
|
||||
.AddActivity<HttpEndpoint>()
|
||||
.AddActivity<Flowchart>()
|
||||
.AddActivity<Delay>()
|
||||
.AddActivity<Elsa.Scheduling.Activities.Timer>()
|
||||
.AddActivity<ForEach>()
|
||||
.AddActivity<Switch>()
|
||||
.AddActivity<RunJavaScript>()
|
||||
)
|
||||
.UseHttp()
|
||||
.Apply();
|
||||
.AddElsa(elsa => elsa
|
||||
.UseWorkflows()
|
||||
.UseRuntime()
|
||||
.UseManagement(management => management
|
||||
.AddActivity<Sequence>()
|
||||
.AddActivity<WriteLine>()
|
||||
.AddActivity<ReadLine>()
|
||||
.AddActivity<If>()
|
||||
.AddActivity<HttpEndpoint>()
|
||||
.AddActivity<Flowchart>()
|
||||
.AddActivity<Delay>()
|
||||
.AddActivity<Elsa.Scheduling.Activities.Timer>()
|
||||
.AddActivity<ForEach>()
|
||||
.AddActivity<Switch>()
|
||||
.AddActivity<RunJavaScript>()
|
||||
)
|
||||
.UseJavaScript()
|
||||
.UseLiquid()
|
||||
.UseHttp()
|
||||
.UseMvc()
|
||||
);
|
||||
|
||||
services
|
||||
//.AddProtoActorRuntime()
|
||||
.AddJobServices(new QuartzJobSchedulerProvider(), new HangfireJobQueueProvider())
|
||||
.AddSchedulingServices();
|
||||
|
||||
// Register scripting languages.
|
||||
services
|
||||
.AddJavaScriptExpressions()
|
||||
.AddLiquidExpressions();
|
||||
|
||||
// Register serialization configurator for configuring what types to allow to be serialized.
|
||||
services.AddSingleton<ISerializationOptionsConfigurator, CustomSerializationOptionConfigurator>();
|
||||
services.AddSingleton<ISerializationOptionsConfigurator, SerializationOptionsConfigurator>();
|
||||
|
||||
// Controllers.
|
||||
services.AddControllers(mvc => mvc.Conventions.Add(new ApiEndpointAttributeConvention()));
|
||||
|
||||
// Razor Pages.
|
||||
services.AddRazorPages();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
using Elsa.AspNetCore;
|
||||
using Elsa.AspNetCore.Conventions;
|
||||
using Elsa.AspNetCore.Extensions;
|
||||
using Elsa.Extensions;
|
||||
using Elsa.Hangfire.Implementations;
|
||||
using Elsa.Http;
|
||||
|
|
@ -45,8 +47,11 @@ services
|
|||
.AddActivity<RunJavaScript>()
|
||||
)
|
||||
.UsePersistence(p => p.UseEntityFrameworkCore(ef => ef.UseSqlite()))
|
||||
.UseJavaScript()
|
||||
.UseLiquid()
|
||||
.UseLabels(labels => labels.UseEntityFrameworkCore(ef => ef.UseSqlite()))
|
||||
.UseHttp()
|
||||
.UseMvc()
|
||||
);
|
||||
|
||||
services
|
||||
|
|
@ -54,25 +59,11 @@ services
|
|||
.AddSchedulingServices()
|
||||
;
|
||||
|
||||
// Add controller services. The below technique allows full control over what controllers get added from which assemblies.
|
||||
// It is even possible to add individual controllers this way using a custom TypesPart.
|
||||
services
|
||||
// Elsa API endpoints require MVC controllers.
|
||||
.AddControllers(mvc => mvc.Conventions.Add(new ApiEndpointAttributeConvention())) // This convention is required as well.
|
||||
.ClearApplicationParts() // Remove all controllers from referenced packages.
|
||||
.AddApplicationPartsFrom<Program>() // Add back any controllers from the current application.
|
||||
.AddWorkflowManagementApiControllers() // Add workflow management API endpoint controllers.
|
||||
.AddLabelsApiControllers() // Add label API controllers.
|
||||
;
|
||||
|
||||
//services.AddControllers();
|
||||
services.AddHealthChecks();
|
||||
services.AddCors(cors => cors.AddDefaultPolicy(policy => policy.AllowAnyHeader().AllowAnyMethod().AllowAnyOrigin()));
|
||||
|
||||
// Register scripting languages.
|
||||
services
|
||||
.AddJavaScriptExpressions()
|
||||
.AddLiquidExpressions();
|
||||
|
||||
// Register serialization configurator for configuring what types to allow to be serialized.
|
||||
services.AddSingleton<ISerializationOptionsConfigurator, CustomSerializationOptionConfigurator>();
|
||||
services.AddSingleton<ISerializationOptionsConfigurator, SerializationOptionsConfigurator>();
|
||||
|
|
|
|||
|
|
@ -16,18 +16,8 @@ public static class DependencyInjectionExtensions
|
|||
return services;
|
||||
}
|
||||
|
||||
|
||||
public static IServiceConfiguration ConfigureElsa(this IServiceCollection services)
|
||||
{
|
||||
// services.AddMediator();
|
||||
//
|
||||
// var serviceConfiguration = services
|
||||
// .ConfigureServices()
|
||||
// .UseWorkflows()
|
||||
// .UsePersistence()
|
||||
// .UseRuntime()
|
||||
// .UseManagement();
|
||||
|
||||
var serviceConfiguration = services.ConfigureServices();
|
||||
serviceConfiguration.Configure<ElsaConfigurator>();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
namespace Elsa.AspNetCore;
|
||||
namespace Elsa.AspNetCore.Attributes;
|
||||
|
||||
/// <summary>
|
||||
/// Apply this to a controller that models an API endpoint, where the controller contains a single action.
|
||||
18
src/common/Elsa.AspNetCore/Configuration/MvcConfigurator.cs
Normal file
18
src/common/Elsa.AspNetCore/Configuration/MvcConfigurator.cs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
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()));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
using Elsa.AspNetCore.Attributes;
|
||||
using Microsoft.AspNetCore.Mvc.ApplicationModels;
|
||||
|
||||
namespace Elsa.AspNetCore;
|
||||
namespace Elsa.AspNetCore.Conventions;
|
||||
|
||||
/// <summary>
|
||||
/// A custom controller model convention that applies a controller & action name based on the values provided via <see cref="ApiEndpointAttribute"/>.
|
||||
|
|
@ -7,7 +7,13 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.2.5" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Abstractions" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor" Version="2.2.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Elsa.ServiceConfiguration\Elsa.ServiceConfiguration.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
using Elsa.AspNetCore.Configuration;
|
||||
using Elsa.ServiceConfiguration.Services;
|
||||
|
||||
namespace Elsa.AspNetCore.Extensions;
|
||||
|
||||
public static class DependencyInjectionExtensions
|
||||
{
|
||||
public static IServiceConfiguration UseMvc(this IServiceConfiguration configuration, Action<MvcConfigurator>? configure = default)
|
||||
{
|
||||
configuration.Configure(configure);
|
||||
return configuration;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,8 @@
|
|||
using Elsa.AspNetCore.Parts;
|
||||
using Microsoft.AspNetCore.Mvc.ApplicationParts;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace Elsa.AspNetCore;
|
||||
namespace Elsa.AspNetCore.Extensions;
|
||||
|
||||
public static class MvcBuilderExtensions
|
||||
{
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
namespace Elsa.AspNetCore;
|
||||
namespace Elsa.AspNetCore.Models;
|
||||
|
||||
public record ListModel<T>(ICollection<T> Items);
|
||||
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
using System.Reflection;
|
||||
using Microsoft.AspNetCore.Mvc.ApplicationParts;
|
||||
|
||||
namespace Elsa.AspNetCore;
|
||||
namespace Elsa.AspNetCore.Parts;
|
||||
|
||||
/// <summary>
|
||||
/// A custom <see cref="ApplicationPart"/> that controls what types will be provided to the system.
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
using Elsa.Expressions.Implementations;
|
||||
using Elsa.Expressions.Services;
|
||||
using Elsa.ServiceConfiguration.Abstractions;
|
||||
using Elsa.ServiceConfiguration.Services;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace Elsa.Expressions.Configuration;
|
||||
|
||||
public class ExpressionsConfigurator : ConfiguratorBase
|
||||
{
|
||||
public ExpressionsConfigurator(IServiceConfiguration serviceConfiguration) : base(serviceConfiguration)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Configure()
|
||||
{
|
||||
Services
|
||||
.AddSingleton<IExpressionEvaluator, ExpressionEvaluator>()
|
||||
.AddSingleton<IExpressionHandlerRegistry, ExpressionHandlerRegistry>();
|
||||
}
|
||||
}
|
||||
|
|
@ -12,4 +12,8 @@
|
|||
<PackageReference Include="Microsoft.Extensions.Options" Version="6.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Elsa.ServiceConfiguration\Elsa.ServiceConfiguration.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using Elsa.Expressions.Implementations;
|
||||
using Elsa.Expressions.Configuration;
|
||||
using Elsa.Expressions.Options;
|
||||
using Elsa.Expressions.Services;
|
||||
using Elsa.ServiceConfiguration.Services;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||
|
||||
|
|
@ -8,11 +9,10 @@ namespace Elsa.Expressions.Extensions;
|
|||
|
||||
public static class DependencyInjectionExtensions
|
||||
{
|
||||
public static IServiceCollection AddExpressions(this IServiceCollection services)
|
||||
public static IServiceConfiguration UseExpressions(this IServiceConfiguration configuration, Action<ExpressionsConfigurator>? configure = default)
|
||||
{
|
||||
return services
|
||||
.AddSingleton<IExpressionEvaluator, ExpressionEvaluator>()
|
||||
.AddSingleton<IExpressionHandlerRegistry, ExpressionHandlerRegistry>();
|
||||
configuration.Configure(configure);
|
||||
return configuration;
|
||||
}
|
||||
|
||||
public static IServiceCollection AddExpressionHandler<THandler, TExpression>(this IServiceCollection services) where THandler : class, IExpressionHandler =>
|
||||
|
|
|
|||
27
src/modules/Elsa.Dsl/Configuration/DslConfigurator.cs
Normal file
27
src/modules/Elsa.Dsl/Configuration/DslConfigurator.cs
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
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<IDslEngine, DslEngine>()
|
||||
.AddSingleton<ITypeSystem, TypeSystem>()
|
||||
.AddSingleton<IFunctionActivityRegistry, FunctionActivityRegistry>();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,16 +1,14 @@
|
|||
using Elsa.Dsl.Implementations;
|
||||
using Elsa.Dsl.Services;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using System;
|
||||
using Elsa.Dsl.Configuration;
|
||||
using Elsa.ServiceConfiguration.Services;
|
||||
|
||||
namespace Elsa.Dsl.Extensions;
|
||||
|
||||
public static class DependencyInjectionExtensions
|
||||
{
|
||||
public static IServiceCollection AddDsl(this IServiceCollection services)
|
||||
public static IServiceConfiguration UseDsl(this IServiceConfiguration configuration, Action<DslConfigurator>? configure = default)
|
||||
{
|
||||
return services
|
||||
.AddSingleton<IDslEngine, DslEngine>()
|
||||
.AddSingleton<ITypeSystem, TypeSystem>()
|
||||
.AddSingleton<IFunctionActivityRegistry, FunctionActivityRegistry>();
|
||||
configuration.Configure(configure);
|
||||
return configuration;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
using Elsa.Expressions.Configuration;
|
||||
using Elsa.Expressions.Extensions;
|
||||
using Elsa.Expressions.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 Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace Elsa.JavaScript.Configuration;
|
||||
|
||||
[Dependency(typeof(MediatorConfigurator))]
|
||||
[Dependency(typeof(ExpressionsConfigurator))]
|
||||
public class JavaScriptConfigurator : ConfiguratorBase
|
||||
{
|
||||
public JavaScriptConfigurator(IServiceConfiguration serviceConfiguration) : base(serviceConfiguration)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Configure()
|
||||
{
|
||||
Services
|
||||
.AddSingleton<IExpressionSyntaxProvider, JavaScriptExpressionSyntaxProvider>()
|
||||
.AddSingleton<IJavaScriptEvaluator, JintJavaScriptEvaluator>()
|
||||
.AddNotificationHandlersFrom<ConfigureJavaScriptEngineWithActivityOutput>()
|
||||
.AddExpressionHandler<JavaScriptExpressionHandler, JavaScriptExpression>();
|
||||
}
|
||||
}
|
||||
|
|
@ -16,8 +16,4 @@
|
|||
<PackageReference Include="Jint" Version="3.0.0-beta-2083" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Configuration" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -1,23 +1,13 @@
|
|||
using Elsa.Expressions.Extensions;
|
||||
using Elsa.Expressions.Services;
|
||||
using Elsa.JavaScript.Expressions;
|
||||
using Elsa.JavaScript.Handlers;
|
||||
using Elsa.JavaScript.Implementations;
|
||||
using Elsa.JavaScript.Providers;
|
||||
using Elsa.JavaScript.Services;
|
||||
using Elsa.Mediator.Extensions;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Elsa.JavaScript.Configuration;
|
||||
using Elsa.ServiceConfiguration.Services;
|
||||
|
||||
namespace Elsa.JavaScript.Extensions;
|
||||
|
||||
public static class DependencyInjectionExtensions
|
||||
{
|
||||
public static IServiceCollection AddJavaScriptExpressions(this IServiceCollection services)
|
||||
public static IServiceConfiguration UseJavaScript(this IServiceConfiguration serviceConfiguration, Action<JavaScriptConfigurator>? configure = default)
|
||||
{
|
||||
return services
|
||||
.AddSingleton<IExpressionSyntaxProvider, JavaScriptExpressionSyntaxProvider>()
|
||||
.AddSingleton<IJavaScriptEvaluator, JintJavaScriptEvaluator>()
|
||||
.AddNotificationHandlersFrom<ConfigureJavaScriptEngineWithActivityOutput>()
|
||||
.AddExpressionHandler<JavaScriptExpressionHandler, JavaScriptExpression>();
|
||||
serviceConfiguration.Configure(configure);
|
||||
return serviceConfiguration;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,12 +1,15 @@
|
|||
using Elsa.Labels.Configuration;
|
||||
using Elsa.Labels.Entities;
|
||||
using Elsa.Labels.EntityFrameworkCore.Implementations;
|
||||
using Elsa.Labels.Extensions;
|
||||
using Elsa.Persistence.EntityFrameworkCore.Common.Abstractions;
|
||||
using Elsa.ServiceConfiguration.Attributes;
|
||||
using Elsa.ServiceConfiguration.Services;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace Elsa.Labels.EntityFrameworkCore.Configuration;
|
||||
|
||||
[Dependency(typeof(LabelsConfigurator))]
|
||||
public class EFCoreLabelPersistenceConfigurator : EFCorePersistenceConfigurator<LabelsDbContext>
|
||||
{
|
||||
public EFCoreLabelPersistenceConfigurator(IServiceConfiguration serviceConfiguration) : base(serviceConfiguration)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using Elsa.AspNetCore;
|
||||
using Elsa.AspNetCore.Attributes;
|
||||
using Elsa.Labels.Entities;
|
||||
using Elsa.Labels.Services;
|
||||
using Elsa.Workflows.Core.Serialization;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using Elsa.AspNetCore;
|
||||
using Elsa.AspNetCore.Attributes;
|
||||
using Elsa.Labels.Entities;
|
||||
using Elsa.Labels.Services;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using Elsa.AspNetCore;
|
||||
using Elsa.AspNetCore.Attributes;
|
||||
using Elsa.Labels.Entities;
|
||||
using Elsa.Labels.Services;
|
||||
using Elsa.Workflows.Core.Serialization;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using Elsa.AspNetCore;
|
||||
using Elsa.AspNetCore.Attributes;
|
||||
using Elsa.Labels.Entities;
|
||||
using Elsa.Labels.Services;
|
||||
using Elsa.Persistence.Common.Models;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using Elsa.AspNetCore;
|
||||
using Elsa.AspNetCore.Attributes;
|
||||
using Elsa.Labels.Entities;
|
||||
using Elsa.Labels.Services;
|
||||
using Elsa.Workflows.Core.Serialization;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
using Elsa.AspNetCore;
|
||||
using Elsa.AspNetCore.Attributes;
|
||||
using Elsa.AspNetCore.Models;
|
||||
using Elsa.Labels.Services;
|
||||
using Elsa.Workflows.Core.Serialization;
|
||||
using Elsa.Workflows.Persistence.Services;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
using Elsa.AspNetCore;
|
||||
using Elsa.AspNetCore.Attributes;
|
||||
using Elsa.AspNetCore.Models;
|
||||
using Elsa.Labels.Entities;
|
||||
using Elsa.Labels.Services;
|
||||
using Elsa.Workflows.Core.Helpers;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,41 @@
|
|||
using Elsa.Expressions.Configuration;
|
||||
using Elsa.Expressions.Extensions;
|
||||
using Elsa.Expressions.Services;
|
||||
using Elsa.Liquid.Expressions;
|
||||
using Elsa.Liquid.Extensions;
|
||||
using Elsa.Liquid.Filters;
|
||||
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 Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace Elsa.Liquid.Configuration;
|
||||
|
||||
[Dependency(typeof(MemoryCacheConfigurator))]
|
||||
[Dependency(typeof(MediatorConfigurator))]
|
||||
[Dependency(typeof(ExpressionsConfigurator))]
|
||||
public class LiquidConfigurator : ConfiguratorBase
|
||||
{
|
||||
public LiquidConfigurator(IServiceConfiguration serviceConfiguration) : base(serviceConfiguration)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Configure()
|
||||
{
|
||||
Services
|
||||
.AddHandlersFrom<ConfigureLiquidEngine>()
|
||||
.AddSingleton<IExpressionSyntaxProvider, LiquidExpressionSyntaxProvider>()
|
||||
.AddSingleton<ILiquidTemplateManager, LiquidTemplateManager>()
|
||||
.AddSingleton<LiquidParser>()
|
||||
.AddExpressionHandler<LiquidExpressionHandler, LiquidExpression>()
|
||||
.AddLiquidFilter<JsonFilter>("json")
|
||||
.AddLiquidFilter<Base64Filter>("base64");
|
||||
}
|
||||
}
|
||||
|
|
@ -15,6 +15,7 @@
|
|||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\common\Elsa.Expressions\Elsa.Expressions.csproj" />
|
||||
<ProjectReference Include="..\..\common\Elsa.Mediator\Elsa.Mediator.csproj" />
|
||||
<ProjectReference Include="..\Elsa.MemoryCache\Elsa.MemoryCache.csproj" />
|
||||
<ProjectReference Include="..\Elsa.Workflows.Core\Elsa.Workflows.Core.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,39 +1,27 @@
|
|||
using Elsa.Expressions.Extensions;
|
||||
using Elsa.Expressions.Services;
|
||||
using Elsa.Liquid.Expressions;
|
||||
using Elsa.Liquid.Filters;
|
||||
using Elsa.Liquid.Handlers;
|
||||
using Elsa.Liquid.Configuration;
|
||||
using Elsa.Liquid.Implementations;
|
||||
using Elsa.Liquid.Options;
|
||||
using Elsa.Liquid.Providers;
|
||||
using Elsa.Liquid.Services;
|
||||
using Elsa.Mediator.Extensions;
|
||||
using Elsa.ServiceConfiguration.Services;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace Elsa.Liquid.Extensions;
|
||||
|
||||
public static class DependencyInjectionExtensions
|
||||
{
|
||||
public static IServiceCollection AddLiquidExpressions(this IServiceCollection services)
|
||||
public static IServiceConfiguration UseLiquid(this IServiceConfiguration configuration, Action<LiquidConfigurator>? configure = default)
|
||||
{
|
||||
return services
|
||||
.AddMemoryCache()
|
||||
.AddHandlersFrom<ConfigureLiquidEngine>()
|
||||
.AddSingleton<IExpressionSyntaxProvider, LiquidExpressionSyntaxProvider>()
|
||||
.AddSingleton<ILiquidTemplateManager, LiquidTemplateManager>()
|
||||
.AddSingleton<LiquidParser>()
|
||||
.AddExpressionHandler<LiquidExpressionHandler, LiquidExpression>()
|
||||
.AddLiquidFilter<JsonFilter>("json")
|
||||
.AddLiquidFilter<Base64Filter>("base64");
|
||||
configuration.Configure(configure);
|
||||
return configuration;
|
||||
}
|
||||
|
||||
|
||||
public static IServiceCollection AddLiquidFilter<T>(this IServiceCollection services, string name) where T : class, ILiquidFilter
|
||||
{
|
||||
services.Configure<FluidOptions>(options => options.FilterRegistrations[name] = typeof(T));
|
||||
services.AddScoped<T>();
|
||||
return services;
|
||||
}
|
||||
|
||||
|
||||
public static IServiceCollection RegisterLiquidTag(this IServiceCollection services, Action<LiquidParser> configure)
|
||||
{
|
||||
services.Configure<FluidOptions>(options => options.ParserConfiguration.Add(configure));
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
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();
|
||||
}
|
||||
}
|
||||
17
src/modules/Elsa.MemoryCache/Elsa.MemoryCache.csproj
Normal file
17
src/modules/Elsa.MemoryCache/Elsa.MemoryCache.csproj
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="6.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\common\Elsa.ServiceConfiguration\Elsa.ServiceConfiguration.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
@ -3,6 +3,8 @@ using System.Linq;
|
|||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using Elsa.AspNetCore;
|
||||
using Elsa.AspNetCore.Attributes;
|
||||
using Elsa.AspNetCore.Models;
|
||||
using Elsa.Workflows.Core.Serialization.Converters;
|
||||
using Elsa.Workflows.Core.Services;
|
||||
using Elsa.Workflows.Management.Models;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using Elsa.AspNetCore;
|
||||
using Elsa.AspNetCore.Attributes;
|
||||
using Elsa.Workflows.Api.ApiResults;
|
||||
using Elsa.Workflows.Api.Models;
|
||||
using Elsa.Workflows.Core.Activities;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ using System.Text.Json.Serialization;
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Elsa.AspNetCore;
|
||||
using Elsa.AspNetCore.Attributes;
|
||||
using Elsa.Workflows.Core.Serialization;
|
||||
using Elsa.Workflows.Persistence.Services;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ using System.Collections.Generic;
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Elsa.AspNetCore;
|
||||
using Elsa.AspNetCore.Attributes;
|
||||
using Elsa.Workflows.Core.Serialization;
|
||||
using Elsa.Workflows.Management.Services;
|
||||
using Elsa.Workflows.Persistence.Models;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ using System.Collections.Generic;
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Elsa.AspNetCore;
|
||||
using Elsa.AspNetCore.Attributes;
|
||||
using Elsa.Workflows.Core.Serialization;
|
||||
using Elsa.Workflows.Management.Services;
|
||||
using Elsa.Workflows.Persistence.Models;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Elsa.AspNetCore;
|
||||
using Elsa.AspNetCore.Attributes;
|
||||
using Elsa.Workflows.Persistence.Services;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Elsa.AspNetCore;
|
||||
using Elsa.AspNetCore.Attributes;
|
||||
using Elsa.Workflows.Api.ApiResults;
|
||||
using Elsa.Workflows.Persistence.Models;
|
||||
using Elsa.Workflows.Persistence.Services;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Elsa.AspNetCore;
|
||||
using Elsa.AspNetCore.Attributes;
|
||||
using Elsa.Workflows.Api.ApiResults;
|
||||
using Elsa.Workflows.Core.Models;
|
||||
using Elsa.Workflows.Persistence.Models;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ using System.Text.Json;
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Elsa.AspNetCore;
|
||||
using Elsa.AspNetCore.Attributes;
|
||||
using Elsa.Workflows.Api.Models;
|
||||
using Elsa.Workflows.Core.Serialization;
|
||||
using Elsa.Workflows.Persistence.Models;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Elsa.AspNetCore;
|
||||
using Elsa.AspNetCore.Attributes;
|
||||
using Elsa.Workflows.Api.Models;
|
||||
using Elsa.Workflows.Core.Serialization;
|
||||
using Elsa.Workflows.Persistence.Models;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ using System.Text.Json;
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Elsa.AspNetCore;
|
||||
using Elsa.AspNetCore.Attributes;
|
||||
using Elsa.Workflows.Api.Models;
|
||||
using Elsa.Workflows.Core.Serialization;
|
||||
using Elsa.Workflows.Management.Materializers;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ using System.Linq;
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Elsa.AspNetCore;
|
||||
using Elsa.AspNetCore.Attributes;
|
||||
using Elsa.Persistence.Common.Models;
|
||||
using Elsa.Workflows.Core.Serialization;
|
||||
using Elsa.Workflows.Persistence.Models;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ using System.Text.Json;
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Elsa.AspNetCore;
|
||||
using Elsa.AspNetCore.Attributes;
|
||||
using Elsa.Workflows.Core.Activities;
|
||||
using Elsa.Workflows.Core.Models;
|
||||
using Elsa.Workflows.Core.Serialization;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Elsa.AspNetCore;
|
||||
using Elsa.AspNetCore.Attributes;
|
||||
using Elsa.Workflows.Core.Serialization;
|
||||
using Elsa.Workflows.Management.Services;
|
||||
using Elsa.Workflows.Persistence.Entities;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Elsa.AspNetCore;
|
||||
using Elsa.AspNetCore.Attributes;
|
||||
using Elsa.Workflows.Core.Serialization;
|
||||
using Elsa.Workflows.Management.Services;
|
||||
using Elsa.Workflows.Persistence.Entities;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ using System.Text.Json.Serialization;
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Elsa.AspNetCore;
|
||||
using Elsa.AspNetCore.Attributes;
|
||||
using Elsa.Workflows.Core.Serialization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ using System.Text.Json.Serialization;
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Elsa.AspNetCore;
|
||||
using Elsa.AspNetCore.Attributes;
|
||||
using Elsa.Workflows.Core.Serialization;
|
||||
using Elsa.Workflows.Persistence.Services;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Elsa.AspNetCore;
|
||||
using Elsa.AspNetCore.Attributes;
|
||||
using Elsa.Workflows.Persistence.Services;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Elsa.AspNetCore;
|
||||
using Elsa.AspNetCore.Attributes;
|
||||
using Elsa.Workflows.Core.Serialization;
|
||||
using Elsa.Workflows.Persistence.Services;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Elsa.AspNetCore;
|
||||
using Elsa.AspNetCore.Attributes;
|
||||
using Elsa.Persistence.Common.Entities;
|
||||
using Elsa.Persistence.Common.Models;
|
||||
using Elsa.Workflows.Core.Models;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
using System.Collections.Generic;
|
||||
using Elsa.AspNetCore;
|
||||
using Elsa.AspNetCore.Models;
|
||||
using Elsa.Workflows.Runtime.Models;
|
||||
|
||||
namespace Elsa.Workflows.Api.Models;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
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.Workflows.Core.ActivityNodeResolvers;
|
||||
using Elsa.Workflows.Core.Expressions;
|
||||
|
|
@ -13,6 +15,7 @@ using Microsoft.Extensions.DependencyInjection;
|
|||
|
||||
namespace Elsa.Workflows.Core.Configuration;
|
||||
|
||||
[Dependency(typeof(ExpressionsConfigurator))]
|
||||
public class WorkflowsConfigurator : ConfiguratorBase
|
||||
{
|
||||
public WorkflowsConfigurator(IServiceConfiguration serviceConfiguration) : base(serviceConfiguration)
|
||||
|
|
@ -84,7 +87,6 @@ public class WorkflowsConfigurator : ConfiguratorBase
|
|||
private void AddExpressions(IServiceCollection services)
|
||||
{
|
||||
services
|
||||
.AddExpressions()
|
||||
.AddExpressionHandler<LiteralExpressionHandler, LiteralExpression>()
|
||||
.AddExpressionHandler<DelegateExpressionHandler, DelegateExpression>()
|
||||
.AddExpressionHandler<VariableExpressionHandler, VariableExpression>()
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ public class WorkflowManagementConfigurator : ConfiguratorBase
|
|||
.AddSingleton<IWorkflowMaterializer, ClrWorkflowMaterializer>()
|
||||
.AddSingleton<IWorkflowMaterializer, JsonWorkflowMaterializer>()
|
||||
.AddSingleton<WorkflowSerializerOptionsProvider>();
|
||||
|
||||
|
||||
Services.Configure<ApiOptions>(options =>
|
||||
{
|
||||
foreach (var activityType in ActivityTypes)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
using Elsa.AspNetCore;
|
||||
using Elsa.AspNetCore.Conventions;
|
||||
using Elsa.AspNetCore.Extensions;
|
||||
using Elsa.Extensions;
|
||||
using Elsa.Hangfire.Implementations;
|
||||
using Elsa.Http.Extensions;
|
||||
|
|
@ -51,7 +53,10 @@ services
|
|||
runtime.Workflows.Add<StartAtTriggerWorkflow>();
|
||||
runtime.Workflows.Add<StartAtBookmarkWorkflow>();
|
||||
})
|
||||
.UseJavaScript()
|
||||
.UseLiquid()
|
||||
.UseHttp()
|
||||
.UseMvc()
|
||||
);
|
||||
|
||||
services
|
||||
|
|
@ -60,9 +65,10 @@ services
|
|||
|
||||
// Add controller services. The below technique allows full control over what controllers get added from which assemblies.
|
||||
// It is even possible to add individual controllers this way using a custom TypesPart.
|
||||
// If you want to include all controllers
|
||||
services
|
||||
// Elsa API endpoints require MVC controllers.
|
||||
.AddControllers(mvc => mvc.Conventions.Add(new ApiEndpointAttributeConvention())) // This convention is required as well.
|
||||
.AddControllers()
|
||||
.ClearApplicationParts() // Remove all controllers from referenced packages.
|
||||
.AddApplicationPartsFrom<Program>() // Add back any controllers from the current application.
|
||||
.AddWorkflowManagementApiControllers() // Add Elsa API endpoint controllers.
|
||||
|
|
@ -71,15 +77,6 @@ services
|
|||
// Testing only: allow client app to connect from anywhere.
|
||||
services.AddCors(cors => cors.AddDefaultPolicy(policy => policy.AllowAnyHeader().AllowAnyMethod().AllowAnyOrigin()));
|
||||
|
||||
// Register scripting languages.
|
||||
services
|
||||
.AddJavaScriptExpressions()
|
||||
.AddLiquidExpressions();
|
||||
|
||||
// Register serialization configurator for configuring what types to allow to be serialized.
|
||||
services.AddSingleton<ISerializationOptionsConfigurator, CustomSerializationOptionConfigurator>();
|
||||
services.AddSingleton<ISerializationOptionsConfigurator, SerializationOptionsConfigurator>();
|
||||
|
||||
// Configure middleware pipeline.
|
||||
var app = builder.Build();
|
||||
var serviceProvider = app.Services;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
using Elsa.AspNetCore.Extensions;
|
||||
using Elsa.Extensions;
|
||||
using Elsa.Hangfire.Implementations;
|
||||
using Elsa.Http;
|
||||
|
|
@ -43,7 +44,9 @@ services
|
|||
.AddActivity<ForEach>()
|
||||
.AddActivity<Switch>()
|
||||
.AddActivity<RunJavaScript>())
|
||||
.UseHttp());
|
||||
.UseHttp()
|
||||
.UseMvc()
|
||||
);
|
||||
|
||||
services
|
||||
.AddJobServices(new QuartzJobSchedulerProvider(), new HangfireJobQueueProvider())
|
||||
|
|
@ -52,15 +55,6 @@ services
|
|||
// Testing only: allow client app to connect from anywhere.
|
||||
services.AddCors(cors => cors.AddDefaultPolicy(policy => policy.AllowAnyHeader().AllowAnyMethod().AllowAnyOrigin()));
|
||||
|
||||
// Register scripting languages.
|
||||
services
|
||||
.AddJavaScriptExpressions()
|
||||
.AddLiquidExpressions();
|
||||
|
||||
// Register serialization configurator for configuring what types to allow to be serialized.
|
||||
services.AddSingleton<ISerializationOptionsConfigurator, CustomSerializationOptionConfigurator>();
|
||||
services.AddSingleton<ISerializationOptionsConfigurator, SerializationOptionsConfigurator>();
|
||||
|
||||
// Configure middleware pipelines.
|
||||
var app = builder.Build();
|
||||
var serviceProvider = app.Services;
|
||||
|
|
|
|||
|
|
@ -1,20 +1,16 @@
|
|||
using Elsa.AspNetCore.Extensions;
|
||||
using Elsa.Extensions;
|
||||
using Elsa.Hangfire.Implementations;
|
||||
using Elsa.Http;
|
||||
using Elsa.Http.Extensions;
|
||||
using Elsa.JavaScript.Activities;
|
||||
using Elsa.JavaScript.Extensions;
|
||||
using Elsa.Jobs.Extensions;
|
||||
using Elsa.Liquid.Extensions;
|
||||
using Elsa.Quartz.Implementations;
|
||||
using Elsa.Scheduling.Activities;
|
||||
using Elsa.Scheduling.Extensions;
|
||||
using Elsa.Workflows.Api.Extensions;
|
||||
using Elsa.Workflows.Core.Activities;
|
||||
using Elsa.Workflows.Core.Serialization;
|
||||
using Elsa.Workflows.Core.Services;
|
||||
using Elsa.Workflows.Management.Extensions;
|
||||
using Elsa.Workflows.Management.Serialization;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
var services = builder.Services;
|
||||
|
|
@ -34,21 +30,14 @@ services
|
|||
.AddActivity<ForEach>()
|
||||
.AddActivity<Switch>()
|
||||
.AddActivity<RunJavaScript>())
|
||||
.UseHttp());
|
||||
.UseHttp()
|
||||
.UseMvc()
|
||||
);
|
||||
|
||||
services
|
||||
.AddJobServices(new QuartzJobSchedulerProvider(), new HangfireJobQueueProvider())
|
||||
.AddSchedulingServices();
|
||||
|
||||
// Register scripting languages.
|
||||
services
|
||||
.AddJavaScriptExpressions()
|
||||
.AddLiquidExpressions();
|
||||
|
||||
// Register serialization configurator for configuring what types to allow to be serialized.
|
||||
services.AddSingleton<ISerializationOptionsConfigurator, CustomSerializationOptionConfigurator>();
|
||||
services.AddSingleton<ISerializationOptionsConfigurator, SerializationOptionsConfigurator>();
|
||||
|
||||
// Razor Pages.
|
||||
services.AddRazorPages();
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ using Elsa.Dsl.Extensions;
|
|||
using Elsa.Dsl.Services;
|
||||
using Elsa.Extensions;
|
||||
using Elsa.Http;
|
||||
using Elsa.JavaScript.Extensions;
|
||||
using Elsa.Scheduling.Activities;
|
||||
using Elsa.Workflows.Core.Activities;
|
||||
using Elsa.Workflows.Core.Models;
|
||||
|
|
@ -51,12 +50,8 @@ IServiceProvider CreateServices()
|
|||
{
|
||||
var services = new ServiceCollection();
|
||||
|
||||
services.AddElsa();
|
||||
|
||||
services
|
||||
.AddDsl()
|
||||
.AddLogging(logging => logging.AddConsole().SetMinimumLevel(LogLevel.Warning))
|
||||
.AddJavaScriptExpressions();
|
||||
services.AddElsa(elsa => elsa.UseDsl());
|
||||
services.AddLogging(logging => logging.AddConsole().SetMinimumLevel(LogLevel.Warning));
|
||||
|
||||
return services.BuildServiceProvider();
|
||||
}
|
||||
Loading…
Reference in a new issue