Generate package Caspian.WorkflowFramework.1.1.0-preview.1.nupkg
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<PackageId>Caspian.WorkflowFramework</PackageId>
|
<PackageId>Caspian.WorkflowFramework</PackageId>
|
||||||
<Version>1.0.1-preview.3</Version>
|
<Version>1.1.0-preview.1</Version>
|
||||||
<Authors>Digital banking team</Authors>
|
<Authors>Digital banking team</Authors>
|
||||||
<Company>Caspian</Company>
|
<Company>Caspian</Company>
|
||||||
<Product>Caspian.WorkflowFramework</Product>
|
<Product>Caspian.WorkflowFramework</Product>
|
||||||
@@ -20,72 +20,58 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Caspian.Elsa.WorkflowContexts" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa.Workflows.Runtime.Distributed" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.Expressions" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa.Alterations" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.Alterations" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa.Alterations.MassTransit" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.Alterations.Core" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa.Caching.Distributed.MassTransit" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.Alterations.MassTransit" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa.Caching.Distributed.ProtoActor" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.Api.Client" Version="1.0.2-preview1" />
|
<PackageReference Include="Caspian.Elsa.CSharp" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.Api.Common" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa.Dapper" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.Caching" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa.Dapper.Migrations" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.Caching.Distributed.ProtoActor" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa.DropIns" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.Common" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa.Email" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.Connections.Api" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa.Elasticsearch" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.Connections.Core" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa.Environments" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.Connections.Models" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa.EntityFrameworkCore" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.CSharp" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa.EntityFrameworkCore.MySql" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.Dapper.Migrations" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa.EntityFrameworkCore.Oracle" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.DropIns" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa.EntityFrameworkCore.PostgreSql" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.DropIns.Core" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa.EntityFrameworkCore.Sqlite" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.Dsl" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa.EntityFrameworkCore.SqlServer" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.Email" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa.FileStorage" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.EntityFrameworkCore" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa.Hangfire" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.EntityFrameworkCore.Common" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa.Http" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.EntityFrameworkCore.MySql" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa.Identity" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.EntityFrameworkCore.Oracle" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa.Kafka" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.EntityFrameworkCore.PostgreSql" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa.Labels" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.EntityFrameworkCore.Sqlite" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa.Liquid" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.EntityFrameworkCore.SqlServer" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa.MassTransit" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.Environments" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa.MassTransit.AzureServiceBus" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.Features" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa.MassTransit.RabbitMq" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.Hangfire" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa.MongoDb" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.Hosting.Management" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa.OpenTelemetry" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.Http" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa.Quartz" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.Identity" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa.Quartz.EntityFrameworkCore.MySql" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.JavaScript" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa.Quartz.EntityFrameworkCore.PostgreSql" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.JavaScript.Libraries" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa.Quartz.EntityFrameworkCore.Sqlite" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.Liquid" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa.Retention" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.Mediator" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa.Secrets.Api" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.ProtoActor.Core" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa.Secrets.Persistence.EntityFrameworkCore.PostgreSql" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.Python" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa.Secrets.Persistence.EntityFrameworkCore.Sqlite" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.Quartz" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa.Secrets.Persistence.EntityFrameworkCore.SqlServer" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.Quartz.EntityFrameworkCore.MySql" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa.Secrets.Scripting" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.Quartz.EntityFrameworkCore.PostgreSql" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa.Sql.MySql" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.Quartz.EntityFrameworkCore.Sqlite" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa.Sql.PostgreSql" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.Quartz.EntityFrameworkCore.SqlServer" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa.Sql.Sqlite" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.Retention" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa.Sql.SqlServer" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.SasTokens" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa.Sql" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.Scheduling" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa.Tenants.AspNetCore" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.Sql.PostgreSql" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa.Webhooks" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.Sql.Sqlite" Version="1.0.1" />
|
<PackageReference Include="Caspian.Elsa" Version="1.1.0-preview.1" />
|
||||||
<PackageReference Include="Caspian.Elsa.Sql.SqlServer" Version="1.0.1" />
|
|
||||||
<PackageReference Include="Caspian.Elsa.Tenants" Version="1.0.1" />
|
|
||||||
<PackageReference Include="Caspian.Elsa.Tenants.AspNetCore" Version="1.0.1" />
|
|
||||||
<PackageReference Include="Caspian.Elsa.Testing.Shared" Version="1.0.1" />
|
|
||||||
<PackageReference Include="Caspian.Elsa.Testing.Shared.Component" Version="1.0.1" />
|
|
||||||
<PackageReference Include="Caspian.Elsa.Testing.Shared.Integration" Version="1.0.1" />
|
|
||||||
<PackageReference Include="Caspian.Elsa.Webhooks" Version="1.0.1" />
|
|
||||||
<PackageReference Include="Caspian.Elsa.WorkflowContexts" Version="1.0.1" />
|
|
||||||
<PackageReference Include="Caspian.Elsa.WorkflowProviders.BlobStorage" Version="1.0.1" />
|
|
||||||
<PackageReference Include="Caspian.Elsa.Workflows.Api" Version="1.0.1" />
|
|
||||||
<PackageReference Include="Caspian.Elsa.Workflows.Core" Version="1.0.1" />
|
|
||||||
<PackageReference Include="Caspian.Elsa.Workflows.Management" Version="1.0.1" />
|
|
||||||
<PackageReference Include="Caspian.Elsa.Workflows.Runtime" Version="1.0.1" />
|
|
||||||
<PackageReference Include="Caspian.Elsa.Workflows.Runtime.Distributed" Version="1.0.1" />
|
|
||||||
<PackageReference Include="JetBrains.Annotations" Version="2024.3.0" />
|
<PackageReference Include="JetBrains.Annotations" Version="2024.3.0" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.3.0" />
|
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.3.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.3" />
|
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.7" />
|
||||||
<PackageReference Include="San.MongoLogger" Version="1.0.0-preview.9" />
|
<PackageReference Include="San.MongoLogger" Version="1.0.0-preview.9" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,33 @@
|
|||||||
using Caspian.WorkflowFramework.Contracts;
|
using Caspian.WorkflowFramework.Contracts;
|
||||||
using Caspian.WorkflowFramework.Services;
|
using Caspian.WorkflowFramework.Services;
|
||||||
using Elsa.Extensions;
|
using Elsa.Caching.Options;
|
||||||
using Microsoft.AspNetCore.Builder;
|
using Elsa.Common.RecurringTasks;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Elsa.Common.Serialization;
|
||||||
using Microsoft.Extensions.Hosting;
|
|
||||||
using Elsa.EntityFrameworkCore.Extensions;
|
using Elsa.EntityFrameworkCore.Extensions;
|
||||||
|
using Elsa.EntityFrameworkCore.Modules.Alterations;
|
||||||
|
using Elsa.EntityFrameworkCore.Modules.Identity;
|
||||||
using Elsa.EntityFrameworkCore.Modules.Management;
|
using Elsa.EntityFrameworkCore.Modules.Management;
|
||||||
using Elsa.EntityFrameworkCore.Modules.Runtime;
|
using Elsa.EntityFrameworkCore.Modules.Runtime;
|
||||||
using Elsa.EntityFrameworkCore.Modules.Identity;
|
using Elsa.EntityFrameworkCore.Modules.Tenants;
|
||||||
using Elsa.Email;
|
using Elsa.Extensions;
|
||||||
|
using Elsa.Kafka.Factories;
|
||||||
|
using Elsa.OpenTelemetry.Middleware;
|
||||||
|
using Elsa.Secrets.Management.Tasks;
|
||||||
|
using Elsa.Secrets.Persistence;
|
||||||
|
using Elsa.Server.Web;
|
||||||
|
using Elsa.Server.Web.Messages;
|
||||||
|
using Elsa.Workflows;
|
||||||
|
using Elsa.Workflows.IncidentStrategies;
|
||||||
|
using Elsa.Workflows.LogPersistence;
|
||||||
|
using Elsa.Workflows.Management;
|
||||||
|
using Elsa.Workflows.Options;
|
||||||
|
using Elsa.Workflows.Runtime.Distributed.Extensions;
|
||||||
|
using Elsa.Workflows.Runtime.Options;
|
||||||
|
using Elsa.Workflows.Runtime.Tasks;
|
||||||
|
using Microsoft.AspNetCore.Builder;
|
||||||
|
using Microsoft.AspNetCore.Hosting;
|
||||||
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
using Microsoft.Extensions.Hosting;
|
||||||
using San.MongoLogger;
|
using San.MongoLogger;
|
||||||
using San.MongoLogger.Models;
|
using San.MongoLogger.Models;
|
||||||
|
|
||||||
@@ -16,57 +35,144 @@ namespace Caspian.WorkflowFramework;
|
|||||||
|
|
||||||
public static class DependencyInjection
|
public static class DependencyInjection
|
||||||
{
|
{
|
||||||
public static void AddWorkflowFramework(this IHostApplicationBuilder builder, string connectionString)
|
public static void AddWorkflowFramework(this IHostApplicationBuilder builder, string sqlServerConnectionString)
|
||||||
{
|
{
|
||||||
|
//var configuration = new ConfigurationBuilder()
|
||||||
|
// .AddJsonFile(appsettingName, optional: false, reloadOnChange: true)
|
||||||
|
// .Build();
|
||||||
|
//var sqlServerConnectionString = configuration.GetConnectionString("SqlServer")!;
|
||||||
|
|
||||||
|
var sqlDatabaseProvider = Enum.Parse<SqlDatabaseProvider>("SqlServer");
|
||||||
|
const bool useDbContextPooling = false;
|
||||||
|
const bool runEFCoreMigrations = true;
|
||||||
|
const bool useCaching = true;
|
||||||
|
const bool useReadOnlyMode = false;
|
||||||
|
const WorkflowRuntime workflowRuntime = WorkflowRuntime.Distributed;
|
||||||
|
const bool disableVariableWrappers = false;
|
||||||
|
const bool disableVariableCopying = false;
|
||||||
|
|
||||||
|
// Optionally create type aliases for easier configuration.
|
||||||
|
TypeAliasRegistry.RegisterAlias("OrderReceivedProducerFactory", typeof(GenericProducerFactory<string, OrderReceived>));
|
||||||
|
TypeAliasRegistry.RegisterAlias("OrderReceivedConsumerFactory", typeof(GenericConsumerFactory<string, OrderReceived>));
|
||||||
|
|
||||||
|
// Add Elsa services.
|
||||||
|
builder.Services.AddScoped<IPropertyUIHandler, CustomCheckListOptionsProvider>();
|
||||||
|
|
||||||
builder.Services.AddMongoLogger<LogModel>(builder.Configuration);
|
builder.Services.AddMongoLogger<LogModel>(builder.Configuration);
|
||||||
|
|
||||||
builder.Services.AddElsa(elsa =>
|
builder.Services.AddElsa(elsa =>
|
||||||
{
|
{
|
||||||
// Configure Management layer to use EF Core.
|
elsa
|
||||||
elsa.UseWorkflowManagement(management => management
|
.UseWorkflows(workflows =>
|
||||||
.UseEntityFrameworkCore(ef => ef.UseSqlServer(connectionString)));
|
{
|
||||||
|
workflows.WithDefaultWorkflowExecutionPipeline(pipeline => pipeline.UseWorkflowExecutionTracing());
|
||||||
|
workflows.WithDefaultActivityExecutionPipeline(pipeline => pipeline.UseActivityExecutionTracing());
|
||||||
|
workflows.UseCommitStrategies(strategies =>
|
||||||
|
{
|
||||||
|
strategies.AddStandardStrategies();
|
||||||
|
//می خوایم سریع انجام شه
|
||||||
|
//strategies.Add("Every 10 seconds", new PeriodicWorkflowStrategy(TimeSpan.FromSeconds(10)));
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.UseWorkflowManagement(management =>
|
||||||
|
{
|
||||||
|
management.UseEntityFrameworkCore(ef =>
|
||||||
|
{
|
||||||
|
ef.UseSqlServer(sqlServerConnectionString);
|
||||||
|
});
|
||||||
|
|
||||||
// Configure Runtime layer to use EF Core.
|
if (useCaching)
|
||||||
elsa.UseWorkflowRuntime(runtime => runtime
|
management.UseCache();
|
||||||
.UseEntityFrameworkCore(ef => ef.UseSqlServer(connectionString)));
|
|
||||||
|
|
||||||
// Expose Elsa API endpoints.
|
management.SetDefaultLogPersistenceMode(LogPersistenceMode.Inherit);
|
||||||
elsa.UseWorkflowsApi();
|
management.UseReadOnlyMode(useReadOnlyMode);
|
||||||
|
management.AddVariableTypeAndAlias<OrderReceived>("Application");
|
||||||
|
})
|
||||||
|
.UseWorkflowRuntime(runtime =>
|
||||||
|
{
|
||||||
|
runtime.UseEntityFrameworkCore(ef =>
|
||||||
|
{
|
||||||
|
ef.UseContextPooling = useDbContextPooling;
|
||||||
|
|
||||||
// Enable C# workflow expressions
|
var migrationsAssembly = typeof(Elsa.EntityFrameworkCore.SqlServer.IdentityDbContextFactory).Assembly;
|
||||||
elsa.UseCSharp();
|
var connectionString = sqlServerConnectionString;
|
||||||
|
ef.DbContextOptionsBuilder = (_, db) => db.UseElsaSqlServer(migrationsAssembly, connectionString, null, configure => configure.CommandTimeout(60000));
|
||||||
|
|
||||||
// Enable JavaScript workflow expressions
|
ef.RunMigrations = runEFCoreMigrations;
|
||||||
elsa.UseJavaScript(options => options.AllowClrAccess = true);
|
});
|
||||||
|
|
||||||
|
if (workflowRuntime == WorkflowRuntime.Distributed)
|
||||||
|
{
|
||||||
|
runtime.UseDistributedRuntime();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (useCaching)
|
||||||
|
runtime.UseCache();
|
||||||
|
})
|
||||||
|
.UseCSharp(options =>
|
||||||
|
{
|
||||||
|
options.DisableWrappers = disableVariableWrappers;
|
||||||
|
//options.AppendScript("string Greet(string name) => $\"Hello {name}!\";");
|
||||||
|
//options.AppendScript("string SayHelloWorld() => Greet(\"World\");");
|
||||||
|
})
|
||||||
|
.UseJavaScript(options =>
|
||||||
|
{
|
||||||
|
options.AllowClrAccess = true;
|
||||||
|
options.DisableWrappers = disableVariableWrappers;
|
||||||
|
options.DisableVariableCopying = disableVariableCopying;
|
||||||
|
options.RegisterType<OrderReceived>();
|
||||||
|
//options.ConfigureEngine(engine =>
|
||||||
|
//{
|
||||||
|
// engine.Execute("function greet(name) { return `Hello ${name}!`; }");
|
||||||
|
// engine.Execute("function sayHelloWorld() { return greet('World'); }");
|
||||||
|
//});
|
||||||
|
})
|
||||||
|
.UseWorkflowContexts();
|
||||||
|
|
||||||
|
//elsa.AddFastEndpointsAssembly<Program>();
|
||||||
});
|
});
|
||||||
|
|
||||||
//// Configure CORS to allow designer app hosted on a different origin to invoke the APIs.
|
// Optionally configure recurring tasks using alternative schedules.
|
||||||
//builder.Services.AddCors(cors => cors
|
builder.Services.Configure<RecurringTaskOptions>(options =>
|
||||||
// .AddDefaultPolicy(policy => policy
|
{
|
||||||
// .AllowAnyOrigin() // For demo purposes only. Use a specific origin instead.
|
options.Schedule.ConfigureTask<TriggerBookmarkQueueRecurringTask>(TimeSpan.FromSeconds(300));
|
||||||
// .AllowAnyHeader()
|
options.Schedule.ConfigureTask<PurgeBookmarkQueueRecurringTask>(TimeSpan.FromSeconds(300));
|
||||||
// .AllowAnyMethod()
|
options.Schedule.ConfigureTask<UpdateExpiredSecretsRecurringTask>(TimeSpan.FromHours(4));
|
||||||
// .WithExposedHeaders("x-elsa-workflow-instance-id"))); // Required for Elsa Studio in order to support running workflows from the designer. Alternatively, you can use the `*` wildcard to expose all headers.
|
options.Schedule.ConfigureTask<RestartInterruptedWorkflowsTask>(TimeSpan.FromSeconds(15));
|
||||||
|
});
|
||||||
|
|
||||||
|
builder.Services.Configure<RuntimeOptions>(options => { options.InactivityThreshold = TimeSpan.FromSeconds(15); });
|
||||||
// Add Health Checks.
|
builder.Services.Configure<BookmarkQueuePurgeOptions>(options => options.Ttl = TimeSpan.FromSeconds(10));
|
||||||
builder.Services.AddHealthChecks();
|
builder.Services.Configure<CachingOptions>(options => options.CacheDuration = TimeSpan.FromDays(1));
|
||||||
|
builder.Services.Configure<IncidentOptions>(options => options.DefaultIncidentStrategy = typeof(ContinueWithIncidentsStrategy));
|
||||||
|
//builder.Services.AddHealthChecks();
|
||||||
|
|
||||||
builder.Services.AddScoped<IWorkflowService, WorkflowService>();
|
builder.Services.AddScoped<IWorkflowService, WorkflowService>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void UseWorkflowFramework(this IApplicationBuilder app)
|
public static void UseWorkflowFramework(this IApplicationBuilder app)
|
||||||
{
|
{
|
||||||
try
|
//try
|
||||||
{
|
//{
|
||||||
app.UseMongoLogger<LogModel>();
|
// app.UseMongoLogger<LogModel>();
|
||||||
}
|
//}
|
||||||
catch (Exception ex)
|
//catch (Exception ex)
|
||||||
{
|
//{
|
||||||
var d = ex;
|
// var d = ex;
|
||||||
}
|
//}
|
||||||
|
|
||||||
//app.UseWorkflowsApi(); // Use Elsa API endpoints.
|
// Configure the pipeline.
|
||||||
app.UseWorkflows(); // Use Elsa middleware to handle HTTP requests mapped to HTTP Endpoint activities.
|
var env = app.ApplicationServices.GetRequiredService<IWebHostEnvironment>();
|
||||||
|
if (env.IsDevelopment())
|
||||||
|
app.UseDeveloperExceptionPage();
|
||||||
|
|
||||||
|
// Health checks.
|
||||||
|
//app.MapHealthChecks("/");
|
||||||
|
|
||||||
|
// Captures unhandled exceptions and returns a JSON response.
|
||||||
|
app.UseJsonSerializationErrorHandler();
|
||||||
|
|
||||||
|
//app.UseWorkflows();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
namespace Elsa.Server.Web;
|
||||||
|
|
||||||
|
public enum ApplicationRole
|
||||||
|
{
|
||||||
|
Default,
|
||||||
|
Api,
|
||||||
|
Worker,
|
||||||
|
Monitor
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
namespace Elsa.Server.Web;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Represents the transport options for distributed caching.
|
||||||
|
/// </summary>
|
||||||
|
public enum DistributedCachingTransport
|
||||||
|
{
|
||||||
|
None,
|
||||||
|
Memory,
|
||||||
|
MassTransit,
|
||||||
|
ProtoActor
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
namespace Elsa.Server.Web;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Represents the type of messaging broker used in MassTransit.
|
||||||
|
/// </summary>
|
||||||
|
public enum MassTransitBroker
|
||||||
|
{
|
||||||
|
Memory,
|
||||||
|
AzureServiceBus,
|
||||||
|
RabbitMq
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
namespace Elsa.Server.Web;
|
||||||
|
|
||||||
|
public enum PersistenceProvider
|
||||||
|
{
|
||||||
|
Memory,
|
||||||
|
EntityFrameworkCore,
|
||||||
|
MongoDb,
|
||||||
|
Dapper
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
namespace Elsa.Server.Web;
|
||||||
|
|
||||||
|
public enum SqlDatabaseProvider
|
||||||
|
{
|
||||||
|
SqlServer,
|
||||||
|
Sqlite,
|
||||||
|
MySql,
|
||||||
|
PostgreSql,
|
||||||
|
Citus,
|
||||||
|
YugabyteDb,
|
||||||
|
Oracle,
|
||||||
|
CockroachDb
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
namespace Elsa.Server.Web;
|
||||||
|
|
||||||
|
public enum WorkflowRuntime
|
||||||
|
{
|
||||||
|
Default,
|
||||||
|
Distributed,
|
||||||
|
ProtoActor
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
namespace Elsa.Server.Web.Messages;
|
||||||
|
|
||||||
|
public class OrderReceived
|
||||||
|
{
|
||||||
|
public string OrderId { get; set; } = null!;
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using Elsa.Workflows.UIHints.CheckList;
|
||||||
|
|
||||||
|
namespace Elsa.Server.Web;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Provides static drop-down options for a given property.
|
||||||
|
/// </summary>
|
||||||
|
public class CustomCheckListOptionsProvider : CheckListOptionsProviderBase
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override ValueTask<ICollection<CheckListItem>> GetItemsAsync(PropertyInfo propertyInfo, object? context, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
var items = new[]
|
||||||
|
{
|
||||||
|
"Apple", "Banana", "Cherry"
|
||||||
|
};
|
||||||
|
var selectListItems = items.Select(x => new CheckListItem(x, x)).ToList();
|
||||||
|
|
||||||
|
return new(selectListItems);
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
-14
@@ -7,19 +7,6 @@
|
|||||||
<add key="Elsa 3 Preview" value="https://f.feedz.io/elsa-workflows/elsa-3/nuget/index.json" />
|
<add key="Elsa 3 Preview" value="https://f.feedz.io/elsa-workflows/elsa-3/nuget/index.json" />
|
||||||
<add key="Webhooks Core Preview" value="https://f.feedz.io/sfmskywalker/webhooks-core/nuget/index.json" />
|
<add key="Webhooks Core Preview" value="https://f.feedz.io/sfmskywalker/webhooks-core/nuget/index.json" />
|
||||||
<add key="Local Package source" value="D:\MyNugetPackages" />
|
<add key="Local Package source" value="D:\MyNugetPackages" />
|
||||||
|
<add key="Caspian Elsa Core" value="D:\NugetPackages_ElsaCore" />
|
||||||
</packageSources>
|
</packageSources>
|
||||||
<packageSourceMapping>
|
|
||||||
<packageSource key="NuGet official package source">
|
|
||||||
<package pattern="*" />
|
|
||||||
</packageSource>
|
|
||||||
<packageSource key="Elsa 3 Preview">
|
|
||||||
<package pattern="Elsa" />
|
|
||||||
<package pattern="Elsa.*" />
|
|
||||||
<package pattern="Elsa.Studio.*" />
|
|
||||||
</packageSource>
|
|
||||||
<packageSource key="Webhooks Core Preview">
|
|
||||||
<package pattern="WebhooksCore" />
|
|
||||||
<package pattern="WebhooksCore.*" />
|
|
||||||
</packageSource>
|
|
||||||
</packageSourceMapping>
|
|
||||||
</configuration>
|
</configuration>
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
},
|
},
|
||||||
"AllowedHosts": "*",
|
"AllowedHosts": "*",
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
"DefaultConnection": "Data Source=.;Initial Catalog=WorkflowFrameworkTest;User ID=sa;Password=123456;Integrated Security=false;TrustServerCertificate=True;"
|
"DefaultConnection": "Data Source=.;Initial Catalog=WfDb;User ID=sa;Password=123456;Integrated Security=false;TrustServerCertificate=True;"
|
||||||
},
|
},
|
||||||
"LogDatabaseSettings": {
|
"LogDatabaseSettings": {
|
||||||
"LogsCollectionName": "TestWorkflowCollection",
|
"LogsCollectionName": "TestWorkflowCollection",
|
||||||
|
|||||||
Reference in New Issue
Block a user