Browse Source

Integrated elsa-core

pull/636/head
cKey 3 years ago
parent
commit
5c5518ec43
  1. 1
      aspnet-core/Directory.Build.props
  2. 31
      aspnet-core/LINGYUN.MicroService.Workflow.sln
  3. 18
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFramework.Core/LINGYUN.Abp.Elsa.EntityFramework.Core.csproj
  4. 15
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFramework.Core/LINGYUN/Abp/Elsa/EntityFramework.Core/AbpElsaEntityFrameworkCoreModule.cs
  5. 0
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Server/FodyWeavers.xml
  6. 0
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Server/FodyWeavers.xsd
  7. 20
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Server/LINGYUN.Abp.Elsa.Server.csproj
  8. 22
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Server/LINGYUN/Abp/Elsa/AbpElsaServerModule.cs
  9. 0
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa/FodyWeavers.xml
  10. 0
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa/FodyWeavers.xsd
  11. 3
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa/LINGYUN.Abp.Elsa.csproj
  12. 19
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa/LINGYUN/Abp/Elsa/AbpElsaIdGenerator.cs
  13. 25
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa/LINGYUN/Abp/Elsa/AbpElsaModule.cs
  14. 2
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa/LINGYUN/Abp/Elsa/AbpTenantAccessor.cs
  15. 8
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa/LINGYUN/Abp/Elsa/Localization/ElsaResource.cs
  16. 19
      aspnet-core/modules/workflow/LINGYUN.Abp.Workflow.Elsa.Server/LINGYUN.Abp.Workflow.Elsa.Server.csproj
  17. 13
      aspnet-core/modules/workflow/LINGYUN.Abp.Workflow.Elsa.Server/LINGYUN/Abp/Workflow/Elsa/AbpWorkflowElsaServerModule.cs
  18. 15
      aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/LY.MicroService.WorkflowManagement.HttpApi.Host.csproj
  19. 23
      aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/Pages/_Host.cshtml
  20. 43
      aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/WorkflowManagementHttpApiHostModule.Configure.cs
  21. 13
      aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/WorkflowManagementHttpApiHostModule.cs
  22. 7
      aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/appsettings.Development.json

1
aspnet-core/Directory.Build.props

@ -5,6 +5,7 @@
<DaprPackageVersion>1.8.0</DaprPackageVersion> <DaprPackageVersion>1.8.0</DaprPackageVersion>
<DistributedLockRedisPackageVersion>1.0.1</DistributedLockRedisPackageVersion> <DistributedLockRedisPackageVersion>1.0.1</DistributedLockRedisPackageVersion>
<DotNetCoreCAPPackageVersion>6.0.1</DotNetCoreCAPPackageVersion> <DotNetCoreCAPPackageVersion>6.0.1</DotNetCoreCAPPackageVersion>
<ElsaPackageVersion>2.8.2</ElsaPackageVersion>
<AliyunSDKPackageVersion>1.5.10</AliyunSDKPackageVersion> <AliyunSDKPackageVersion>1.5.10</AliyunSDKPackageVersion>
<AliyunOSSSDKPackageVersion>2.13.0</AliyunOSSSDKPackageVersion> <AliyunOSSSDKPackageVersion>2.13.0</AliyunOSSSDKPackageVersion>
<TencentCloudSDKPackageVersion>3.0.434</TencentCloudSDKPackageVersion> <TencentCloudSDKPackageVersion>3.0.434</TencentCloudSDKPackageVersion>

31
aspnet-core/LINGYUN.MicroService.Workflow.sln

@ -51,9 +51,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflow-core", "workflow-c
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "elsa", "elsa", "{F1CCBEC7-ACAB-4DC5-909E-D8CC2E1B7EEC}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "elsa", "elsa", "{F1CCBEC7-ACAB-4DC5-909E-D8CC2E1B7EEC}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Workflow.Elsa", "modules\workflow\LINGYUN.Abp.Workflow.Elsa\LINGYUN.Abp.Workflow.Elsa.csproj", "{A6718032-429C-4136-8969-7F39EAE14E8F}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Elsa", "modules\elsa\LINGYUN.Abp.Elsa\LINGYUN.Abp.Elsa.csproj", "{17EA5194-BBE8-4CE1-B6F9-DF6829622F38}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Workflow.Elsa.Server", "modules\workflow\LINGYUN.Abp.Workflow.Elsa.Server\LINGYUN.Abp.Workflow.Elsa.Server.csproj", "{2F2BDD2D-86D7-4DA9-9F69-76517A00EB5C}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Elsa.Server", "modules\elsa\LINGYUN.Abp.Elsa.Server\LINGYUN.Abp.Elsa.Server.csproj", "{88AA0D46-597E-4969-8382-A3F8054B9409}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Elsa.EntityFramework.Core", "modules\elsa\LINGYUN.Abp.Elsa.EntityFramework.Core\LINGYUN.Abp.Elsa.EntityFramework.Core.csproj", "{CAC0D3A2-8BFA-4A84-A7FA-550A3BB16288}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -129,14 +131,18 @@ Global
{0A21C843-4175-42F2-A95D-A75ED1DC1E05}.Debug|Any CPU.Build.0 = Debug|Any CPU {0A21C843-4175-42F2-A95D-A75ED1DC1E05}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0A21C843-4175-42F2-A95D-A75ED1DC1E05}.Release|Any CPU.ActiveCfg = Release|Any CPU {0A21C843-4175-42F2-A95D-A75ED1DC1E05}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0A21C843-4175-42F2-A95D-A75ED1DC1E05}.Release|Any CPU.Build.0 = Release|Any CPU {0A21C843-4175-42F2-A95D-A75ED1DC1E05}.Release|Any CPU.Build.0 = Release|Any CPU
{A6718032-429C-4136-8969-7F39EAE14E8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {17EA5194-BBE8-4CE1-B6F9-DF6829622F38}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A6718032-429C-4136-8969-7F39EAE14E8F}.Debug|Any CPU.Build.0 = Debug|Any CPU {17EA5194-BBE8-4CE1-B6F9-DF6829622F38}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A6718032-429C-4136-8969-7F39EAE14E8F}.Release|Any CPU.ActiveCfg = Release|Any CPU {17EA5194-BBE8-4CE1-B6F9-DF6829622F38}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A6718032-429C-4136-8969-7F39EAE14E8F}.Release|Any CPU.Build.0 = Release|Any CPU {17EA5194-BBE8-4CE1-B6F9-DF6829622F38}.Release|Any CPU.Build.0 = Release|Any CPU
{2F2BDD2D-86D7-4DA9-9F69-76517A00EB5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {88AA0D46-597E-4969-8382-A3F8054B9409}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2F2BDD2D-86D7-4DA9-9F69-76517A00EB5C}.Debug|Any CPU.Build.0 = Debug|Any CPU {88AA0D46-597E-4969-8382-A3F8054B9409}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2F2BDD2D-86D7-4DA9-9F69-76517A00EB5C}.Release|Any CPU.ActiveCfg = Release|Any CPU {88AA0D46-597E-4969-8382-A3F8054B9409}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2F2BDD2D-86D7-4DA9-9F69-76517A00EB5C}.Release|Any CPU.Build.0 = Release|Any CPU {88AA0D46-597E-4969-8382-A3F8054B9409}.Release|Any CPU.Build.0 = Release|Any CPU
{CAC0D3A2-8BFA-4A84-A7FA-550A3BB16288}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CAC0D3A2-8BFA-4A84-A7FA-550A3BB16288}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CAC0D3A2-8BFA-4A84-A7FA-550A3BB16288}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CAC0D3A2-8BFA-4A84-A7FA-550A3BB16288}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
@ -162,8 +168,9 @@ Global
{D5ED348D-D6F0-4093-BD7D-20E05AA1EB7B} = {6CB521FC-AC40-49A6-B9A5-91399CAA59AB} {D5ED348D-D6F0-4093-BD7D-20E05AA1EB7B} = {6CB521FC-AC40-49A6-B9A5-91399CAA59AB}
{57CB3446-B825-4C55-A24A-E15EB2CAA80D} = {DFE3435C-DD59-496F-BB77-6F7D62D2EA88} {57CB3446-B825-4C55-A24A-E15EB2CAA80D} = {DFE3435C-DD59-496F-BB77-6F7D62D2EA88}
{0A21C843-4175-42F2-A95D-A75ED1DC1E05} = {57CB3446-B825-4C55-A24A-E15EB2CAA80D} {0A21C843-4175-42F2-A95D-A75ED1DC1E05} = {57CB3446-B825-4C55-A24A-E15EB2CAA80D}
{A6718032-429C-4136-8969-7F39EAE14E8F} = {F1CCBEC7-ACAB-4DC5-909E-D8CC2E1B7EEC} {17EA5194-BBE8-4CE1-B6F9-DF6829622F38} = {F1CCBEC7-ACAB-4DC5-909E-D8CC2E1B7EEC}
{2F2BDD2D-86D7-4DA9-9F69-76517A00EB5C} = {F1CCBEC7-ACAB-4DC5-909E-D8CC2E1B7EEC} {88AA0D46-597E-4969-8382-A3F8054B9409} = {F1CCBEC7-ACAB-4DC5-909E-D8CC2E1B7EEC}
{CAC0D3A2-8BFA-4A84-A7FA-550A3BB16288} = {F1CCBEC7-ACAB-4DC5-909E-D8CC2E1B7EEC}
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6BB7A5DE-DA12-44DC-BC9B-0F6CA524346F} SolutionGuid = {6BB7A5DE-DA12-44DC-BC9B-0F6CA524346F}

18
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFramework.Core/LINGYUN.Abp.Elsa.EntityFramework.Core.csproj

@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Elsa.Webhooks.Persistence.EntityFramework.Core" Version="$(ElsaPackageVersion)" />
<PackageReference Include="Elsa.WorkflowSettings.Persistence.EntityFramework.Core" Version="$(ElsaPackageVersion)" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore" Version="$(VoloAbpPackageVersion)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.Elsa\LINGYUN.Abp.Elsa.csproj" />
</ItemGroup>
</Project>

15
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFramework.Core/LINGYUN/Abp/Elsa/EntityFramework.Core/AbpElsaEntityFrameworkCoreModule.cs

@ -0,0 +1,15 @@
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.Modularity;
namespace LINGYUN.Abp.Elsa.EntityFramework.Core;
[DependsOn(
typeof(AbpElsaModule),
typeof(AbpEntityFrameworkCoreModule))]
public class AbpElsaEntityFrameworkCoreModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
}
}

0
aspnet-core/modules/workflow/LINGYUN.Abp.Workflow.Elsa.Server/FodyWeavers.xml → aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Server/FodyWeavers.xml

0
aspnet-core/modules/workflow/LINGYUN.Abp.Workflow.Elsa.Server/FodyWeavers.xsd → aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Server/FodyWeavers.xsd

20
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Server/LINGYUN.Abp.Elsa.Server.csproj

@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\configureawait.props" />
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Elsa.Server.Api" Version="$(ElsaPackageVersion)" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="$(VoloAbpPackageVersion)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.Elsa\LINGYUN.Abp.Elsa.csproj" />
</ItemGroup>
</Project>

22
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Server/LINGYUN/Abp/Elsa/AbpElsaServerModule.cs

@ -0,0 +1,22 @@
using Elsa.Server.Api;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.Modularity;
namespace LINGYUN.Abp.Elsa;
[DependsOn(
typeof(AbpElsaModule),
typeof(AbpAspNetCoreMvcModule))]
public class AbpElsaServerModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
var preElsaApiOptions = context.Services.GetPreConfigureActions<ElsaApiOptions>();
context.Services.AddElsaApiEndpoints(options =>
{
preElsaApiOptions.Configure(options);
});
}
}

0
aspnet-core/modules/workflow/LINGYUN.Abp.Workflow.Elsa/FodyWeavers.xml → aspnet-core/modules/elsa/LINGYUN.Abp.Elsa/FodyWeavers.xml

0
aspnet-core/modules/workflow/LINGYUN.Abp.Workflow.Elsa/FodyWeavers.xsd → aspnet-core/modules/elsa/LINGYUN.Abp.Elsa/FodyWeavers.xsd

3
aspnet-core/modules/workflow/LINGYUN.Abp.Workflow.Elsa/LINGYUN.Abp.Workflow.Elsa.csproj → aspnet-core/modules/elsa/LINGYUN.Abp.Elsa/LINGYUN.Abp.Elsa.csproj

@ -10,10 +10,11 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Features" Version="$(VoloAbpPackageVersion)" /> <PackageReference Include="Volo.Abp.Features" Version="$(VoloAbpPackageVersion)" />
<PackageReference Include="Volo.Abp.Guids" Version="$(VoloAbpPackageVersion)" />
<PackageReference Include="Volo.Abp.Timing" Version="$(VoloAbpPackageVersion)" /> <PackageReference Include="Volo.Abp.Timing" Version="$(VoloAbpPackageVersion)" />
<PackageReference Include="Volo.Abp.Threading" Version="$(VoloAbpPackageVersion)" /> <PackageReference Include="Volo.Abp.Threading" Version="$(VoloAbpPackageVersion)" />
<PackageReference Include="Volo.Abp.Json" Version="$(VoloAbpPackageVersion)" /> <PackageReference Include="Volo.Abp.Json" Version="$(VoloAbpPackageVersion)" />
<PackageReference Include="Elsa" Version="2.8.2" /> <PackageReference Include="Elsa" Version="$(ElsaPackageVersion)" />
</ItemGroup> </ItemGroup>
</Project> </Project>

19
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa/LINGYUN/Abp/Elsa/AbpElsaIdGenerator.cs

@ -0,0 +1,19 @@
using Elsa.Services;
using Volo.Abp.Guids;
namespace LINGYUN.Abp.Elsa;
public class AbpElsaIdGenerator : IIdGenerator
{
private readonly IGuidGenerator _guidGenerator;
public AbpElsaIdGenerator(IGuidGenerator guidGenerator)
{
_guidGenerator = guidGenerator;
}
public string Generate()
{
return _guidGenerator.Create().ToString("N");
}
}

25
aspnet-core/modules/workflow/LINGYUN.Abp.Workflow.Elsa/LINGYUN/Abp/Workflow/Elsa/AbpWorkflowElsaModule.cs → aspnet-core/modules/elsa/LINGYUN.Abp.Elsa/LINGYUN/Abp/Elsa/AbpElsaModule.cs

@ -1,15 +1,26 @@
using Microsoft.Extensions.DependencyInjection; using Elsa;
using Elsa.Services;
using LINGYUN.Abp.Elsa.Localization;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using Newtonsoft.Json; using Newtonsoft.Json;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Volo.Abp.Features;
using Volo.Abp.Json;
using Volo.Abp.Json.Newtonsoft; using Volo.Abp.Json.Newtonsoft;
using Volo.Abp.Localization;
using Volo.Abp.Modularity; using Volo.Abp.Modularity;
using Volo.Abp.Threading;
using ElsaOptionsBuilder = Elsa.Options.ElsaOptionsBuilder; using ElsaOptionsBuilder = Elsa.Options.ElsaOptionsBuilder;
namespace LINGYUN.Abp.Workflow.Elsa; namespace LINGYUN.Abp.Elsa;
public class AbpWorkflowElsaModule : AbpModule [DependsOn(
typeof(AbpFeaturesModule),
typeof(AbpThreadingModule),
typeof(AbpJsonModule))]
public class AbpElsaModule : AbpModule
{ {
public override void ConfigureServices(ServiceConfigurationContext context) public override void ConfigureServices(ServiceConfigurationContext context)
{ {
@ -19,6 +30,7 @@ public class AbpWorkflowElsaModule : AbpModule
{ {
options.AddCustomTenantAccessor<AbpTenantAccessor>(); options.AddCustomTenantAccessor<AbpTenantAccessor>();
options.AddConsoleActivities(); options.AddConsoleActivities();
options.AddJavaScriptActivities();
options.UseJsonSerializer((provider) => options.UseJsonSerializer((provider) =>
{ {
var jsonOptions = provider.GetRequiredService<IOptions<AbpNewtonsoftJsonSerializerOptions>>(); var jsonOptions = provider.GetRequiredService<IOptions<AbpNewtonsoftJsonSerializerOptions>>();
@ -33,5 +45,12 @@ public class AbpWorkflowElsaModule : AbpModule
builder.Configure(options); builder.Configure(options);
}); });
context.Services.AddSingleton<IIdGenerator, AbpElsaIdGenerator>();
Configure<AbpLocalizationOptions>(options =>
{
options.Resources.Add<ElsaResource>();
});
} }
} }

2
aspnet-core/modules/workflow/LINGYUN.Abp.Workflow.Elsa/LINGYUN/Abp/Workflow/Elsa/AbpTenantAccessor.cs → aspnet-core/modules/elsa/LINGYUN.Abp.Elsa/LINGYUN/Abp/Elsa/AbpTenantAccessor.cs

@ -3,7 +3,7 @@ using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Volo.Abp.MultiTenancy; using Volo.Abp.MultiTenancy;
namespace LINGYUN.Abp.Workflow.Elsa; namespace LINGYUN.Abp.Elsa;
public class AbpTenantAccessor : ITenantAccessor public class AbpTenantAccessor : ITenantAccessor
{ {

8
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa/LINGYUN/Abp/Elsa/Localization/ElsaResource.cs

@ -0,0 +1,8 @@
using Volo.Abp.Localization;
namespace LINGYUN.Abp.Elsa.Localization;
[LocalizationResourceName("Elsa")]
public class ElsaResource
{
}

19
aspnet-core/modules/workflow/LINGYUN.Abp.Workflow.Elsa.Server/LINGYUN.Abp.Workflow.Elsa.Server.csproj

@ -1,19 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\configureawait.props" />
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Elsa.Server.Api" Version="2.8.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.Workflow.Elsa\LINGYUN.Abp.Workflow.Elsa.csproj" />
</ItemGroup>
</Project>

13
aspnet-core/modules/workflow/LINGYUN.Abp.Workflow.Elsa.Server/LINGYUN/Abp/Workflow/Elsa/AbpWorkflowElsaServerModule.cs

@ -1,13 +0,0 @@
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Modularity;
namespace LINGYUN.Abp.Workflow.Elsa;
[DependsOn(typeof(AbpWorkflowElsaModule))]
public class AbpWorkflowElsaServerModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddElsaApiEndpoints();
}
}

15
aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/LY.MicroService.WorkflowManagement.HttpApi.Host.csproj

@ -7,9 +7,14 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="AgileConfig.Client" Version="$(AgileConfigClientPackageVersion)" /> <PackageReference Include="AgileConfig.Client" Version="$(AgileConfigClientPackageVersion)" />
<PackageReference Include="Elsa.Activities.Http" Version="2.8.2" /> <PackageReference Include="Elsa.Activities.Email" Version="$(ElsaPackageVersion)" />
<PackageReference Include="Elsa.Activities.Temporal.Quartz" Version="2.8.2" /> <PackageReference Include="Elsa.Activities.Http" Version="$(ElsaPackageVersion)" />
<PackageReference Include="Elsa.Persistence.EntityFramework.MySql" Version="2.8.2" /> <PackageReference Include="Elsa.Activities.UserTask" Version="$(ElsaPackageVersion)" />
<PackageReference Include="Elsa.Activities.Temporal.Quartz" Version="$(ElsaPackageVersion)" />
<!--<PackageReference Include="Elsa.Persistence.EntityFramework.MySql" Version="$(ElsaPackageVersion)" />
<PackageReference Include="Elsa.Webhooks.Persistence.EntityFramework.MySql" Version="$(ElsaPackageVersion)" />
<PackageReference Include="Elsa.WorkflowSettings.Persistence.EntityFramework.MySql" Version="$(ElsaPackageVersion)" />-->
<PackageReference Include="Elsa.Designer.Components.Web" Version="$(ElsaPackageVersion)" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="$(MicrosoftPackageVersion)"> <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="$(MicrosoftPackageVersion)">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
@ -40,6 +45,8 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\modules\common\LINGYUN.Abp.Data.DbMigrator\LINGYUN.Abp.Data.DbMigrator.csproj" /> <ProjectReference Include="..\..\modules\common\LINGYUN.Abp.Data.DbMigrator\LINGYUN.Abp.Data.DbMigrator.csproj" />
<ProjectReference Include="..\..\modules\common\LINGYUN.Abp.ExceptionHandling.Emailing\LINGYUN.Abp.ExceptionHandling.Emailing.csproj" /> <ProjectReference Include="..\..\modules\common\LINGYUN.Abp.ExceptionHandling.Emailing\LINGYUN.Abp.ExceptionHandling.Emailing.csproj" />
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.Elsa.Server\LINGYUN.Abp.Elsa.Server.csproj" />
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.Elsa\LINGYUN.Abp.Elsa.csproj" />
<ProjectReference Include="..\..\modules\saas\LINGYUN.Abp.Saas.EntityFrameworkCore\LINGYUN.Abp.Saas.EntityFrameworkCore.csproj" /> <ProjectReference Include="..\..\modules\saas\LINGYUN.Abp.Saas.EntityFrameworkCore\LINGYUN.Abp.Saas.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\auditing\LINGYUN.Abp.AuditLogging.Elasticsearch\LINGYUN.Abp.AuditLogging.Elasticsearch.csproj" /> <ProjectReference Include="..\..\modules\auditing\LINGYUN.Abp.AuditLogging.Elasticsearch\LINGYUN.Abp.AuditLogging.Elasticsearch.csproj" />
<ProjectReference Include="..\..\modules\logging\LINGYUN.Abp.Serilog.Enrichers.Application\LINGYUN.Abp.Serilog.Enrichers.Application.csproj" /> <ProjectReference Include="..\..\modules\logging\LINGYUN.Abp.Serilog.Enrichers.Application\LINGYUN.Abp.Serilog.Enrichers.Application.csproj" />
@ -48,8 +55,6 @@
<ProjectReference Include="..\..\modules\localization\LINGYUN.Abp.AspNetCore.Mvc.Localization\LINGYUN.Abp.AspNetCore.Mvc.Localization.csproj" /> <ProjectReference Include="..\..\modules\localization\LINGYUN.Abp.AspNetCore.Mvc.Localization\LINGYUN.Abp.AspNetCore.Mvc.Localization.csproj" />
<ProjectReference Include="..\..\modules\localization\LINGYUN.Abp.Localization.CultureMap\LINGYUN.Abp.Localization.CultureMap.csproj" /> <ProjectReference Include="..\..\modules\localization\LINGYUN.Abp.Localization.CultureMap\LINGYUN.Abp.Localization.CultureMap.csproj" />
<ProjectReference Include="..\..\modules\oss-management\LINGYUN.Abp.BlobStoring.OssManagement\LINGYUN.Abp.BlobStoring.OssManagement.csproj" /> <ProjectReference Include="..\..\modules\oss-management\LINGYUN.Abp.BlobStoring.OssManagement\LINGYUN.Abp.BlobStoring.OssManagement.csproj" />
<ProjectReference Include="..\..\modules\workflow\LINGYUN.Abp.Workflow.Elsa.Server\LINGYUN.Abp.Workflow.Elsa.Server.csproj" />
<ProjectReference Include="..\..\modules\workflow\LINGYUN.Abp.Workflow.Elsa\LINGYUN.Abp.Workflow.Elsa.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>

23
aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/Pages/_Host.cshtml

@ -0,0 +1,23 @@
@page "/"
@{
var serverUrl = $"{Request.Scheme}://{Request.Host}";
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Elsa Workflows</title>
<link rel="icon" type="image/png" sizes="32x32" href="/_content/Elsa.Designer.Components.Web/elsa-workflows-studio/assets/images/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/_content/Elsa.Designer.Components.Web/elsa-workflows-studio/assets/images/favicon-16x16.png">
<link rel="stylesheet" href="/_content/Elsa.Designer.Components.Web/elsa-workflows-studio/assets/fonts/inter/inter.css">
<link rel="stylesheet" href="/_content/Elsa.Designer.Components.Web/elsa-workflows-studio/elsa-workflows-studio.css">
<script src="/_content/Elsa.Designer.Components.Web/monaco-editor/min/vs/loader.js"></script>
<script type="module" src="/_content/Elsa.Designer.Components.Web/elsa-workflows-studio/elsa-workflows-studio.esm.js"></script>
</head>
<body>
<elsa-studio-root server-url="@serverUrl" monaco-lib-path="_content/Elsa.Designer.Components.Web/monaco-editor/min">
<elsa-studio-dashboard></elsa-studio-dashboard>
</elsa-studio-root>
</body>
</html>

43
aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/WorkflowManagementHttpApiHostModule.Configure.cs

@ -1,7 +1,6 @@
using Elsa; using Elsa;
using Elsa.Activities.UserTask.Extensions;
using Elsa.Options; using Elsa.Options;
using Elsa.Persistence.EntityFramework.Core.Extensions;
using Elsa.Persistence.EntityFramework.MySql;
using LINGYUN.Abp.BlobStoring.OssManagement; using LINGYUN.Abp.BlobStoring.OssManagement;
using LINGYUN.Abp.ExceptionHandling; using LINGYUN.Abp.ExceptionHandling;
using LINGYUN.Abp.ExceptionHandling.Emailing; using LINGYUN.Abp.ExceptionHandling.Emailing;
@ -10,7 +9,9 @@ using LINGYUN.Abp.Serilog.Enrichers.Application;
using Medallion.Threading; using Medallion.Threading;
using Medallion.Threading.Redis; using Medallion.Threading.Redis;
using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.DataProtection; using Microsoft.AspNetCore.DataProtection;
using Microsoft.AspNetCore.Routing;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Caching.StackExchangeRedis; using Microsoft.Extensions.Caching.StackExchangeRedis;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
@ -52,8 +53,10 @@ public partial class WorkflowManagementHttpApiHostModule
AbpSerilogEnrichersConsts.ApplicationName = "WorkflowManagement"; AbpSerilogEnrichersConsts.ApplicationName = "WorkflowManagement";
} }
private void PreConfigureElsa(IConfiguration configuration) private void PreConfigureElsa(IServiceCollection services, IConfiguration configuration)
{ {
var elsaSection = configuration.GetSection("Elsa");
PreConfigure<ElsaOptionsBuilder>(builder => PreConfigure<ElsaOptionsBuilder>(builder =>
{ {
// TODO: 取消注释持久化 // TODO: 取消注释持久化
@ -61,7 +64,34 @@ public partial class WorkflowManagementHttpApiHostModule
//builder.UseEntityFrameworkPersistence(ef => //builder.UseEntityFrameworkPersistence(ef =>
// ef.UseMySql(connectionString)); // ef.UseMySql(connectionString));
builder.AddQuartzTemporalActivities() builder.AddQuartzTemporalActivities()
.AddJavaScriptActivities(); .AddEmailActivities()
.AddUserTaskActivities()
.AddHttpActivities(elsaSection.GetSection("Server").Bind)
.AddWorkflowsFrom<WorkflowManagementHttpApiHostModule>();
//.AddWorkflowSettings()
//.AddWebhooks(options =>
//{
// options.UseEntityFrameworkPersistence(db =>
// {
// db.UseMySql(configuration.GetConnectionString("Workflow"));
// });
//})
//.UseEntityFrameworkPersistence(db =>
//{
// db.UseMySql(configuration.GetConnectionString("Workflow"));
//});
});
}
private void ConfigureEndpoints()
{
Configure<AbpEndpointRouterOptions>(options =>
{
options.EndpointConfigureActions.Add(
(context) =>
{
context.Endpoints.MapFallbackToPage("/_Host");
});
}); });
} }
@ -272,6 +302,11 @@ public partial class WorkflowManagementHttpApiHostModule
options.Audience = configuration["AuthServer:ApiName"]; options.Audience = configuration["AuthServer:ApiName"];
}); });
if (isDevelopment)
{
services.AddAlwaysAllowAuthorization();
}
if (!isDevelopment) if (!isDevelopment)
{ {
var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]); var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]);

13
aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/WorkflowManagementHttpApiHostModule.cs

@ -8,7 +8,7 @@ using LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore;
using LINGYUN.Abp.Saas.EntityFrameworkCore; using LINGYUN.Abp.Saas.EntityFrameworkCore;
using LINGYUN.Abp.Serilog.Enrichers.Application; using LINGYUN.Abp.Serilog.Enrichers.Application;
using LINGYUN.Abp.Serilog.Enrichers.UniqueId; using LINGYUN.Abp.Serilog.Enrichers.UniqueId;
using LINGYUN.Abp.Workflow.Elsa; using LINGYUN.Abp.Elsa;
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
@ -36,8 +36,8 @@ namespace LY.MicroService.WorkflowManagement;
typeof(AbpAuditLoggingElasticsearchModule), typeof(AbpAuditLoggingElasticsearchModule),
typeof(AbpAspNetCoreSerilogModule), typeof(AbpAspNetCoreSerilogModule),
typeof(AbpBlobStoringOssManagementModule), typeof(AbpBlobStoringOssManagementModule),
typeof(AbpWorkflowElsaModule), typeof(AbpElsaModule),
typeof(AbpWorkflowElsaServerModule), typeof(AbpElsaServerModule),
//typeof(WorkflowManagementApplicationModule), //typeof(WorkflowManagementApplicationModule),
//typeof(WorkflowManagementHttpApiModule), //typeof(WorkflowManagementHttpApiModule),
//typeof(WorkflowManagementEntityFrameworkCoreModule), //typeof(WorkflowManagementEntityFrameworkCoreModule),
@ -72,7 +72,7 @@ public partial class WorkflowManagementHttpApiHostModule : AbpModule
PreConfigureApp(); PreConfigureApp();
PreConfigureFeature(); PreConfigureFeature();
PreConfigureElsa(configuration); PreConfigureElsa(context.Services, configuration);
} }
public override void ConfigureServices(ServiceConfigurationContext context) public override void ConfigureServices(ServiceConfigurationContext context)
@ -81,6 +81,7 @@ public partial class WorkflowManagementHttpApiHostModule : AbpModule
var configuration = context.Services.GetConfiguration(); var configuration = context.Services.GetConfiguration();
ConfigureDbContext(); ConfigureDbContext();
ConfigureEndpoints();
ConfigureLocalization(); ConfigureLocalization();
ConfigureJsonSerializer(); ConfigureJsonSerializer();
ConfigureExceptionHandling(); ConfigureExceptionHandling();
@ -94,8 +95,7 @@ public partial class WorkflowManagementHttpApiHostModule : AbpModule
ConfigureSeedWorker(context.Services, hostingEnvironment.IsDevelopment()); ConfigureSeedWorker(context.Services, hostingEnvironment.IsDevelopment());
ConfigureSecurity(context.Services, configuration, hostingEnvironment.IsDevelopment()); ConfigureSecurity(context.Services, configuration, hostingEnvironment.IsDevelopment());
// 开发取消权限检查 context.Services.AddRazorPages();
// context.Services.AddAlwaysAllowAuthorization();
} }
public override void OnApplicationInitialization(ApplicationInitializationContext context) public override void OnApplicationInitialization(ApplicationInitializationContext context)
@ -104,6 +104,7 @@ public partial class WorkflowManagementHttpApiHostModule : AbpModule
var env = context.GetEnvironment(); var env = context.GetEnvironment();
app.UseStaticFiles(); app.UseStaticFiles();
app.UseHttpActivities();
app.UseCorrelationId(); app.UseCorrelationId();
app.UseRouting(); app.UseRouting();
app.UseCors(); app.UseCors();

7
aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/appsettings.Development.json

@ -12,7 +12,7 @@
}, },
"ConnectionStrings": { "ConnectionStrings": {
"Default": "Server=127.0.0.1;Database=Workflow;User Id=root;Password=123456", "Default": "Server=127.0.0.1;Database=Workflow;User Id=root;Password=123456",
"Workflow": "Server=127.0.0.1;Database=Elsa;User Id=root;Password=123456", "Workflow": "Server=127.0.0.1;Database=Workflow;User Id=root;Password=123456",
"WorkflowManagement": "Server=127.0.0.1;Database=Workflow;User Id=root;Password=123456", "WorkflowManagement": "Server=127.0.0.1;Database=Workflow;User Id=root;Password=123456",
"AbpWorkflowCore": "Server=127.0.0.1;Database=Workflow;User Id=root;Password=123456", "AbpWorkflowCore": "Server=127.0.0.1;Database=Workflow;User Id=root;Password=123456",
"AbpFeatureManagement": "Server=127.0.0.1;Database=Platform;User Id=root;Password=123456", "AbpFeatureManagement": "Server=127.0.0.1;Database=Platform;User Id=root;Password=123456",
@ -21,6 +21,11 @@
"AbpSettingManagement": "Server=127.0.0.1;Database=Platform;User Id=root;Password=123456", "AbpSettingManagement": "Server=127.0.0.1;Database=Platform;User Id=root;Password=123456",
"AbpSaas": "Server=127.0.0.1;Database=Platform;User Id=root;Password=123456" "AbpSaas": "Server=127.0.0.1;Database=Platform;User Id=root;Password=123456"
}, },
"Elsa": {
"Server": {
"BaseUrl": "http://localhost:5001"
}
},
"RemoteServices": { "RemoteServices": {
"AbpOssManagement": { "AbpOssManagement": {
"BaseUrl": "http://127.0.0.1:30025", "BaseUrl": "http://127.0.0.1:30025",

Loading…
Cancel
Save