diff --git a/src/Portal.Backend.sln b/src/Portal.Backend.sln
index f360dbefdf..06f2d7a62e 100644
--- a/src/Portal.Backend.sln
+++ b/src/Portal.Backend.sln
@@ -122,8 +122,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApplicationActivation.Libra
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApplicationChecklist.Config", "processes\ApplicationChecklist.Config\ApplicationChecklist.Config.csproj", "{C3E5E7C8-69D3-4ECB-A4FA-53A9A780EFF0}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Processes.Worker.Library", "processes\Processes.Worker.Library\Processes.Worker.Library.csproj", "{527A4A82-D63A-4DD5-B37D-0AC8A79F1B0E}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApplicationChecklist.Executor", "processes\ApplicationChecklist.Executor\ApplicationChecklist.Executor.csproj", "{0221E83B-B26B-442F-ACAD-B1043DF9993A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Processes.Worker.Library.Tests", "..\tests\processes\Processes.Worker.Library.Tests\Processes.Worker.Library.Tests.csproj", "{B787DF92-23F7-410A-B592-95701E4B423D}"
@@ -140,9 +138,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OfferSubscription.Executor.
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OfferSubscription.Library.Tests", "..\tests\processes\OfferSubscription.Library.Tests\OfferSubscription.Library.Tests.csproj", "{C356AA93-5BEE-44CD-A905-EFD325ED7578}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OfferProvider.Library", "..\tests\externalsystems\OfferProvider.Library\OfferProvider.Library.csproj", "{CC063A63-8282-4293-9A0E-2598ADCA747B}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Processes.Library", "processes\Processes.Library\Processes.Library.csproj", "{58D5C0B4-3C5C-4BE4-82EA-4CB9940943B1}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OfferProvider.Library.Tests", "..\tests\externalsystems\OfferProvider.Library.Tests\OfferProvider.Library.Tests.csproj", "{CC063A63-8282-4293-9A0E-2598ADCA747B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Processes.Library.Tests", "..\tests\processes\Processes.Library.Tests\Processes.Library.Tests.csproj", "{5E80DEEA-B254-425C-8220-27EEF47C10BD}"
EndProject
@@ -286,6 +282,14 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SelfDescriptionCreation.Exe
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SelfDescriptionCreation.Executor.Tests", "..\tests\processes\SelfDescriptionCreation.Executor.Tests\SelfDescriptionCreation.Executor.Tests.csproj", "{AA14B842-6A65-40BB-818A-D450F66F4101}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Framework.Identity", "framework\Framework.Identity\Framework.Identity.csproj", "{6ED01D72-BE48-45A6-A615-BFA83DF99EF4}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Framework.Processes.Library", "framework\Framework.Processes.Library\Framework.Processes.Library.csproj", "{124683B4-17F3-4E0A-818C-32DB91324ABB}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Framework.Processes.ProcessIdentity", "framework\Framework.Processes.ProcessIdentity\Framework.Processes.ProcessIdentity.csproj", "{96F978B7-71C1-4866-BFB5-8631F4743FA5}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Framework.Processes.Worker.Library", "framework\Framework.Processes.Worker.Library\Framework.Processes.Worker.Library.csproj", "{BD0268EB-65A9-4A0A-B724-214A6D2591B5}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -872,18 +876,6 @@ Global
{C3E5E7C8-69D3-4ECB-A4FA-53A9A780EFF0}.Release|x64.Build.0 = Release|Any CPU
{C3E5E7C8-69D3-4ECB-A4FA-53A9A780EFF0}.Release|x86.ActiveCfg = Release|Any CPU
{C3E5E7C8-69D3-4ECB-A4FA-53A9A780EFF0}.Release|x86.Build.0 = Release|Any CPU
- {527A4A82-D63A-4DD5-B37D-0AC8A79F1B0E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {527A4A82-D63A-4DD5-B37D-0AC8A79F1B0E}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {527A4A82-D63A-4DD5-B37D-0AC8A79F1B0E}.Debug|x64.ActiveCfg = Debug|Any CPU
- {527A4A82-D63A-4DD5-B37D-0AC8A79F1B0E}.Debug|x64.Build.0 = Debug|Any CPU
- {527A4A82-D63A-4DD5-B37D-0AC8A79F1B0E}.Debug|x86.ActiveCfg = Debug|Any CPU
- {527A4A82-D63A-4DD5-B37D-0AC8A79F1B0E}.Debug|x86.Build.0 = Debug|Any CPU
- {527A4A82-D63A-4DD5-B37D-0AC8A79F1B0E}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {527A4A82-D63A-4DD5-B37D-0AC8A79F1B0E}.Release|Any CPU.Build.0 = Release|Any CPU
- {527A4A82-D63A-4DD5-B37D-0AC8A79F1B0E}.Release|x64.ActiveCfg = Release|Any CPU
- {527A4A82-D63A-4DD5-B37D-0AC8A79F1B0E}.Release|x64.Build.0 = Release|Any CPU
- {527A4A82-D63A-4DD5-B37D-0AC8A79F1B0E}.Release|x86.ActiveCfg = Release|Any CPU
- {527A4A82-D63A-4DD5-B37D-0AC8A79F1B0E}.Release|x86.Build.0 = Release|Any CPU
{0221E83B-B26B-442F-ACAD-B1043DF9993A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0221E83B-B26B-442F-ACAD-B1043DF9993A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0221E83B-B26B-442F-ACAD-B1043DF9993A}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -992,18 +984,6 @@ Global
{CC063A63-8282-4293-9A0E-2598ADCA747B}.Release|x64.Build.0 = Release|Any CPU
{CC063A63-8282-4293-9A0E-2598ADCA747B}.Release|x86.ActiveCfg = Release|Any CPU
{CC063A63-8282-4293-9A0E-2598ADCA747B}.Release|x86.Build.0 = Release|Any CPU
- {58D5C0B4-3C5C-4BE4-82EA-4CB9940943B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {58D5C0B4-3C5C-4BE4-82EA-4CB9940943B1}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {58D5C0B4-3C5C-4BE4-82EA-4CB9940943B1}.Debug|x64.ActiveCfg = Debug|Any CPU
- {58D5C0B4-3C5C-4BE4-82EA-4CB9940943B1}.Debug|x64.Build.0 = Debug|Any CPU
- {58D5C0B4-3C5C-4BE4-82EA-4CB9940943B1}.Debug|x86.ActiveCfg = Debug|Any CPU
- {58D5C0B4-3C5C-4BE4-82EA-4CB9940943B1}.Debug|x86.Build.0 = Debug|Any CPU
- {58D5C0B4-3C5C-4BE4-82EA-4CB9940943B1}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {58D5C0B4-3C5C-4BE4-82EA-4CB9940943B1}.Release|Any CPU.Build.0 = Release|Any CPU
- {58D5C0B4-3C5C-4BE4-82EA-4CB9940943B1}.Release|x64.ActiveCfg = Release|Any CPU
- {58D5C0B4-3C5C-4BE4-82EA-4CB9940943B1}.Release|x64.Build.0 = Release|Any CPU
- {58D5C0B4-3C5C-4BE4-82EA-4CB9940943B1}.Release|x86.ActiveCfg = Release|Any CPU
- {58D5C0B4-3C5C-4BE4-82EA-4CB9940943B1}.Release|x86.Build.0 = Release|Any CPU
{5E80DEEA-B254-425C-8220-27EEF47C10BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5E80DEEA-B254-425C-8220-27EEF47C10BD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5E80DEEA-B254-425C-8220-27EEF47C10BD}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -1832,6 +1812,54 @@ Global
{AA14B842-6A65-40BB-818A-D450F66F4101}.Release|x64.Build.0 = Release|Any CPU
{AA14B842-6A65-40BB-818A-D450F66F4101}.Release|x86.ActiveCfg = Release|Any CPU
{AA14B842-6A65-40BB-818A-D450F66F4101}.Release|x86.Build.0 = Release|Any CPU
+ {6ED01D72-BE48-45A6-A615-BFA83DF99EF4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {6ED01D72-BE48-45A6-A615-BFA83DF99EF4}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {6ED01D72-BE48-45A6-A615-BFA83DF99EF4}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {6ED01D72-BE48-45A6-A615-BFA83DF99EF4}.Debug|x64.Build.0 = Debug|Any CPU
+ {6ED01D72-BE48-45A6-A615-BFA83DF99EF4}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {6ED01D72-BE48-45A6-A615-BFA83DF99EF4}.Debug|x86.Build.0 = Debug|Any CPU
+ {6ED01D72-BE48-45A6-A615-BFA83DF99EF4}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {6ED01D72-BE48-45A6-A615-BFA83DF99EF4}.Release|Any CPU.Build.0 = Release|Any CPU
+ {6ED01D72-BE48-45A6-A615-BFA83DF99EF4}.Release|x64.ActiveCfg = Release|Any CPU
+ {6ED01D72-BE48-45A6-A615-BFA83DF99EF4}.Release|x64.Build.0 = Release|Any CPU
+ {6ED01D72-BE48-45A6-A615-BFA83DF99EF4}.Release|x86.ActiveCfg = Release|Any CPU
+ {6ED01D72-BE48-45A6-A615-BFA83DF99EF4}.Release|x86.Build.0 = Release|Any CPU
+ {124683B4-17F3-4E0A-818C-32DB91324ABB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {124683B4-17F3-4E0A-818C-32DB91324ABB}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {124683B4-17F3-4E0A-818C-32DB91324ABB}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {124683B4-17F3-4E0A-818C-32DB91324ABB}.Debug|x64.Build.0 = Debug|Any CPU
+ {124683B4-17F3-4E0A-818C-32DB91324ABB}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {124683B4-17F3-4E0A-818C-32DB91324ABB}.Debug|x86.Build.0 = Debug|Any CPU
+ {124683B4-17F3-4E0A-818C-32DB91324ABB}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {124683B4-17F3-4E0A-818C-32DB91324ABB}.Release|Any CPU.Build.0 = Release|Any CPU
+ {124683B4-17F3-4E0A-818C-32DB91324ABB}.Release|x64.ActiveCfg = Release|Any CPU
+ {124683B4-17F3-4E0A-818C-32DB91324ABB}.Release|x64.Build.0 = Release|Any CPU
+ {124683B4-17F3-4E0A-818C-32DB91324ABB}.Release|x86.ActiveCfg = Release|Any CPU
+ {124683B4-17F3-4E0A-818C-32DB91324ABB}.Release|x86.Build.0 = Release|Any CPU
+ {96F978B7-71C1-4866-BFB5-8631F4743FA5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {96F978B7-71C1-4866-BFB5-8631F4743FA5}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {96F978B7-71C1-4866-BFB5-8631F4743FA5}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {96F978B7-71C1-4866-BFB5-8631F4743FA5}.Debug|x64.Build.0 = Debug|Any CPU
+ {96F978B7-71C1-4866-BFB5-8631F4743FA5}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {96F978B7-71C1-4866-BFB5-8631F4743FA5}.Debug|x86.Build.0 = Debug|Any CPU
+ {96F978B7-71C1-4866-BFB5-8631F4743FA5}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {96F978B7-71C1-4866-BFB5-8631F4743FA5}.Release|Any CPU.Build.0 = Release|Any CPU
+ {96F978B7-71C1-4866-BFB5-8631F4743FA5}.Release|x64.ActiveCfg = Release|Any CPU
+ {96F978B7-71C1-4866-BFB5-8631F4743FA5}.Release|x64.Build.0 = Release|Any CPU
+ {96F978B7-71C1-4866-BFB5-8631F4743FA5}.Release|x86.ActiveCfg = Release|Any CPU
+ {96F978B7-71C1-4866-BFB5-8631F4743FA5}.Release|x86.Build.0 = Release|Any CPU
+ {BD0268EB-65A9-4A0A-B724-214A6D2591B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {BD0268EB-65A9-4A0A-B724-214A6D2591B5}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {BD0268EB-65A9-4A0A-B724-214A6D2591B5}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {BD0268EB-65A9-4A0A-B724-214A6D2591B5}.Debug|x64.Build.0 = Debug|Any CPU
+ {BD0268EB-65A9-4A0A-B724-214A6D2591B5}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {BD0268EB-65A9-4A0A-B724-214A6D2591B5}.Debug|x86.Build.0 = Debug|Any CPU
+ {BD0268EB-65A9-4A0A-B724-214A6D2591B5}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {BD0268EB-65A9-4A0A-B724-214A6D2591B5}.Release|Any CPU.Build.0 = Release|Any CPU
+ {BD0268EB-65A9-4A0A-B724-214A6D2591B5}.Release|x64.ActiveCfg = Release|Any CPU
+ {BD0268EB-65A9-4A0A-B724-214A6D2591B5}.Release|x64.Build.0 = Release|Any CPU
+ {BD0268EB-65A9-4A0A-B724-214A6D2591B5}.Release|x86.ActiveCfg = Release|Any CPU
+ {BD0268EB-65A9-4A0A-B724-214A6D2591B5}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -1894,7 +1922,6 @@ Global
{0BFA8C5B-3F15-4381-9621-AD7A3EC0315F} = {AB9C5AA2-DD5D-4A38-97C0-674A995C0AE0}
{96D96CA7-35C0-40C6-A8C8-91E0C4456660} = {323C198D-A8C6-4EB0-8B79-72624275E35F}
{C3E5E7C8-69D3-4ECB-A4FA-53A9A780EFF0} = {282CEF03-292F-4A49-83C6-997567D0FF5F}
- {527A4A82-D63A-4DD5-B37D-0AC8A79F1B0E} = {282CEF03-292F-4A49-83C6-997567D0FF5F}
{0221E83B-B26B-442F-ACAD-B1043DF9993A} = {282CEF03-292F-4A49-83C6-997567D0FF5F}
{4C7E9EAC-222B-4C13-B8B1-5987406817A0} = {282CEF03-292F-4A49-83C6-997567D0FF5F}
{7985B208-CE41-49DA-B749-B94B582612E6} = {323C198D-A8C6-4EB0-8B79-72624275E35F}
@@ -1903,7 +1930,6 @@ Global
{B682C5B9-AFAB-474D-95AD-B86099FC5EC7} = {323C198D-A8C6-4EB0-8B79-72624275E35F}
{C356AA93-5BEE-44CD-A905-EFD325ED7578} = {323C198D-A8C6-4EB0-8B79-72624275E35F}
{CC063A63-8282-4293-9A0E-2598ADCA747B} = {323C198D-A8C6-4EB0-8B79-72624275E35F}
- {58D5C0B4-3C5C-4BE4-82EA-4CB9940943B1} = {282CEF03-292F-4A49-83C6-997567D0FF5F}
{EC493B36-9E14-4CAF-973F-FB96FDAF546F} = {A878BDF1-6DB6-4BA5-A724-92885A710856}
{1694E75F-ABCE-4573-B805-18ED50F148FD} = {323C198D-A8C6-4EB0-8B79-72624275E35F}
{E1D41A07-F468-4D13-8185-35F127230B17} = {46383371-8252-4598-9350-A97692851408}
@@ -1968,5 +1994,9 @@ Global
{E5494227-BDFE-41F2-A12F-54292D76C29F} = {282CEF03-292F-4A49-83C6-997567D0FF5F}
{D8EBE555-F103-4D05-9697-5381E4DE1DFE} = {282CEF03-292F-4A49-83C6-997567D0FF5F}
{AA14B842-6A65-40BB-818A-D450F66F4101} = {323C198D-A8C6-4EB0-8B79-72624275E35F}
+ {6ED01D72-BE48-45A6-A615-BFA83DF99EF4} = {B42CFF96-B8DB-48A6-A9CA-72BFB5F0117B}
+ {124683B4-17F3-4E0A-818C-32DB91324ABB} = {B42CFF96-B8DB-48A6-A9CA-72BFB5F0117B}
+ {96F978B7-71C1-4866-BFB5-8631F4743FA5} = {B42CFF96-B8DB-48A6-A9CA-72BFB5F0117B}
+ {BD0268EB-65A9-4A0A-B724-214A6D2591B5} = {B42CFF96-B8DB-48A6-A9CA-72BFB5F0117B}
EndGlobalSection
EndGlobal
diff --git a/src/administration/Administration.Service/Administration.Service.csproj b/src/administration/Administration.Service/Administration.Service.csproj
index d2cbb469cd..0e90e98ec5 100644
--- a/src/administration/Administration.Service/Administration.Service.csproj
+++ b/src/administration/Administration.Service/Administration.Service.csproj
@@ -52,8 +52,10 @@
+
+
diff --git a/src/administration/Administration.Service/BusinessLogic/CompanyDataBusinessLogic.cs b/src/administration/Administration.Service/BusinessLogic/CompanyDataBusinessLogic.cs
index bcb6704edc..ed4be03605 100644
--- a/src/administration/Administration.Service/BusinessLogic/CompanyDataBusinessLogic.cs
+++ b/src/administration/Administration.Service/BusinessLogic/CompanyDataBusinessLogic.cs
@@ -22,8 +22,12 @@
using Org.Eclipse.TractusX.Portal.Backend.Framework.Async;
using Org.Eclipse.TractusX.Portal.Backend.Framework.DateTimeProvider;
using Org.Eclipse.TractusX.Portal.Backend.Framework.ErrorHandling;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Identity;
using Org.Eclipse.TractusX.Portal.Backend.Framework.Linq;
using Org.Eclipse.TractusX.Portal.Backend.Framework.Models;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Context;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Enums;
using Org.Eclipse.TractusX.Portal.Backend.Framework.Web;
using Org.Eclipse.TractusX.Portal.Backend.IssuerComponent.Library.BusinessLogic;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess;
@@ -31,8 +35,6 @@
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Models;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Repositories;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Enums;
-using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Identities;
-using Org.Eclipse.TractusX.Portal.Backend.Processes.Library;
using System.Text.RegularExpressions;
namespace Org.Eclipse.TractusX.Portal.Backend.Administration.Service.BusinessLogic;
@@ -444,7 +446,7 @@ public async Task DeleteCompanyCertificateAsync(Guid documentId)
public async Task TriggerSelfDescriptionCreation()
{
var companiesWithMissingSd = portalRepositories.GetInstance().GetCompanyIdsWithMissingSelfDescription();
- var processStepRepository = portalRepositories.GetInstance();
+ var processStepRepository = portalRepositories.GetInstance>();
var companyRepository = portalRepositories.GetInstance();
await foreach (var companyId in companiesWithMissingSd)
{
@@ -460,7 +462,7 @@ public async Task RetriggerSelfDescriptionCreation(Guid processId)
{
const ProcessStepTypeId NextStep = ProcessStepTypeId.SELF_DESCRIPTION_COMPANY_CREATION;
const ProcessStepTypeId StepToTrigger = ProcessStepTypeId.RETRIGGER_SELF_DESCRIPTION_COMPANY_CREATION;
- var (validProcessId, processData) = await portalRepositories.GetInstance().IsValidProcess(processId, ProcessTypeId.SELF_DESCRIPTION_CREATION, Enumerable.Repeat(StepToTrigger, 1)).ConfigureAwait(ConfigureAwaitOptions.None);
+ var (validProcessId, processData) = await portalRepositories.GetInstance>().IsValidProcess(processId, ProcessTypeId.SELF_DESCRIPTION_CREATION, Enumerable.Repeat(StepToTrigger, 1)).ConfigureAwait(ConfigureAwaitOptions.None);
if (!validProcessId)
{
throw new NotFoundException($"process {processId} does not exist");
diff --git a/src/administration/Administration.Service/BusinessLogic/ConnectorsBusinessLogic.cs b/src/administration/Administration.Service/BusinessLogic/ConnectorsBusinessLogic.cs
index 9918e87408..d6fbde111f 100644
--- a/src/administration/Administration.Service/BusinessLogic/ConnectorsBusinessLogic.cs
+++ b/src/administration/Administration.Service/BusinessLogic/ConnectorsBusinessLogic.cs
@@ -22,15 +22,17 @@
using Org.Eclipse.TractusX.Portal.Backend.Administration.Service.Models;
using Org.Eclipse.TractusX.Portal.Backend.Framework.Async;
using Org.Eclipse.TractusX.Portal.Backend.Framework.ErrorHandling;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Identity;
using Org.Eclipse.TractusX.Portal.Backend.Framework.IO;
using Org.Eclipse.TractusX.Portal.Backend.Framework.Linq;
using Org.Eclipse.TractusX.Portal.Backend.Framework.Models;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Context;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Enums;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Models;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Repositories;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Enums;
-using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Identities;
-using Org.Eclipse.TractusX.Portal.Backend.Processes.Library;
using Org.Eclipse.TractusX.Portal.Backend.SdFactory.Library.BusinessLogic;
using Org.Eclipse.TractusX.Portal.Backend.SdFactory.Library.Models;
using System.Text.RegularExpressions;
@@ -451,7 +453,7 @@ public IAsyncEnumerable GetConnectorOfferSubscri
public async Task TriggerSelfDescriptionCreation()
{
var connectorRepository = portalRepositories.GetInstance();
- var processStepRepository = portalRepositories.GetInstance();
+ var processStepRepository = portalRepositories.GetInstance>();
var connectorIds = connectorRepository.GetConnectorIdsWithMissingSelfDescription();
await foreach (var connectorId in connectorIds)
{
@@ -467,7 +469,7 @@ public async Task RetriggerSelfDescriptionCreation(Guid processId)
{
const ProcessStepTypeId NextStep = ProcessStepTypeId.SELF_DESCRIPTION_CONNECTOR_CREATION;
const ProcessStepTypeId StepToTrigger = ProcessStepTypeId.RETRIGGER_SELF_DESCRIPTION_CONNECTOR_CREATION;
- var (validProcessId, processData) = await portalRepositories.GetInstance().IsValidProcess(processId, ProcessTypeId.SELF_DESCRIPTION_CREATION, Enumerable.Repeat(StepToTrigger, 1)).ConfigureAwait(ConfigureAwaitOptions.None);
+ var (validProcessId, processData) = await portalRepositories.GetInstance>().IsValidProcess(processId, ProcessTypeId.SELF_DESCRIPTION_CREATION, Enumerable.Repeat(StepToTrigger, 1)).ConfigureAwait(ConfigureAwaitOptions.None);
if (!validProcessId)
{
throw new NotFoundException($"process {processId} does not exist");
diff --git a/src/administration/Administration.Service/BusinessLogic/DocumentsBusinessLogic.cs b/src/administration/Administration.Service/BusinessLogic/DocumentsBusinessLogic.cs
index 4ad378747f..8f637ba8eb 100644
--- a/src/administration/Administration.Service/BusinessLogic/DocumentsBusinessLogic.cs
+++ b/src/administration/Administration.Service/BusinessLogic/DocumentsBusinessLogic.cs
@@ -19,13 +19,13 @@
using Microsoft.Extensions.Options;
using Org.Eclipse.TractusX.Portal.Backend.Framework.ErrorHandling;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Identity;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Extensions;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Models;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Repositories;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Entities;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Enums;
-using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Identities;
namespace Org.Eclipse.TractusX.Portal.Backend.Administration.Service.BusinessLogic;
diff --git a/src/administration/Administration.Service/BusinessLogic/IdentityProviderBusinessLogic.cs b/src/administration/Administration.Service/BusinessLogic/IdentityProviderBusinessLogic.cs
index 18a9f38bcf..44837b3c92 100644
--- a/src/administration/Administration.Service/BusinessLogic/IdentityProviderBusinessLogic.cs
+++ b/src/administration/Administration.Service/BusinessLogic/IdentityProviderBusinessLogic.cs
@@ -21,6 +21,7 @@
using Org.Eclipse.TractusX.Portal.Backend.Administration.Service.Models;
using Org.Eclipse.TractusX.Portal.Backend.Framework.ErrorHandling;
using Org.Eclipse.TractusX.Portal.Backend.Framework.ErrorHandling.Service;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Identity;
using Org.Eclipse.TractusX.Portal.Backend.Framework.IO;
using Org.Eclipse.TractusX.Portal.Backend.Framework.Linq;
using Org.Eclipse.TractusX.Portal.Backend.Framework.Models.Configuration;
@@ -29,7 +30,6 @@
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Repositories;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Entities;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Enums;
-using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Identities;
using Org.Eclipse.TractusX.Portal.Backend.Processes.Mailing.Library;
using Org.Eclipse.TractusX.Portal.Backend.Provisioning.Library;
using Org.Eclipse.TractusX.Portal.Backend.Provisioning.Library.Enums;
diff --git a/src/administration/Administration.Service/BusinessLogic/InvitationBusinessLogic.cs b/src/administration/Administration.Service/BusinessLogic/InvitationBusinessLogic.cs
index 9a089bc0d9..ae98ece62e 100644
--- a/src/administration/Administration.Service/BusinessLogic/InvitationBusinessLogic.cs
+++ b/src/administration/Administration.Service/BusinessLogic/InvitationBusinessLogic.cs
@@ -20,10 +20,13 @@
using Org.Eclipse.TractusX.Portal.Backend.Administration.Service.Models;
using Org.Eclipse.TractusX.Portal.Backend.Framework.ErrorHandling;
using Org.Eclipse.TractusX.Portal.Backend.Framework.Models;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Context;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Enums;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Extensions;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Repositories;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Enums;
-using Org.Eclipse.TractusX.Portal.Backend.Processes.Library;
+using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Extensions;
namespace Org.Eclipse.TractusX.Portal.Backend.Administration.Service.BusinessLogic;
@@ -59,7 +62,7 @@ public Task ExecuteInvitation(CompanyInvitationData i
private async Task ExecuteInvitationInternalAsync(CompanyInvitationData invitationData)
{
var (userName, firstName, lastName, email, organisationName) = invitationData;
- var processStepRepository = _portalRepositories.GetInstance();
+ var processStepRepository = _portalRepositories.GetInstance>();
var processId = processStepRepository.CreateProcess(ProcessTypeId.INVITATION).Id;
processStepRepository.CreateProcessStep(ProcessStepTypeId.INVITATION_CREATE_CENTRAL_IDP, ProcessStepStatusId.TODO, processId);
@@ -79,16 +82,16 @@ private async Task ExecuteInvitationInternalAsync(Com
return new CompanyInvitationResponse(applicationId, company.Id);
}
- public Task RetriggerCreateCentralIdp(Guid processId) => ProcessStepTypeId.RETRIGGER_INVITATION_CREATE_CENTRAL_IDP.TriggerProcessStep(processId, _portalRepositories);
- public Task RetriggerCreateSharedIdpServiceAccount(Guid processId) => ProcessStepTypeId.RETRIGGER_INVITATION_CREATE_SHARED_IDP_SERVICE_ACCOUNT.TriggerProcessStep(processId, _portalRepositories);
- public Task RetriggerAddRealmRole(Guid processId) => ProcessStepTypeId.RETRIGGER_INVITATION_ADD_REALM_ROLE.TriggerProcessStep(processId, _portalRepositories);
+ public Task RetriggerCreateCentralIdp(Guid processId) => ProcessStepTypeId.RETRIGGER_INVITATION_CREATE_CENTRAL_IDP.TriggerProcessStep(processId, _portalRepositories, ProcessTypeExtensions.GetProcessStepForRetrigger);
+ public Task RetriggerCreateSharedIdpServiceAccount(Guid processId) => ProcessStepTypeId.RETRIGGER_INVITATION_CREATE_SHARED_IDP_SERVICE_ACCOUNT.TriggerProcessStep(processId, _portalRepositories, ProcessTypeExtensions.GetProcessStepForRetrigger);
+ public Task RetriggerAddRealmRole(Guid processId) => ProcessStepTypeId.RETRIGGER_INVITATION_ADD_REALM_ROLE.TriggerProcessStep(processId, _portalRepositories, ProcessTypeExtensions.GetProcessStepForRetrigger);
- public Task RetriggerInviteSharedClient(Guid processId) => ProcessStepTypeId.RETRIGGER_INVITATION_CREATE_SHARED_CLIENT.TriggerProcessStep(processId, _portalRepositories);
+ public Task RetriggerInviteSharedClient(Guid processId) => ProcessStepTypeId.RETRIGGER_INVITATION_CREATE_SHARED_CLIENT.TriggerProcessStep(processId, _portalRepositories, ProcessTypeExtensions.GetProcessStepForRetrigger);
- public Task RetriggerUpdateCentralIdpUrls(Guid processId) => ProcessStepTypeId.RETRIGGER_INVITATION_UPDATE_CENTRAL_IDP_URLS.TriggerProcessStep(processId, _portalRepositories);
- public Task RetriggerCreateCentralIdpOrgMapper(Guid processId) => ProcessStepTypeId.RETRIGGER_INVITATION_CREATE_CENTRAL_IDP_ORG_MAPPER.TriggerProcessStep(processId, _portalRepositories);
- public Task RetriggerCreateSharedRealmIdpClient(Guid processId) => ProcessStepTypeId.RETRIGGER_INVITATION_CREATE_SHARED_REALM.TriggerProcessStep(processId, _portalRepositories);
- public Task RetriggerEnableCentralIdp(Guid processId) => ProcessStepTypeId.RETRIGGER_INVITATION_ENABLE_CENTRAL_IDP.TriggerProcessStep(processId, _portalRepositories);
- public Task RetriggerCreateDatabaseIdp(Guid processId) => ProcessStepTypeId.RETRIGGER_INVITATION_CREATE_DATABASE_IDP.TriggerProcessStep(processId, _portalRepositories);
- public Task RetriggerInvitationCreateUser(Guid processId) => ProcessStepTypeId.RETRIGGER_INVITATION_CREATE_USER.TriggerProcessStep(processId, _portalRepositories);
+ public Task RetriggerUpdateCentralIdpUrls(Guid processId) => ProcessStepTypeId.RETRIGGER_INVITATION_UPDATE_CENTRAL_IDP_URLS.TriggerProcessStep(processId, _portalRepositories, ProcessTypeExtensions.GetProcessStepForRetrigger);
+ public Task RetriggerCreateCentralIdpOrgMapper(Guid processId) => ProcessStepTypeId.RETRIGGER_INVITATION_CREATE_CENTRAL_IDP_ORG_MAPPER.TriggerProcessStep(processId, _portalRepositories, ProcessTypeExtensions.GetProcessStepForRetrigger);
+ public Task RetriggerCreateSharedRealmIdpClient(Guid processId) => ProcessStepTypeId.RETRIGGER_INVITATION_CREATE_SHARED_REALM.TriggerProcessStep(processId, _portalRepositories, ProcessTypeExtensions.GetProcessStepForRetrigger);
+ public Task RetriggerEnableCentralIdp(Guid processId) => ProcessStepTypeId.RETRIGGER_INVITATION_ENABLE_CENTRAL_IDP.TriggerProcessStep(processId, _portalRepositories, ProcessTypeExtensions.GetProcessStepForRetrigger);
+ public Task RetriggerCreateDatabaseIdp(Guid processId) => ProcessStepTypeId.RETRIGGER_INVITATION_CREATE_DATABASE_IDP.TriggerProcessStep(processId, _portalRepositories, ProcessTypeExtensions.GetProcessStepForRetrigger);
+ public Task RetriggerInvitationCreateUser(Guid processId) => ProcessStepTypeId.RETRIGGER_INVITATION_CREATE_USER.TriggerProcessStep(processId, _portalRepositories, ProcessTypeExtensions.GetProcessStepForRetrigger);
}
diff --git a/src/administration/Administration.Service/BusinessLogic/MailBusinessLogic.cs b/src/administration/Administration.Service/BusinessLogic/MailBusinessLogic.cs
index 90716b8707..0196111823 100644
--- a/src/administration/Administration.Service/BusinessLogic/MailBusinessLogic.cs
+++ b/src/administration/Administration.Service/BusinessLogic/MailBusinessLogic.cs
@@ -20,10 +20,11 @@
using Org.Eclipse.TractusX.Portal.Backend.Administration.Service.ErrorHandling;
using Org.Eclipse.TractusX.Portal.Backend.Administration.Service.Models;
using Org.Eclipse.TractusX.Portal.Backend.Framework.ErrorHandling;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Extensions;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Repositories;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Enums;
-using Org.Eclipse.TractusX.Portal.Backend.Processes.Library;
+using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Extensions;
using Org.Eclipse.TractusX.Portal.Backend.Processes.Mailing.Library;
using System.Collections.Immutable;
@@ -61,5 +62,5 @@ public async Task SendMail(MailData mailData)
}
}
- public Task RetriggerSendMail(Guid processId) => ProcessStepTypeId.RETRIGGER_SEND_MAIL.TriggerProcessStep(processId, portalRepositories);
+ public Task RetriggerSendMail(Guid processId) => ProcessStepTypeId.RETRIGGER_SEND_MAIL.TriggerProcessStep(processId, portalRepositories, ProcessTypeExtensions.GetProcessStepForRetrigger);
}
diff --git a/src/administration/Administration.Service/BusinessLogic/NetworkBusinessLogic.cs b/src/administration/Administration.Service/BusinessLogic/NetworkBusinessLogic.cs
index 67b6957102..6691157195 100644
--- a/src/administration/Administration.Service/BusinessLogic/NetworkBusinessLogic.cs
+++ b/src/administration/Administration.Service/BusinessLogic/NetworkBusinessLogic.cs
@@ -23,13 +23,15 @@
using Org.Eclipse.TractusX.Portal.Backend.Administration.Service.Extensions;
using Org.Eclipse.TractusX.Portal.Backend.Administration.Service.Models;
using Org.Eclipse.TractusX.Portal.Backend.Framework.ErrorHandling;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Identity;
using Org.Eclipse.TractusX.Portal.Backend.Framework.Linq;
using Org.Eclipse.TractusX.Portal.Backend.Framework.Models;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Context;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Enums;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Models;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Repositories;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Enums;
-using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Identities;
using Org.Eclipse.TractusX.Portal.Backend.Processes.NetworkRegistration.Library;
using Org.Eclipse.TractusX.Portal.Backend.Provisioning.Library.Models;
using Org.Eclipse.TractusX.Portal.Backend.Provisioning.Library.Service;
@@ -62,7 +64,7 @@ public async Task HandlePartnerRegistration(PartnerRegistrationData data)
var ownerCompanyId = _identityData.CompanyId;
var networkRepository = portalRepositories.GetInstance();
var companyRepository = portalRepositories.GetInstance();
- var processStepRepository = portalRepositories.GetInstance();
+ var processStepRepository = portalRepositories.GetInstance>();
var identityProviderRepository = portalRepositories.GetInstance();
var (roleData, identityProviderIdAliase, singleIdentityProviderIdAlias, allIdentityProviderIds) = await ValidatePartnerRegistrationData(data, networkRepository, identityProviderRepository, ownerCompanyId).ConfigureAwait(ConfigureAwaitOptions.None);
diff --git a/src/administration/Administration.Service/BusinessLogic/RegistrationBusinessLogic.cs b/src/administration/Administration.Service/BusinessLogic/RegistrationBusinessLogic.cs
index ac441f7701..ead42388ab 100644
--- a/src/administration/Administration.Service/BusinessLogic/RegistrationBusinessLogic.cs
+++ b/src/administration/Administration.Service/BusinessLogic/RegistrationBusinessLogic.cs
@@ -27,7 +27,11 @@
using Org.Eclipse.TractusX.Portal.Backend.Dim.Library.BusinessLogic;
using Org.Eclipse.TractusX.Portal.Backend.Dim.Library.Models;
using Org.Eclipse.TractusX.Portal.Backend.Framework.ErrorHandling;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Identity;
using Org.Eclipse.TractusX.Portal.Backend.Framework.Models;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Context;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Extensions;
using Org.Eclipse.TractusX.Portal.Backend.IssuerComponent.Library.BusinessLogic;
using Org.Eclipse.TractusX.Portal.Backend.IssuerComponent.Library.Models;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess;
@@ -36,9 +40,8 @@
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Repositories;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Entities;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Enums;
-using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Identities;
+using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Extensions;
using Org.Eclipse.TractusX.Portal.Backend.Processes.ApplicationChecklist.Library;
-using Org.Eclipse.TractusX.Portal.Backend.Processes.Library;
using Org.Eclipse.TractusX.Portal.Backend.Processes.Mailing.Library;
using Org.Eclipse.TractusX.Portal.Backend.Provisioning.Library;
using Org.Eclipse.TractusX.Portal.Backend.Registration.Common;
@@ -613,8 +616,8 @@ private async Task GetApplicationIdByBpn(IssuerResponseData data, Cancella
return result.Single();
}
- public Task RetriggerDeleteIdpSharedRealm(Guid processId) => ProcessStepTypeId.RETRIGGER_DELETE_IDP_SHARED_REALM.TriggerProcessStep(processId, portalRepositories);
- public Task RetriggerDeleteIdpSharedServiceAccount(Guid processId) => ProcessStepTypeId.RETRIGGER_DELETE_IDP_SHARED_SERVICEACCOUNT.TriggerProcessStep(processId, portalRepositories);
- public Task RetriggerDeleteCentralIdentityProvider(Guid processId) => ProcessStepTypeId.RETRIGGER_DELETE_CENTRAL_IDENTITY_PROVIDER.TriggerProcessStep(processId, portalRepositories);
- public Task RetriggerDeleteCentralUser(Guid processId) => ProcessStepTypeId.RETRIGGER_DELETE_CENTRAL_USER.TriggerProcessStep(processId, portalRepositories);
+ public Task RetriggerDeleteIdpSharedRealm(Guid processId) => ProcessStepTypeId.RETRIGGER_DELETE_IDP_SHARED_REALM.TriggerProcessStep(processId, portalRepositories, ProcessTypeExtensions.GetProcessStepForRetrigger);
+ public Task RetriggerDeleteIdpSharedServiceAccount(Guid processId) => ProcessStepTypeId.RETRIGGER_DELETE_IDP_SHARED_SERVICEACCOUNT.TriggerProcessStep(processId, portalRepositories, ProcessTypeExtensions.GetProcessStepForRetrigger);
+ public Task RetriggerDeleteCentralIdentityProvider(Guid processId) => ProcessStepTypeId.RETRIGGER_DELETE_CENTRAL_IDENTITY_PROVIDER.TriggerProcessStep(processId, portalRepositories, ProcessTypeExtensions.GetProcessStepForRetrigger);
+ public Task RetriggerDeleteCentralUser(Guid processId) => ProcessStepTypeId.RETRIGGER_DELETE_CENTRAL_USER.TriggerProcessStep(processId, portalRepositories, ProcessTypeExtensions.GetProcessStepForRetrigger);
}
diff --git a/src/administration/Administration.Service/BusinessLogic/RegistrationStatusBusinessLogic.cs b/src/administration/Administration.Service/BusinessLogic/RegistrationStatusBusinessLogic.cs
index 761519570d..cb0a21695e 100644
--- a/src/administration/Administration.Service/BusinessLogic/RegistrationStatusBusinessLogic.cs
+++ b/src/administration/Administration.Service/BusinessLogic/RegistrationStatusBusinessLogic.cs
@@ -19,13 +19,13 @@
using Microsoft.Extensions.Options;
using Org.Eclipse.TractusX.Portal.Backend.Framework.ErrorHandling;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Identity;
using Org.Eclipse.TractusX.Portal.Backend.Framework.Models.Encryption;
using Org.Eclipse.TractusX.Portal.Backend.OnboardingServiceProvider.Library.DependencyInjection;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Models;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Repositories;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Enums;
-using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Identities;
namespace Org.Eclipse.TractusX.Portal.Backend.Administration.Service.BusinessLogic;
diff --git a/src/administration/Administration.Service/BusinessLogic/ServiceAccountBusinessLogic.cs b/src/administration/Administration.Service/BusinessLogic/ServiceAccountBusinessLogic.cs
index 2e04568eec..a0e2b0a82a 100644
--- a/src/administration/Administration.Service/BusinessLogic/ServiceAccountBusinessLogic.cs
+++ b/src/administration/Administration.Service/BusinessLogic/ServiceAccountBusinessLogic.cs
@@ -22,15 +22,17 @@
using Org.Eclipse.TractusX.Portal.Backend.Administration.Service.Models;
using Org.Eclipse.TractusX.Portal.Backend.Dim.Library.Models;
using Org.Eclipse.TractusX.Portal.Backend.Framework.ErrorHandling;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Identity;
using Org.Eclipse.TractusX.Portal.Backend.Framework.Linq;
using Org.Eclipse.TractusX.Portal.Backend.Framework.Models;
using Org.Eclipse.TractusX.Portal.Backend.Framework.Models.Configuration;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Extensions;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Models;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Repositories;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Enums;
-using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Identities;
-using Org.Eclipse.TractusX.Portal.Backend.Processes.Library;
+using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Extensions;
using Org.Eclipse.TractusX.Portal.Backend.Provisioning.Library;
using Org.Eclipse.TractusX.Portal.Backend.Provisioning.Library.Enums;
using Org.Eclipse.TractusX.Portal.Backend.Provisioning.Library.Models;
@@ -344,22 +346,22 @@ public async IAsyncEnumerable GetServiceAccountRolesAsy
public async Task HandleServiceAccountCreationCallback(Guid processId, AuthenticationDetail callbackData)
{
- var processData = await portalRepositories.GetInstance().GetProcessDataForServiceAccountCallback(processId, [ProcessStepTypeId.AWAIT_CREATE_DIM_TECHNICAL_USER_RESPONSE])
+ var processData = await portalRepositories.GetInstance().GetProcessDataForTechnicalUserCallback(processId, [ProcessStepTypeId.AWAIT_CREATE_DIM_TECHNICAL_USER_RESPONSE])
.ConfigureAwait(ConfigureAwaitOptions.None);
var context = processData.ProcessData.CreateManualProcessData(ProcessStepTypeId.AWAIT_CREATE_DIM_TECHNICAL_USER_RESPONSE, portalRepositories, () => $"externalId {processId}");
- if (processData.ServiceAccountId is null)
+ if (processData.TechnicalUserId is null)
{
throw new ConflictException($"ServiceAccountId must be set for process {processId}");
}
- if (processData.ServiceAccountVersion is null)
+ if (processData.TechnicalUserVersion is null)
{
throw new UnexpectedConditionException("ServiceAccountVersion or IdentityVersion should never be null here");
}
- CreateDimServiceAccount(callbackData, processData.ServiceAccountId.Value, processData.ServiceAccountVersion.Value);
+ CreateDimServiceAccount(callbackData, processData.TechnicalUserId.Value, processData.TechnicalUserVersion.Value);
if (processData.ProcessTypeId == ProcessTypeId.OFFER_SUBSCRIPTION)
{
@@ -388,8 +390,8 @@ private void CreateDimServiceAccount(AuthenticationDetail callbackData, Guid ser
public async Task HandleServiceAccountDeletionCallback(Guid processId)
{
- var processData = await portalRepositories.GetInstance()
- .GetProcessDataForServiceAccountDeletionCallback(processId,
+ var processData = await portalRepositories.GetInstance()
+ .GetProcessDataForTechnicalUserDeletionCallback(processId,
[ProcessStepTypeId.AWAIT_CREATE_DIM_TECHNICAL_USER_RESPONSE])
.ConfigureAwait(ConfigureAwaitOptions.None);
@@ -397,7 +399,7 @@ public async Task HandleServiceAccountDeletionCallback(Guid processId)
portalRepositories, () => $"externalId {processId}");
portalRepositories.GetInstance().AttachAndModifyIdentity(
- processData.ServiceAccountId ?? throw new ConflictException($"ServiceAccountId must be set for process {processId}"),
+ processData.TechnicalUserId ?? throw new ConflictException($"ServiceAccountId must be set for process {processId}"),
null,
i =>
{
@@ -408,5 +410,5 @@ public async Task HandleServiceAccountDeletionCallback(Guid processId)
await portalRepositories.SaveAsync().ConfigureAwait(ConfigureAwaitOptions.None);
}
- public Task RetriggerDimTechnicalUser(Guid processId, ProcessStepTypeId processStepTypeId) => processStepTypeId.TriggerProcessStep(processId, portalRepositories);
+ public Task RetriggerDimTechnicalUser(Guid processId, ProcessStepTypeId processStepTypeId) => processStepTypeId.TriggerProcessStep(processId, portalRepositories, ProcessTypeExtensions.GetProcessStepForRetrigger);
}
diff --git a/src/administration/Administration.Service/BusinessLogic/ServiceAccountManagement.cs b/src/administration/Administration.Service/BusinessLogic/ServiceAccountManagement.cs
index dffcaebe50..59f78026cb 100644
--- a/src/administration/Administration.Service/BusinessLogic/ServiceAccountManagement.cs
+++ b/src/administration/Administration.Service/BusinessLogic/ServiceAccountManagement.cs
@@ -20,12 +20,13 @@
using Org.Eclipse.TractusX.Portal.Backend.Administration.Service.ErrorHandling;
using Org.Eclipse.TractusX.Portal.Backend.Framework.ErrorHandling;
using Org.Eclipse.TractusX.Portal.Backend.Framework.Linq;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Context;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Entities;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Models;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Repositories;
-using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Entities;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Enums;
-using Org.Eclipse.TractusX.Portal.Backend.Processes.Library;
using Org.Eclipse.TractusX.Portal.Backend.Provisioning.Library;
namespace Org.Eclipse.TractusX.Portal.Backend.Administration.Service.BusinessLogic;
@@ -71,15 +72,15 @@ private async Task CreateDeletionProcess(Guid serviceAccountId, Gu
throw ConflictException.Create(AdministrationServiceAccountErrors.SERVICE_ACCOUNT_NOT_LINKED_TO_PROCESS, [new ErrorParameter("serviceAccountId", serviceAccountId.ToString())]);
}
- var processData = await portalRepositories.GetInstance()
- .GetProcessDataForServiceAccountDeletionCallback(processId.Value, null)
+ var processData = await portalRepositories.GetInstance()
+ .GetProcessDataForTechnicalUserDeletionCallback(processId.Value, null)
.ConfigureAwait(ConfigureAwaitOptions.None);
var context = processData.ProcessData.CreateManualProcessData(null,
portalRepositories, () => $"externalId {processId}");
context.ProcessSteps.Where(step => step.ProcessStepTypeId != ProcessStepTypeId.DELETE_DIM_TECHNICAL_USER).IfAny(pending =>
- throw ConflictException.Create(AdministrationServiceAccountErrors.SERVICE_ACCOUNT_PENDING_PROCESS_STEPS, [new ErrorParameter("serviceAccountId", serviceAccountId.ToString()), new("processStepTypeIds", string.Join(",", pending))]));
+ throw ConflictException.Create(AdministrationServiceAccountErrors.SERVICE_ACCOUNT_PENDING_PROCESS_STEPS, [new ErrorParameter("serviceAccountId", serviceAccountId.ToString()), new("processStepTypeIds", string.Join(",", pending))]));
if (context.ProcessSteps.Any(step => step.ProcessStepTypeId == ProcessStepTypeId.DELETE_DIM_TECHNICAL_USER))
return UserStatusId.DELETED;
diff --git a/src/administration/Administration.Service/BusinessLogic/SubscriptionConfigurationBusinessLogic.cs b/src/administration/Administration.Service/BusinessLogic/SubscriptionConfigurationBusinessLogic.cs
index 0a6ba9896a..e48c264aa4 100644
--- a/src/administration/Administration.Service/BusinessLogic/SubscriptionConfigurationBusinessLogic.cs
+++ b/src/administration/Administration.Service/BusinessLogic/SubscriptionConfigurationBusinessLogic.cs
@@ -18,12 +18,12 @@
********************************************************************************/
using Org.Eclipse.TractusX.Portal.Backend.Framework.ErrorHandling;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Identity;
using Org.Eclipse.TractusX.Portal.Backend.Framework.IO;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Models;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Repositories;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Enums;
-using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Identities;
using Org.Eclipse.TractusX.Portal.Backend.Processes.OfferSubscription.Library;
using Org.Eclipse.TractusX.Portal.Backend.Processes.OfferSubscription.Library.Extensions;
diff --git a/src/administration/Administration.Service/BusinessLogic/UserBusinessLogic.cs b/src/administration/Administration.Service/BusinessLogic/UserBusinessLogic.cs
index baf79f70eb..f21454cc39 100644
--- a/src/administration/Administration.Service/BusinessLogic/UserBusinessLogic.cs
+++ b/src/administration/Administration.Service/BusinessLogic/UserBusinessLogic.cs
@@ -22,13 +22,13 @@
using Org.Eclipse.TractusX.Portal.Backend.Bpdm.Library;
using Org.Eclipse.TractusX.Portal.Backend.Framework.Async;
using Org.Eclipse.TractusX.Portal.Backend.Framework.ErrorHandling;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Identity;
using Org.Eclipse.TractusX.Portal.Backend.Framework.Linq;
using Org.Eclipse.TractusX.Portal.Backend.Framework.Models;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Models;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Repositories;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Enums;
-using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Identities;
using Org.Eclipse.TractusX.Portal.Backend.Processes.Mailing.Library;
using Org.Eclipse.TractusX.Portal.Backend.Provisioning.DBAccess;
using Org.Eclipse.TractusX.Portal.Backend.Provisioning.Library;
diff --git a/src/administration/Administration.Service/BusinessLogic/UserRolesBusinessLogic.cs b/src/administration/Administration.Service/BusinessLogic/UserRolesBusinessLogic.cs
index ec743cc8b7..bc4153eacf 100644
--- a/src/administration/Administration.Service/BusinessLogic/UserRolesBusinessLogic.cs
+++ b/src/administration/Administration.Service/BusinessLogic/UserRolesBusinessLogic.cs
@@ -20,6 +20,7 @@
using Microsoft.Extensions.Options;
using Org.Eclipse.TractusX.Portal.Backend.Framework.Async;
using Org.Eclipse.TractusX.Portal.Backend.Framework.ErrorHandling;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Identity;
using Org.Eclipse.TractusX.Portal.Backend.Framework.Linq;
using Org.Eclipse.TractusX.Portal.Backend.Framework.Models;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess;
@@ -27,7 +28,6 @@
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Repositories;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Entities;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Enums;
-using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Identities;
using Org.Eclipse.TractusX.Portal.Backend.Provisioning.Library;
using System.Collections.Immutable;
using System.Text.Json;
diff --git a/src/administration/Administration.Service/BusinessLogic/UserUploadBusinessLogic.cs b/src/administration/Administration.Service/BusinessLogic/UserUploadBusinessLogic.cs
index eb32fdfe2a..8eb6fd47ed 100644
--- a/src/administration/Administration.Service/BusinessLogic/UserUploadBusinessLogic.cs
+++ b/src/administration/Administration.Service/BusinessLogic/UserUploadBusinessLogic.cs
@@ -21,11 +21,11 @@
using Org.Eclipse.TractusX.Portal.Backend.Administration.Service.Models;
using Org.Eclipse.TractusX.Portal.Backend.Framework.ErrorHandling;
using Org.Eclipse.TractusX.Portal.Backend.Framework.ErrorHandling.Service;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Identity;
using Org.Eclipse.TractusX.Portal.Backend.Framework.IO;
using Org.Eclipse.TractusX.Portal.Backend.Framework.Linq;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Models;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Enums;
-using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Identities;
using Org.Eclipse.TractusX.Portal.Backend.Processes.Mailing.Library;
using Org.Eclipse.TractusX.Portal.Backend.Provisioning.Library.Models;
using Org.Eclipse.TractusX.Portal.Backend.Provisioning.Library.Service;
diff --git a/src/externalsystems/Bpdm.Library/Bpdm.Library.csproj b/src/externalsystems/Bpdm.Library/Bpdm.Library.csproj
index d415c0d2de..41cebd0f25 100644
--- a/src/externalsystems/Bpdm.Library/Bpdm.Library.csproj
+++ b/src/externalsystems/Bpdm.Library/Bpdm.Library.csproj
@@ -28,6 +28,7 @@
+
diff --git a/src/externalsystems/Bpdm.Library/BusinessLogic/BpdmBusinessLogic.cs b/src/externalsystems/Bpdm.Library/BusinessLogic/BpdmBusinessLogic.cs
index c4badb4a39..6107a7313d 100644
--- a/src/externalsystems/Bpdm.Library/BusinessLogic/BpdmBusinessLogic.cs
+++ b/src/externalsystems/Bpdm.Library/BusinessLogic/BpdmBusinessLogic.cs
@@ -20,6 +20,7 @@
using Microsoft.Extensions.Options;
using Org.Eclipse.TractusX.Portal.Backend.Bpdm.Library.Models;
using Org.Eclipse.TractusX.Portal.Backend.Framework.ErrorHandling;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Enums;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Models;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Repositories;
diff --git a/src/externalsystems/BpnDidResolver.Library/BpnDidResolver.Library.csproj b/src/externalsystems/BpnDidResolver.Library/BpnDidResolver.Library.csproj
index cd3b267855..32ccb0044b 100644
--- a/src/externalsystems/BpnDidResolver.Library/BpnDidResolver.Library.csproj
+++ b/src/externalsystems/BpnDidResolver.Library/BpnDidResolver.Library.csproj
@@ -29,6 +29,7 @@
+
diff --git a/src/externalsystems/BpnDidResolver.Library/BusinessLogic/BpnDidResolverBusinessLogic.cs b/src/externalsystems/BpnDidResolver.Library/BusinessLogic/BpnDidResolverBusinessLogic.cs
index 25ca1bb315..98c17a58e4 100644
--- a/src/externalsystems/BpnDidResolver.Library/BusinessLogic/BpnDidResolverBusinessLogic.cs
+++ b/src/externalsystems/BpnDidResolver.Library/BusinessLogic/BpnDidResolverBusinessLogic.cs
@@ -18,6 +18,7 @@
********************************************************************************/
using Org.Eclipse.TractusX.Portal.Backend.Framework.ErrorHandling;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Enums;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Repositories;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Enums;
diff --git a/src/externalsystems/Clearinghouse.Library/BusinessLogic/ClearinghouseBusinessLogic.cs b/src/externalsystems/Clearinghouse.Library/BusinessLogic/ClearinghouseBusinessLogic.cs
index ccffde8768..1300dbb781 100644
--- a/src/externalsystems/Clearinghouse.Library/BusinessLogic/ClearinghouseBusinessLogic.cs
+++ b/src/externalsystems/Clearinghouse.Library/BusinessLogic/ClearinghouseBusinessLogic.cs
@@ -23,6 +23,7 @@
using Org.Eclipse.TractusX.Portal.Backend.Framework.Async;
using Org.Eclipse.TractusX.Portal.Backend.Framework.DateTimeProvider;
using Org.Eclipse.TractusX.Portal.Backend.Framework.ErrorHandling;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Enums;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Repositories;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Enums;
diff --git a/src/externalsystems/Clearinghouse.Library/Clearinghouse.Library.csproj b/src/externalsystems/Clearinghouse.Library/Clearinghouse.Library.csproj
index c29ec0ea95..9542f1dd8d 100644
--- a/src/externalsystems/Clearinghouse.Library/Clearinghouse.Library.csproj
+++ b/src/externalsystems/Clearinghouse.Library/Clearinghouse.Library.csproj
@@ -28,6 +28,7 @@
+
diff --git a/src/externalsystems/Custodian.Library/BusinessLogic/CustodianBusinessLogic.cs b/src/externalsystems/Custodian.Library/BusinessLogic/CustodianBusinessLogic.cs
index 8b034a8eec..b5d69d8d9d 100644
--- a/src/externalsystems/Custodian.Library/BusinessLogic/CustodianBusinessLogic.cs
+++ b/src/externalsystems/Custodian.Library/BusinessLogic/CustodianBusinessLogic.cs
@@ -19,6 +19,7 @@
using Org.Eclipse.TractusX.Portal.Backend.Custodian.Library.Models;
using Org.Eclipse.TractusX.Portal.Backend.Framework.ErrorHandling;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Enums;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Repositories;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Enums;
diff --git a/src/externalsystems/Custodian.Library/Custodian.Library.csproj b/src/externalsystems/Custodian.Library/Custodian.Library.csproj
index e5eb3aae37..e1aa838316 100644
--- a/src/externalsystems/Custodian.Library/Custodian.Library.csproj
+++ b/src/externalsystems/Custodian.Library/Custodian.Library.csproj
@@ -29,6 +29,7 @@
+
diff --git a/src/externalsystems/Dim.Library/BusinessLogic/DimBusinessLogic.cs b/src/externalsystems/Dim.Library/BusinessLogic/DimBusinessLogic.cs
index 1e64036e67..7ae3026cf1 100644
--- a/src/externalsystems/Dim.Library/BusinessLogic/DimBusinessLogic.cs
+++ b/src/externalsystems/Dim.Library/BusinessLogic/DimBusinessLogic.cs
@@ -24,6 +24,7 @@
using Org.Eclipse.TractusX.Portal.Backend.Framework.DateTimeProvider;
using Org.Eclipse.TractusX.Portal.Backend.Framework.ErrorHandling;
using Org.Eclipse.TractusX.Portal.Backend.Framework.Models.Encryption;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Enums;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Repositories;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Enums;
diff --git a/src/externalsystems/Dim.Library/Dim.Library.csproj b/src/externalsystems/Dim.Library/Dim.Library.csproj
index 9d09809d1d..f443906051 100644
--- a/src/externalsystems/Dim.Library/Dim.Library.csproj
+++ b/src/externalsystems/Dim.Library/Dim.Library.csproj
@@ -29,6 +29,7 @@
+
diff --git a/src/externalsystems/IssuerComponent.Library/BusinessLogic/IssuerComponentBusinessLogic.cs b/src/externalsystems/IssuerComponent.Library/BusinessLogic/IssuerComponentBusinessLogic.cs
index 9044f83e94..d01a27a38d 100644
--- a/src/externalsystems/IssuerComponent.Library/BusinessLogic/IssuerComponentBusinessLogic.cs
+++ b/src/externalsystems/IssuerComponent.Library/BusinessLogic/IssuerComponentBusinessLogic.cs
@@ -20,6 +20,7 @@
using Microsoft.Extensions.Options;
using Org.Eclipse.TractusX.Portal.Backend.Framework.ErrorHandling;
using Org.Eclipse.TractusX.Portal.Backend.Framework.Models.Encryption;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Enums;
using Org.Eclipse.TractusX.Portal.Backend.IssuerComponent.Library.DependencyInjection;
using Org.Eclipse.TractusX.Portal.Backend.IssuerComponent.Library.Models;
using Org.Eclipse.TractusX.Portal.Backend.IssuerComponent.Library.Service;
diff --git a/src/externalsystems/IssuerComponent.Library/IssuerComponent.Library.csproj b/src/externalsystems/IssuerComponent.Library/IssuerComponent.Library.csproj
index d69579af1f..31fd1a4b6e 100644
--- a/src/externalsystems/IssuerComponent.Library/IssuerComponent.Library.csproj
+++ b/src/externalsystems/IssuerComponent.Library/IssuerComponent.Library.csproj
@@ -29,6 +29,7 @@
+
diff --git a/src/externalsystems/OfferProvider.Library/BusinessLogic/IOfferProviderBusinessLogic.cs b/src/externalsystems/OfferProvider.Library/BusinessLogic/IOfferProviderBusinessLogic.cs
index 2b6ee0e746..19a222983f 100644
--- a/src/externalsystems/OfferProvider.Library/BusinessLogic/IOfferProviderBusinessLogic.cs
+++ b/src/externalsystems/OfferProvider.Library/BusinessLogic/IOfferProviderBusinessLogic.cs
@@ -18,6 +18,7 @@
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Enums;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Enums;
namespace Org.Eclipse.TractusX.Portal.Backend.OfferProvider.Library.BusinessLogic;
diff --git a/src/externalsystems/OfferProvider.Library/BusinessLogic/OfferProviderBusinessLogic.cs b/src/externalsystems/OfferProvider.Library/BusinessLogic/OfferProviderBusinessLogic.cs
index 1a3e59edbf..8b2b8e1f3d 100644
--- a/src/externalsystems/OfferProvider.Library/BusinessLogic/OfferProviderBusinessLogic.cs
+++ b/src/externalsystems/OfferProvider.Library/BusinessLogic/OfferProviderBusinessLogic.cs
@@ -18,6 +18,7 @@
********************************************************************************/
using Org.Eclipse.TractusX.Portal.Backend.Framework.ErrorHandling;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Enums;
using Org.Eclipse.TractusX.Portal.Backend.OfferProvider.Library.Models;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Repositories;
diff --git a/src/externalsystems/OfferProvider.Library/OfferProvider.Library.csproj b/src/externalsystems/OfferProvider.Library/OfferProvider.Library.csproj
index 2348279cba..0b97811d9b 100644
--- a/src/externalsystems/OfferProvider.Library/OfferProvider.Library.csproj
+++ b/src/externalsystems/OfferProvider.Library/OfferProvider.Library.csproj
@@ -28,6 +28,7 @@
+
diff --git a/src/externalsystems/OnboardingServiceProvider.Library/IOnboardingServiceProviderBusinessLogic.cs b/src/externalsystems/OnboardingServiceProvider.Library/IOnboardingServiceProviderBusinessLogic.cs
index 17f97f3bc8..867b14b3d4 100644
--- a/src/externalsystems/OnboardingServiceProvider.Library/IOnboardingServiceProviderBusinessLogic.cs
+++ b/src/externalsystems/OnboardingServiceProvider.Library/IOnboardingServiceProviderBusinessLogic.cs
@@ -18,6 +18,7 @@
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Enums;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Enums;
namespace Org.Eclipse.TractusX.Portal.Backend.OnboardingServiceProvider.Library;
diff --git a/src/externalsystems/OnboardingServiceProvider.Library/OnboardingServiceProvider.Library.csproj b/src/externalsystems/OnboardingServiceProvider.Library/OnboardingServiceProvider.Library.csproj
index 0873f612e1..31cc727a80 100644
--- a/src/externalsystems/OnboardingServiceProvider.Library/OnboardingServiceProvider.Library.csproj
+++ b/src/externalsystems/OnboardingServiceProvider.Library/OnboardingServiceProvider.Library.csproj
@@ -28,6 +28,7 @@
+
diff --git a/src/externalsystems/OnboardingServiceProvider.Library/OnboardingServiceProviderBusinessLogic.cs b/src/externalsystems/OnboardingServiceProvider.Library/OnboardingServiceProviderBusinessLogic.cs
index dc727bca99..8466e1f096 100644
--- a/src/externalsystems/OnboardingServiceProvider.Library/OnboardingServiceProviderBusinessLogic.cs
+++ b/src/externalsystems/OnboardingServiceProvider.Library/OnboardingServiceProviderBusinessLogic.cs
@@ -20,6 +20,7 @@
using Microsoft.Extensions.Options;
using Org.Eclipse.TractusX.Portal.Backend.Framework.ErrorHandling;
using Org.Eclipse.TractusX.Portal.Backend.Framework.Models.Encryption;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Enums;
using Org.Eclipse.TractusX.Portal.Backend.OnboardingServiceProvider.Library.DependencyInjection;
using Org.Eclipse.TractusX.Portal.Backend.OnboardingServiceProvider.Library.Models;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess;
diff --git a/src/externalsystems/SdFactory.Library/BusinessLogic/SdFactoryBusinessLogic.cs b/src/externalsystems/SdFactory.Library/BusinessLogic/SdFactoryBusinessLogic.cs
index 02b2e35c2b..d83225c2c7 100644
--- a/src/externalsystems/SdFactory.Library/BusinessLogic/SdFactoryBusinessLogic.cs
+++ b/src/externalsystems/SdFactory.Library/BusinessLogic/SdFactoryBusinessLogic.cs
@@ -19,6 +19,7 @@
using Microsoft.Extensions.Options;
using Org.Eclipse.TractusX.Portal.Backend.Framework.ErrorHandling;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Enums;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Repositories;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Enums;
diff --git a/src/externalsystems/SdFactory.Library/SdFactory.Library.csproj b/src/externalsystems/SdFactory.Library/SdFactory.Library.csproj
index 234265f87b..ef85fe198e 100644
--- a/src/externalsystems/SdFactory.Library/SdFactory.Library.csproj
+++ b/src/externalsystems/SdFactory.Library/SdFactory.Library.csproj
@@ -28,6 +28,7 @@
+
diff --git a/src/framework/Framework.Async/Directory.Build.props b/src/framework/Framework.Async/Directory.Build.props
index 6e30a7b3ec..f3653737f2 100644
--- a/src/framework/Framework.Async/Directory.Build.props
+++ b/src/framework/Framework.Async/Directory.Build.props
@@ -19,7 +19,7 @@
- 2.13.0
+ 2.14.0
diff --git a/src/framework/Framework.Cors/Directory.Build.props b/src/framework/Framework.Cors/Directory.Build.props
index 6e30a7b3ec..f3653737f2 100644
--- a/src/framework/Framework.Cors/Directory.Build.props
+++ b/src/framework/Framework.Cors/Directory.Build.props
@@ -19,7 +19,7 @@
- 2.13.0
+ 2.14.0
diff --git a/src/framework/Framework.DBAccess/Directory.Build.props b/src/framework/Framework.DBAccess/Directory.Build.props
index 6e30a7b3ec..f3653737f2 100644
--- a/src/framework/Framework.DBAccess/Directory.Build.props
+++ b/src/framework/Framework.DBAccess/Directory.Build.props
@@ -19,7 +19,7 @@
- 2.13.0
+ 2.14.0
diff --git a/src/portalbackend/PortalBackend.PortalEntities/Base/IBaseEntity.cs b/src/framework/Framework.DBAccess/IBaseEntity.cs
similarity index 92%
rename from src/portalbackend/PortalBackend.PortalEntities/Base/IBaseEntity.cs
rename to src/framework/Framework.DBAccess/IBaseEntity.cs
index 3f34ce0bc8..903fdd2fba 100644
--- a/src/portalbackend/PortalBackend.PortalEntities/Base/IBaseEntity.cs
+++ b/src/framework/Framework.DBAccess/IBaseEntity.cs
@@ -17,7 +17,7 @@
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/
-namespace Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Base;
+namespace Org.Eclipse.TractusX.Portal.Backend.Framework.DBAccess;
///
/// Marker interface
diff --git a/src/framework/Framework.DateTimeProvider/Directory.Build.props b/src/framework/Framework.DateTimeProvider/Directory.Build.props
index 6e30a7b3ec..f3653737f2 100644
--- a/src/framework/Framework.DateTimeProvider/Directory.Build.props
+++ b/src/framework/Framework.DateTimeProvider/Directory.Build.props
@@ -19,7 +19,7 @@
- 2.13.0
+ 2.14.0
diff --git a/src/framework/Framework.DependencyInjection/Directory.Build.props b/src/framework/Framework.DependencyInjection/Directory.Build.props
index 6e30a7b3ec..f3653737f2 100644
--- a/src/framework/Framework.DependencyInjection/Directory.Build.props
+++ b/src/framework/Framework.DependencyInjection/Directory.Build.props
@@ -19,7 +19,7 @@
- 2.13.0
+ 2.14.0
diff --git a/src/framework/Framework.ErrorHandling.Controller/Directory.Build.props b/src/framework/Framework.ErrorHandling.Controller/Directory.Build.props
index 6e30a7b3ec..f3653737f2 100644
--- a/src/framework/Framework.ErrorHandling.Controller/Directory.Build.props
+++ b/src/framework/Framework.ErrorHandling.Controller/Directory.Build.props
@@ -19,7 +19,7 @@
- 2.13.0
+ 2.14.0
diff --git a/src/framework/Framework.ErrorHandling.Web/Directory.Build.props b/src/framework/Framework.ErrorHandling.Web/Directory.Build.props
index 6e30a7b3ec..f3653737f2 100644
--- a/src/framework/Framework.ErrorHandling.Web/Directory.Build.props
+++ b/src/framework/Framework.ErrorHandling.Web/Directory.Build.props
@@ -19,7 +19,7 @@
- 2.13.0
+ 2.14.0
diff --git a/src/framework/Framework.ErrorHandling/Directory.Build.props b/src/framework/Framework.ErrorHandling/Directory.Build.props
index 6e30a7b3ec..f3653737f2 100644
--- a/src/framework/Framework.ErrorHandling/Directory.Build.props
+++ b/src/framework/Framework.ErrorHandling/Directory.Build.props
@@ -19,7 +19,7 @@
- 2.13.0
+ 2.14.0
diff --git a/src/framework/Framework.HttpClientExtensions/Directory.Build.props b/src/framework/Framework.HttpClientExtensions/Directory.Build.props
index 6e30a7b3ec..f3653737f2 100644
--- a/src/framework/Framework.HttpClientExtensions/Directory.Build.props
+++ b/src/framework/Framework.HttpClientExtensions/Directory.Build.props
@@ -19,7 +19,7 @@
- 2.13.0
+ 2.14.0
diff --git a/src/framework/Framework.IO/Directory.Build.props b/src/framework/Framework.IO/Directory.Build.props
index 6e30a7b3ec..f3653737f2 100644
--- a/src/framework/Framework.IO/Directory.Build.props
+++ b/src/framework/Framework.IO/Directory.Build.props
@@ -19,7 +19,7 @@
- 2.13.0
+ 2.14.0
diff --git a/src/processes/Processes.Library/Processes.Library.csproj b/src/framework/Framework.Identity/Directory.Build.props
similarity index 50%
rename from src/processes/Processes.Library/Processes.Library.csproj
rename to src/framework/Framework.Identity/Directory.Build.props
index 5de45af37f..f3653737f2 100644
--- a/src/processes/Processes.Library/Processes.Library.csproj
+++ b/src/framework/Framework.Identity/Directory.Build.props
@@ -1,5 +1,5 @@
-
-
-
- Org.Eclipse.TractusX.Portal.Backend.Processes.Library
- Org.Eclipse.TractusX.Portal.Backend.Processes.Library
- net8.0
- enable
- enable
- 76a1cf69-39e1-43a7-b6a7-fef83be5359f
-
-
-
-
-
-
+
+
+ 2.14.0
+
+
diff --git a/src/framework/Framework.Identity/Framework.Identity.csproj b/src/framework/Framework.Identity/Framework.Identity.csproj
new file mode 100644
index 0000000000..2265c77385
--- /dev/null
+++ b/src/framework/Framework.Identity/Framework.Identity.csproj
@@ -0,0 +1,63 @@
+
+
+
+
+
+ Org.Eclipse.TractusX.Portal.Backend.Framework.Identity
+ Org.Eclipse.TractusX.Portal.Backend.Framework.Identity
+ net8.0
+ enable
+ enable
+
+
+
+
+ Org.Eclipse.TractusX.Portal.Backend.Framework.Identity
+ Org.Eclipse.TractusX.Portal.Backend.Framework.Identity
+ TractusX
+ All content is the property of the respective authors or their employers. For more information regarding authorship of content, please consult the listed source code repository logs.
+
+ The Catena-X Portal Backend Framework library is a versatile .NET library that provides a set of powerful tools and utilities for common development tasks.
+ This package simplifies various aspects of your application, including database interactions, asynchronous programming, file I/O, LINQ operations, logging, and database seeding.
+
+ README.md
+ LICENSE
+ https://github.com/eclipse-tractusx/portal-backend
+ https://github.com/eclipse-tractusx/portal-backend
+ git
+
+ true
+
+
+ true
+
+
+ true
+ snupkg
+
+
+
+
+
+
+
+
+
+
diff --git a/src/portalbackend/PortalBackend.PortalEntities/Identities/IIdentityData.cs b/src/framework/Framework.Identity/IIdentityData.cs
similarity index 86%
rename from src/portalbackend/PortalBackend.PortalEntities/Identities/IIdentityData.cs
rename to src/framework/Framework.Identity/IIdentityData.cs
index 3c4699387c..3a2724426a 100644
--- a/src/portalbackend/PortalBackend.PortalEntities/Identities/IIdentityData.cs
+++ b/src/framework/Framework.Identity/IIdentityData.cs
@@ -17,9 +17,7 @@
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/
-using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Enums;
-
-namespace Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Identities;
+namespace Org.Eclipse.TractusX.Portal.Backend.Framework.Identity;
public interface IIdentityData
{
diff --git a/src/portalbackend/PortalBackend.PortalEntities/Identities/IIdentityService.cs b/src/framework/Framework.Identity/IIdentityService.cs
similarity index 91%
rename from src/portalbackend/PortalBackend.PortalEntities/Identities/IIdentityService.cs
rename to src/framework/Framework.Identity/IIdentityService.cs
index f170e7e78c..9d84b35174 100644
--- a/src/portalbackend/PortalBackend.PortalEntities/Identities/IIdentityService.cs
+++ b/src/framework/Framework.Identity/IIdentityService.cs
@@ -17,7 +17,7 @@
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/
-namespace Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Identities;
+namespace Org.Eclipse.TractusX.Portal.Backend.Framework.Identity;
public interface IIdentityService
{
diff --git a/src/portalbackend/PortalBackend.PortalEntities/Enums/IdentityTypeId.cs b/src/framework/Framework.Identity/IdentityTypeId.cs
similarity index 89%
rename from src/portalbackend/PortalBackend.PortalEntities/Enums/IdentityTypeId.cs
rename to src/framework/Framework.Identity/IdentityTypeId.cs
index 04e4acfac9..a3d9043e09 100644
--- a/src/portalbackend/PortalBackend.PortalEntities/Enums/IdentityTypeId.cs
+++ b/src/framework/Framework.Identity/IdentityTypeId.cs
@@ -1,5 +1,4 @@
/********************************************************************************
- * Copyright (c) 2023 BMW Group AG
* Copyright (c) 2023 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
@@ -18,7 +17,7 @@
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/
-namespace Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Enums;
+namespace Org.Eclipse.TractusX.Portal.Backend.Framework.Identity;
public enum IdentityTypeId
{
diff --git a/src/framework/Framework.Identity/README.md b/src/framework/Framework.Identity/README.md
new file mode 100644
index 0000000000..bc1e239dee
--- /dev/null
+++ b/src/framework/Framework.Identity/README.md
@@ -0,0 +1,21 @@
+# Catena-X Portal Backend Framework Identity
+
+The Catena-X Portal Backend Framework Identity library provides a useful set of identity handling.
+
+This content is produced and maintained by the Eclipse Tractus-X project.
+
+* Project home: https://projects.eclipse.org/projects/automotive.tractusx
+
+## Installation
+
+dotnet add package Org.Eclipse.TractusX.Portal.Backend.Framework.Identity
+
+## Source Code
+
+The project maintains the following source code repositories in the GitHub organization https://github.com/eclipse-tractusx:
+
+- https://github.com/eclipse-tractusx/portal-backend
+
+## License
+
+Distributed under the Apache 2.0 License.
diff --git a/src/framework/Framework.Linq/Directory.Build.props b/src/framework/Framework.Linq/Directory.Build.props
index 6e30a7b3ec..f3653737f2 100644
--- a/src/framework/Framework.Linq/Directory.Build.props
+++ b/src/framework/Framework.Linq/Directory.Build.props
@@ -19,7 +19,7 @@
- 2.13.0
+ 2.14.0
diff --git a/src/framework/Framework.Logging/Directory.Build.props b/src/framework/Framework.Logging/Directory.Build.props
index 6e30a7b3ec..f3653737f2 100644
--- a/src/framework/Framework.Logging/Directory.Build.props
+++ b/src/framework/Framework.Logging/Directory.Build.props
@@ -19,7 +19,7 @@
- 2.13.0
+ 2.14.0
diff --git a/src/framework/Framework.Models/Directory.Build.props b/src/framework/Framework.Models/Directory.Build.props
index 6e30a7b3ec..f3653737f2 100644
--- a/src/framework/Framework.Models/Directory.Build.props
+++ b/src/framework/Framework.Models/Directory.Build.props
@@ -19,7 +19,7 @@
- 2.13.0
+ 2.14.0
diff --git a/src/framework/Framework.Processes.Library/Context/IProcessRepositories.cs b/src/framework/Framework.Processes.Library/Context/IProcessRepositories.cs
new file mode 100644
index 0000000000..f06de064c6
--- /dev/null
+++ b/src/framework/Framework.Processes.Library/Context/IProcessRepositories.cs
@@ -0,0 +1,53 @@
+/********************************************************************************
+ * Copyright (c) 2024 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Apache License, Version 2.0 which is available at
+ * https://www.apache.org/licenses/LICENSE-2.0.
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ ********************************************************************************/
+
+namespace Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Context;
+
+public interface IProcessRepositories
+{
+ ///
+ /// Attaches the given Entity to the database
+ ///
+ /// the entity that should be attached to the database
+ /// action to set optional parameters
+ /// Type of the entity
+ /// Returns the attached entity
+ TEntity Attach(TEntity entity, Action? setOptionalParameters = null)
+ where TEntity : class;
+
+ void AttachRange(IEnumerable entities, Action setOptionalParameters) where TEntity : class;
+
+ IEnumerable AttachRange(IEnumerable entities) where TEntity : class;
+
+ ///
+ /// Removes the given entity from the database
+ ///
+ /// the entity that should be removed to the database
+ /// Type of the entity
+ /// Returns the attached entity
+ TEntity Remove(TEntity entity)
+ where TEntity : class;
+
+ void RemoveRange(IEnumerable entities) where TEntity : class;
+
+ public T GetInstance();
+
+ public Task SaveAsync();
+ void Clear();
+}
diff --git a/src/framework/Framework.Processes.Library/Context/IProcessStepRepository.cs b/src/framework/Framework.Processes.Library/Context/IProcessStepRepository.cs
new file mode 100644
index 0000000000..64332d2f05
--- /dev/null
+++ b/src/framework/Framework.Processes.Library/Context/IProcessStepRepository.cs
@@ -0,0 +1,42 @@
+/********************************************************************************
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Apache License, Version 2.0 which is available at
+ * https://www.apache.org/licenses/LICENSE-2.0.
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ ********************************************************************************/
+
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Entities;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Enums;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Models;
+
+namespace Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Context;
+
+///
+/// Repository for accessing and creating processSteps on persistence layer.
+///
+public interface IProcessStepRepository
+ where TProcessTypeId : struct, IConvertible
+ where TProcessStepTypeId : struct, IConvertible
+{
+ Process CreateProcess(TProcessTypeId processTypeId);
+ IEnumerable> CreateProcessRange(IEnumerable processTypeIds);
+ ProcessStep CreateProcessStep(TProcessStepTypeId processStepTypeId, ProcessStepStatusId processStepStatusId, Guid processId);
+ IEnumerable> CreateProcessStepRange(IEnumerable<(TProcessStepTypeId ProcessStepTypeId, ProcessStepStatusId ProcessStepStatusId, Guid ProcessId)> processStepTypeStatus);
+ void AttachAndModifyProcessStep(Guid processStepId, Action>? initialize, Action> modify);
+ void AttachAndModifyProcessSteps(IEnumerable<(Guid ProcessStepId, Action>? Initialize, Action> Modify)> processStepIdsInitializeModifyData);
+ IAsyncEnumerable> GetActiveProcesses(IEnumerable processTypeIds, IEnumerable processStepTypeIds, DateTimeOffset lockExpiryDate);
+ IAsyncEnumerable<(Guid ProcessStepId, TProcessStepTypeId ProcessStepTypeId)> GetProcessStepData(Guid processId);
+ public Task<(bool ProcessExists, VerifyProcessData ProcessData)> IsValidProcess(Guid processId, TProcessTypeId processTypeId, IEnumerable processStepTypeIds);
+}
diff --git a/src/framework/Framework.Processes.Library/Context/ProcessDbContext.cs b/src/framework/Framework.Processes.Library/Context/ProcessDbContext.cs
new file mode 100644
index 0000000000..d580272310
--- /dev/null
+++ b/src/framework/Framework.Processes.Library/Context/ProcessDbContext.cs
@@ -0,0 +1,64 @@
+/********************************************************************************
+ * Copyright (c) 2024 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Apache License, Version 2.0 which is available at
+ * https://www.apache.org/licenses/LICENSE-2.0.
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ ********************************************************************************/
+
+using Microsoft.EntityFrameworkCore;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Entities;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Enums;
+
+namespace Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Context;
+
+public class ProcessDbContext : DbContext
+ where TProcessTypeId : struct, IConvertible
+ where TProcessStepTypeId : struct, IConvertible
+{
+ protected ProcessDbContext()
+ {
+ throw new InvalidOperationException("IdentityService should never be null");
+ }
+
+ public ProcessDbContext(DbContextOptions options)
+ : base(options)
+ {
+ }
+
+ public virtual DbSet> Processes { get; set; } = default!;
+ public virtual DbSet> ProcessSteps { get; set; } = default!;
+ public virtual DbSet> ProcessStepStatuses { get; set; } = default!;
+
+ protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
+ {
+ optionsBuilder.UseSnakeCaseNamingConvention();
+ }
+
+ protected override void OnModelCreating(ModelBuilder modelBuilder)
+ {
+ modelBuilder.Entity>()
+ .HasOne(d => d.Process)
+ .WithMany(p => p.ProcessSteps)
+ .HasForeignKey(d => d.ProcessId)
+ .OnDelete(DeleteBehavior.ClientSetNull);
+
+ modelBuilder.Entity>()
+ .HasData(
+ Enum.GetValues(typeof(ProcessStepStatusId))
+ .Cast()
+ .Select(e => new ProcessStepStatus(e))
+ );
+ }
+}
diff --git a/src/framework/Framework.Processes.Library/Context/ProcessRepositories.cs b/src/framework/Framework.Processes.Library/Context/ProcessRepositories.cs
new file mode 100644
index 0000000000..f63eac978a
--- /dev/null
+++ b/src/framework/Framework.Processes.Library/Context/ProcessRepositories.cs
@@ -0,0 +1,89 @@
+/********************************************************************************
+ * Copyright (c) 2024 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Apache License, Version 2.0 which is available at
+ * https://www.apache.org/licenses/LICENSE-2.0.
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ ********************************************************************************/
+
+using Microsoft.EntityFrameworkCore;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.ErrorHandling;
+using System.Collections.Immutable;
+
+namespace Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Context;
+
+public class ProcessRepositories(ProcessDbContext dbContext) : IProcessRepositories
+ where TProcessTypeId : struct, IConvertible
+ where TProcessStepTypeId : struct, IConvertible
+{
+ private static KeyValuePair, object>> CreateTypeEntry(Func, object> createFunc) => KeyValuePair.Create(typeof(T), createFunc);
+
+ protected static readonly IReadOnlyDictionary, object>> ProcessRepositoryTypes = ImmutableDictionary.CreateRange(new[]
+ {
+ CreateTypeEntry>(context => new ProcessStepRepository(context))
+ });
+
+ public RepositoryType GetInstance()
+ {
+ object? repository = default;
+
+ if (ProcessRepositoryTypes.TryGetValue(typeof(RepositoryType), out var createFunc))
+ {
+ repository = createFunc(dbContext);
+ }
+
+ return (RepositoryType)(repository ?? throw new ArgumentException($"unexpected type {typeof(RepositoryType).Name}", nameof(RepositoryType)));
+ }
+
+ ///
+ public TEntity Attach(TEntity entity, Action? setOptionalParameters = null) where TEntity : class
+ {
+ var attachedEntity = dbContext.Attach(entity).Entity;
+ setOptionalParameters?.Invoke(attachedEntity);
+
+ return attachedEntity;
+ }
+
+ public void AttachRange(IEnumerable entities, Action setOptionalParameters) where TEntity : class
+ {
+ foreach (var attachedEntity in entities.Select(entity => dbContext.Attach(entity).Entity))
+ {
+ setOptionalParameters.Invoke(attachedEntity);
+ }
+ }
+
+ public IEnumerable AttachRange(IEnumerable entities) where TEntity : class =>
+ entities.Select(entity => dbContext.Attach(entity).Entity);
+
+ ///
+ public TEntity Remove(TEntity entity) where TEntity : class
+ => dbContext.Remove(entity).Entity;
+
+ public void RemoveRange(IEnumerable entities) where TEntity : class
+ => dbContext.RemoveRange(entities);
+
+ public Task SaveAsync()
+ {
+ try
+ {
+ return dbContext.SaveChangesAsync();
+ }
+ catch (DbUpdateConcurrencyException e)
+ {
+ throw new ConflictException("while processing a concurrent update was saved to the database (reason could also be data to be deleted is no longer existing)", e);
+ }
+ }
+
+ public void Clear() => dbContext.ChangeTracker.Clear();
+}
diff --git a/src/framework/Framework.Processes.Library/Context/ProcessStepRepository.cs b/src/framework/Framework.Processes.Library/Context/ProcessStepRepository.cs
new file mode 100644
index 0000000000..6b6ded4c10
--- /dev/null
+++ b/src/framework/Framework.Processes.Library/Context/ProcessStepRepository.cs
@@ -0,0 +1,113 @@
+/********************************************************************************
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Apache License, Version 2.0 which is available at
+ * https://www.apache.org/licenses/LICENSE-2.0.
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ ********************************************************************************/
+
+using Microsoft.EntityFrameworkCore;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Entities;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Enums;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Models;
+using System.Collections.Immutable;
+
+namespace Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Context;
+
+public class ProcessStepRepository(ProcessDbContext dbContext) : IProcessStepRepository
+ where TProcessTypeId : struct, IConvertible
+ where TProcessStepTypeId : struct, IConvertible
+{
+ public Process CreateProcess(TProcessTypeId processTypeId) =>
+ dbContext.Add(new Process(Guid.NewGuid(), processTypeId, Guid.NewGuid())).Entity;
+
+ public IEnumerable> CreateProcessRange(IEnumerable processTypeIds)
+ {
+ var processes = processTypeIds.Select(x => new Process(Guid.NewGuid(), x, Guid.NewGuid())).ToImmutableList();
+ dbContext.AddRange(processes);
+ return processes;
+ }
+
+ public ProcessStep CreateProcessStep(TProcessStepTypeId processStepTypeId, ProcessStepStatusId processStepStatusId, Guid processId) =>
+ dbContext.Add(new ProcessStep(Guid.NewGuid(), processStepTypeId, processStepStatusId, processId, DateTimeOffset.UtcNow)).Entity;
+
+ public IEnumerable> CreateProcessStepRange(IEnumerable<(TProcessStepTypeId ProcessStepTypeId, ProcessStepStatusId ProcessStepStatusId, Guid ProcessId)> processStepTypeStatus)
+ {
+ var processSteps = processStepTypeStatus.Select(x => new ProcessStep(Guid.NewGuid(), x.ProcessStepTypeId, x.ProcessStepStatusId, x.ProcessId, DateTimeOffset.UtcNow)).ToImmutableList();
+ dbContext.AddRange(processSteps);
+ return processSteps;
+ }
+
+ public void AttachAndModifyProcessStep(Guid processStepId, Action>? initialize, Action> modify)
+ {
+ var step = new ProcessStep(processStepId, default, default, Guid.Empty, default);
+ initialize?.Invoke(step);
+ dbContext.Attach(step);
+ step.DateLastChanged = DateTimeOffset.UtcNow;
+ modify(step);
+ }
+
+ public void AttachAndModifyProcessSteps(IEnumerable<(Guid ProcessStepId, Action>? Initialize, Action> Modify)> processStepIdsInitializeModifyData)
+ {
+ var stepModifyData = processStepIdsInitializeModifyData.Select(data =>
+ {
+ var step = new ProcessStep(data.ProcessStepId, default, default, Guid.Empty, default);
+ data.Initialize?.Invoke(step);
+ return (Step: step, data.Modify);
+ }).ToImmutableList();
+ dbContext.AttachRange(stepModifyData.Select(data => data.Step));
+ stepModifyData.ForEach(data =>
+ {
+ data.Step.DateLastChanged = DateTimeOffset.UtcNow;
+ data.Modify(data.Step);
+ });
+ }
+
+ public IAsyncEnumerable> GetActiveProcesses(IEnumerable processTypeIds, IEnumerable processStepTypeIds, DateTimeOffset lockExpiryDate) =>
+ dbContext.Processes
+ .AsNoTracking()
+ .Where(process =>
+ processTypeIds.Contains(process.ProcessTypeId) &&
+ process.ProcessSteps.Any(step => processStepTypeIds.Contains(step.ProcessStepTypeId) && step.ProcessStepStatusId == ProcessStepStatusId.TODO) &&
+ (process.LockExpiryDate == null || process.LockExpiryDate < lockExpiryDate))
+ .AsAsyncEnumerable();
+
+ public IAsyncEnumerable<(Guid ProcessStepId, TProcessStepTypeId ProcessStepTypeId)> GetProcessStepData(Guid processId) =>
+ dbContext.ProcessSteps
+ .AsNoTracking()
+ .Where(step =>
+ step.ProcessId == processId &&
+ step.ProcessStepStatusId == ProcessStepStatusId.TODO)
+ .OrderBy(step => step.ProcessStepTypeId)
+ .Select(step =>
+ new ValueTuple(
+ step.Id,
+ step.ProcessStepTypeId))
+ .AsAsyncEnumerable();
+
+ public Task<(bool ProcessExists, VerifyProcessData ProcessData)> IsValidProcess(Guid processId, TProcessTypeId processTypeId, IEnumerable processStepTypeIds) =>
+ dbContext.Processes
+ .AsNoTracking()
+ .Where(x => x.Id == processId && x.ProcessTypeId.Equals(processTypeId))
+ .Select(x => new ValueTuple>(
+ true,
+ new VerifyProcessData(
+ x,
+ x.ProcessSteps
+ .Where(step =>
+ processStepTypeIds.Contains(step.ProcessStepTypeId) &&
+ step.ProcessStepStatusId == ProcessStepStatusId.TODO))
+ ))
+ .SingleOrDefaultAsync();
+}
diff --git a/src/framework/Framework.Processes.Library/Directory.Build.props b/src/framework/Framework.Processes.Library/Directory.Build.props
new file mode 100644
index 0000000000..f3653737f2
--- /dev/null
+++ b/src/framework/Framework.Processes.Library/Directory.Build.props
@@ -0,0 +1,25 @@
+
+
+
+
+ 2.14.0
+
+
+
diff --git a/src/framework/Framework.Processes.Library/Entities/Process.cs b/src/framework/Framework.Processes.Library/Entities/Process.cs
new file mode 100644
index 0000000000..f31c3958df
--- /dev/null
+++ b/src/framework/Framework.Processes.Library/Entities/Process.cs
@@ -0,0 +1,51 @@
+/********************************************************************************
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Apache License, Version 2.0 which is available at
+ * https://www.apache.org/licenses/LICENSE-2.0.
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ ********************************************************************************/
+
+using Org.Eclipse.TractusX.Portal.Backend.Framework.DBAccess;
+using System.ComponentModel.DataAnnotations;
+
+namespace Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Entities;
+
+public class Process : IBaseEntity, ILockableEntity
+ where TProcessTypeId : struct, IConvertible
+ where TProcessStepTypeId : struct, IConvertible
+{
+ private Process()
+ {
+ ProcessSteps = new HashSet>();
+ }
+
+ public Process(Guid id, TProcessTypeId processTypeId, Guid version) : this()
+ {
+ Id = id;
+ ProcessTypeId = processTypeId;
+ Version = version;
+ }
+
+ public Guid Id { get; private set; }
+
+ public TProcessTypeId ProcessTypeId { get; set; }
+
+ public DateTimeOffset? LockExpiryDate { get; set; }
+
+ [ConcurrencyCheck]
+ public Guid Version { get; set; }
+
+ public virtual ICollection> ProcessSteps { get; private set; }
+}
diff --git a/src/framework/Framework.Processes.Library/Entities/ProcessStep.cs b/src/framework/Framework.Processes.Library/Entities/ProcessStep.cs
new file mode 100644
index 0000000000..9e224a48a7
--- /dev/null
+++ b/src/framework/Framework.Processes.Library/Entities/ProcessStep.cs
@@ -0,0 +1,51 @@
+/********************************************************************************
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Apache License, Version 2.0 which is available at
+ * https://www.apache.org/licenses/LICENSE-2.0.
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ ********************************************************************************/
+
+using Org.Eclipse.TractusX.Portal.Backend.Framework.DBAccess;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Enums;
+
+namespace Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Entities;
+
+public class ProcessStep(
+ Guid id,
+ TProcessStepTypeId processStepTypeId,
+ ProcessStepStatusId processStepStatusId,
+ Guid processId,
+ DateTimeOffset dateCreated)
+ : IBaseEntity
+ where TProcessTypeId : struct, IConvertible
+ where TProcessStepTypeId : struct, IConvertible
+{
+ public Guid Id { get; private set; } = id;
+
+ public TProcessStepTypeId ProcessStepTypeId { get; private set; } = processStepTypeId;
+
+ public ProcessStepStatusId ProcessStepStatusId { get; set; } = processStepStatusId;
+
+ public Guid ProcessId { get; private set; } = processId;
+
+ public DateTimeOffset DateCreated { get; private set; } = dateCreated;
+
+ public DateTimeOffset? DateLastChanged { get; set; }
+
+ public string? Message { get; set; }
+
+ // Navigation properties
+ public virtual Process? Process { get; private set; }
+}
diff --git a/src/portalbackend/PortalBackend.PortalEntities/Entities/ProcessStepStatus.cs b/src/framework/Framework.Processes.Library/Entities/ProcessStepStatus.cs
similarity index 71%
rename from src/portalbackend/PortalBackend.PortalEntities/Entities/ProcessStepStatus.cs
rename to src/framework/Framework.Processes.Library/Entities/ProcessStepStatus.cs
index e9d7f0a5b2..9260e6ed7f 100644
--- a/src/portalbackend/PortalBackend.PortalEntities/Entities/ProcessStepStatus.cs
+++ b/src/framework/Framework.Processes.Library/Entities/ProcessStepStatus.cs
@@ -17,17 +17,19 @@
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/
-using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Enums;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Enums;
using System.ComponentModel.DataAnnotations;
-namespace Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Entities;
+namespace Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Entities;
-public class ProcessStepStatus
+public class ProcessStepStatus
+ where TProcessTypeId : struct, IConvertible
+ where TProcessStepTypeId : struct, IConvertible
{
private ProcessStepStatus()
{
Label = null!;
- ProcessSteps = new HashSet();
+ ProcessSteps = new HashSet>();
}
public ProcessStepStatus(ProcessStepStatusId processStepStatusId) : this()
@@ -42,5 +44,5 @@ public ProcessStepStatus(ProcessStepStatusId processStepStatusId) : this()
public string Label { get; private set; }
// Navigation properties
- public virtual ICollection ProcessSteps { get; private set; }
+ public virtual ICollection> ProcessSteps { get; private set; }
}
diff --git a/src/portalbackend/PortalBackend.PortalEntities/Enums/ProcessStepStatusId.cs b/src/framework/Framework.Processes.Library/Enums/ProcessStepStatusId.cs
similarity index 89%
rename from src/portalbackend/PortalBackend.PortalEntities/Enums/ProcessStepStatusId.cs
rename to src/framework/Framework.Processes.Library/Enums/ProcessStepStatusId.cs
index 4b04ff782a..a9743aedb3 100644
--- a/src/portalbackend/PortalBackend.PortalEntities/Enums/ProcessStepStatusId.cs
+++ b/src/framework/Framework.Processes.Library/Enums/ProcessStepStatusId.cs
@@ -1,5 +1,4 @@
/********************************************************************************
- * Copyright (c) 2022 BMW Group AG
* Copyright (c) 2022 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
@@ -18,7 +17,7 @@
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/
-namespace Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Enums;
+namespace Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Enums;
public enum ProcessStepStatusId
{
diff --git a/src/framework/Framework.Processes.Library/Extensions/RetriggerExtensions.cs b/src/framework/Framework.Processes.Library/Extensions/RetriggerExtensions.cs
new file mode 100644
index 0000000000..01383ba6e6
--- /dev/null
+++ b/src/framework/Framework.Processes.Library/Extensions/RetriggerExtensions.cs
@@ -0,0 +1,48 @@
+/********************************************************************************
+ * Copyright (c) 2024 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Apache License, Version 2.0 which is available at
+ * https://www.apache.org/licenses/LICENSE-2.0.
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ ********************************************************************************/
+
+using Org.Eclipse.TractusX.Portal.Backend.Framework.ErrorHandling;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Context;
+
+namespace Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Extensions;
+
+public static class RetriggerExtensions
+{
+ public static async Task TriggerProcessStep(
+ this TProcessStepTypeId stepToTrigger, Guid processId,
+ IProcessRepositories processRepositories,
+ Func getProcessStepForRetrigger)
+ where TProcessTypeId : struct, IConvertible
+ where TProcessStepTypeId : struct, IConvertible
+ {
+ var (processType, nextStep) = getProcessStepForRetrigger(stepToTrigger);
+
+ var (validProcessId, processData) = await processRepositories.GetInstance>().IsValidProcess(processId, processType, Enumerable.Repeat(stepToTrigger, 1)).ConfigureAwait(ConfigureAwaitOptions.None);
+ if (!validProcessId)
+ {
+ throw new NotFoundException($"process {processId} does not exist");
+ }
+
+ var context = processData.CreateManualProcessData(stepToTrigger, processRepositories, () => $"processId {processId}");
+
+ context.ScheduleProcessSteps(Enumerable.Repeat(nextStep, 1));
+ context.FinalizeProcessStep();
+ await processRepositories.SaveAsync().ConfigureAwait(ConfigureAwaitOptions.None);
+ }
+}
diff --git a/src/framework/Framework.Processes.Library/Framework.Processes.Library.csproj b/src/framework/Framework.Processes.Library/Framework.Processes.Library.csproj
new file mode 100644
index 0000000000..9423afcbfe
--- /dev/null
+++ b/src/framework/Framework.Processes.Library/Framework.Processes.Library.csproj
@@ -0,0 +1,73 @@
+
+
+
+
+
+ Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library
+ Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library
+ net8.0
+ enable
+ enable
+
+
+
+
+ Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library
+ Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library
+ TractusX
+ All content is the property of the respective authors or their employers. For more information regarding authorship of content, please consult the listed source code repository logs.
+
+ The Catena-X Portal Backend Framework library is a versatile .NET library that provides a set of powerful tools and utilities for common development tasks.
+ This package simplifies various aspects of your application, including database interactions, asynchronous programming, file I/O, LINQ operations, logging, and database seeding.
+
+ README.md
+ LICENSE
+ https://github.com/eclipse-tractusx/portal-backend
+ https://github.com/eclipse-tractusx/portal-backend
+ git
+
+ true
+
+
+ true
+
+
+ true
+ snupkg
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/framework/Framework.Processes.Library/ManualProcessStepData.cs b/src/framework/Framework.Processes.Library/ManualProcessStepData.cs
new file mode 100644
index 0000000000..d10cc341f1
--- /dev/null
+++ b/src/framework/Framework.Processes.Library/ManualProcessStepData.cs
@@ -0,0 +1,32 @@
+/********************************************************************************
+ * Copyright (c) 2023 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Apache License, Version 2.0 which is available at
+ * https://www.apache.org/licenses/LICENSE-2.0.
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ ********************************************************************************/
+
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Context;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Entities;
+
+namespace Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library;
+
+public record ManualProcessStepData(
+ TProcessStepTypeId? ProcessStepTypeId,
+ Process Process,
+ IEnumerable> ProcessSteps,
+ IProcessRepositories ProcessRepositories
+)
+where TProcessTypeId : struct, IConvertible
+where TProcessStepTypeId : struct, IConvertible;
diff --git a/src/processes/Processes.Library/ManualProcessStepDataExtensions.cs b/src/framework/Framework.Processes.Library/ManualProcessStepDataExtensions.cs
similarity index 53%
rename from src/processes/Processes.Library/ManualProcessStepDataExtensions.cs
rename to src/framework/Framework.Processes.Library/ManualProcessStepDataExtensions.cs
index 82de981d71..936bdaf80c 100644
--- a/src/processes/Processes.Library/ManualProcessStepDataExtensions.cs
+++ b/src/framework/Framework.Processes.Library/ManualProcessStepDataExtensions.cs
@@ -19,21 +19,22 @@
using Org.Eclipse.TractusX.Portal.Backend.Framework.DBAccess;
using Org.Eclipse.TractusX.Portal.Backend.Framework.ErrorHandling;
-using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess;
-using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Models;
-using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Repositories;
-using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Entities;
-using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Enums;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Context;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Entities;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Enums;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Models;
-namespace Org.Eclipse.TractusX.Portal.Backend.Processes.Library;
+namespace Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library;
public static class VerifyProcessDataExtensions
{
- public static ManualProcessStepData CreateManualProcessData(
- this VerifyProcessData? processData,
- ProcessStepTypeId? processStepTypeId,
- IPortalRepositories portalRepositories,
+ public static ManualProcessStepData CreateManualProcessData(
+ this VerifyProcessData? processData,
+ TProcessStepTypeId? processStepTypeId,
+ IProcessRepositories processRepositories,
Func getProcessEntityName)
+ where TProcessTypeId : struct, IConvertible
+ where TProcessStepTypeId : struct, IConvertible
{
if (processData is null)
{
@@ -60,20 +61,22 @@ public static ManualProcessStepData CreateManualProcessData(
throw new UnexpectedConditionException("processSteps should never have any other status than TODO here");
}
- if (processStepTypeId.HasValue && processData.ProcessSteps.All(step => step.ProcessStepTypeId != processStepTypeId.Value))
+ if (processStepTypeId != null && processData.ProcessSteps.All(step => !step.ProcessStepTypeId.Equals(processStepTypeId)))
{
- throw new ConflictException($"{getProcessEntityName()}, process step {processStepTypeId.Value} is not eligible to run");
+ throw new ConflictException($"{getProcessEntityName()}, process step {processStepTypeId} is not eligible to run");
}
- return new(processStepTypeId, processData.Process, processData.ProcessSteps, portalRepositories);
+ return new(processStepTypeId, processData.Process, processData.ProcessSteps, processRepositories);
}
}
public static class ManualProcessStepDataExtensions
{
- public static void RequestLock(this ManualProcessStepData context, DateTimeOffset lockExpiryDate)
+ public static void RequestLock(this ManualProcessStepData context, DateTimeOffset lockExpiryDate)
+ where TProcessTypeId : struct, IConvertible
+ where TProcessStepTypeId : struct, IConvertible
{
- context.PortalRepositories.Attach(context.Process);
+ context.ProcessRepositories.Attach(context.Process);
var isLocked = context.Process.TryLock(lockExpiryDate);
if (!isLocked)
@@ -82,47 +85,58 @@ public static void RequestLock(this ManualProcessStepData context, DateTimeOffse
}
}
- public static void SkipProcessSteps(this ManualProcessStepData context, IEnumerable processStepTypeIds) =>
- context.PortalRepositories.GetInstance()
+ public static void SkipProcessSteps(this ManualProcessStepData context, IEnumerable processStepTypeIds)
+ where TProcessTypeId : struct, IConvertible
+ where TProcessStepTypeId : struct, IConvertible =>
+ context.ProcessRepositories.GetInstance>()
.AttachAndModifyProcessSteps(
context.ProcessSteps
- .Where(step => !context.ProcessStepTypeId.HasValue || step.ProcessStepTypeId != context.ProcessStepTypeId.Value)
+ .Where(step => !context.ProcessStepTypeId.HasValue || !step.ProcessStepTypeId.Equals(context.ProcessStepTypeId.Value))
.GroupBy(step => step.ProcessStepTypeId)
.IntersectBy(processStepTypeIds, group => group.Key)
.SelectMany(group => ModifyStepStatusRange(group, ProcessStepStatusId.SKIPPED)));
- public static void SkipProcessStepsExcept(this ManualProcessStepData context, IEnumerable processStepTypeIds) =>
- context.PortalRepositories.GetInstance()
+ public static void SkipProcessStepsExcept(this ManualProcessStepData context, IEnumerable processStepTypeIds)
+ where TProcessTypeId : struct, IConvertible
+ where TProcessStepTypeId : struct, IConvertible =>
+ context.ProcessRepositories.GetInstance>()
.AttachAndModifyProcessSteps(
context.ProcessSteps
- .Where(step => !context.ProcessStepTypeId.HasValue || step.ProcessStepTypeId != context.ProcessStepTypeId.Value)
+ .Where(step => !context.ProcessStepTypeId.HasValue || !step.ProcessStepTypeId.Equals(context.ProcessStepTypeId.Value))
.GroupBy(step => step.ProcessStepTypeId)
.ExceptBy(processStepTypeIds, group => group.Key)
.SelectMany(group => ModifyStepStatusRange(group, ProcessStepStatusId.SKIPPED)));
- public static void ScheduleProcessSteps(this ManualProcessStepData context, IEnumerable processStepTypeIds) =>
- context.PortalRepositories.GetInstance()
+ public static void ScheduleProcessSteps(this ManualProcessStepData context, IEnumerable processStepTypeIds)
+ where TProcessTypeId : struct, IConvertible
+ where TProcessStepTypeId : struct, IConvertible =>
+ context.ProcessRepositories.GetInstance>()
.CreateProcessStepRange(
processStepTypeIds
+ .Select(x => x)
.Except(context.ProcessSteps.Select(step => step.ProcessStepTypeId))
.Select(stepTypeId => (stepTypeId, ProcessStepStatusId.TODO, context.Process.Id)));
- public static void FinalizeProcessStep(this ManualProcessStepData context)
+ public static void FinalizeProcessStep(this ManualProcessStepData context)
+ where TProcessTypeId : struct, IConvertible
+ where TProcessStepTypeId : struct, IConvertible
{
- if (context.ProcessStepTypeId.HasValue)
+ if (context.ProcessStepTypeId != null)
{
- context.PortalRepositories.GetInstance().AttachAndModifyProcessSteps(
- ModifyStepStatusRange(context.ProcessSteps.Where(step => step.ProcessStepTypeId == context.ProcessStepTypeId.Value), ProcessStepStatusId.DONE));
+ context.ProcessRepositories.GetInstance>().AttachAndModifyProcessSteps(
+ ModifyStepStatusRange(context.ProcessSteps.Where(step => step.ProcessStepTypeId.Equals(context.ProcessStepTypeId.Value)), ProcessStepStatusId.DONE));
}
- context.PortalRepositories.Attach(context.Process);
+ context.ProcessRepositories.Attach(context.Process);
if (!context.Process.ReleaseLock())
{
context.Process.UpdateVersion();
}
}
- private static IEnumerable<(Guid, Action?, Action)> ModifyStepStatusRange(IEnumerable steps, ProcessStepStatusId processStepStatusId)
+ private static IEnumerable<(Guid, Action>?, Action>)> ModifyStepStatusRange(IEnumerable> steps, ProcessStepStatusId processStepStatusId)
+ where TProcessTypeId : struct, IConvertible
+ where TProcessStepTypeId : struct, IConvertible
{
using var enumerator = steps.GetEnumerator();
if (!enumerator.MoveNext())
diff --git a/src/processes/Processes.Library/ManualProcessStepData.cs b/src/framework/Framework.Processes.Library/Models/VerifyProcessData.cs
similarity index 63%
rename from src/processes/Processes.Library/ManualProcessStepData.cs
rename to src/framework/Framework.Processes.Library/Models/VerifyProcessData.cs
index ec0cd5768f..965bc66ccd 100644
--- a/src/processes/Processes.Library/ManualProcessStepData.cs
+++ b/src/framework/Framework.Processes.Library/Models/VerifyProcessData.cs
@@ -1,5 +1,4 @@
/********************************************************************************
- * Copyright (c) 2023 Microsoft and BMW Group AG
* Copyright (c) 2023 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
@@ -18,15 +17,13 @@
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/
-using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess;
-using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Entities;
-using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Enums;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Entities;
-namespace Org.Eclipse.TractusX.Portal.Backend.Processes.Library;
+namespace Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Models;
-public record ManualProcessStepData(
- ProcessStepTypeId? ProcessStepTypeId,
- Process Process,
- IEnumerable ProcessSteps,
- IPortalRepositories PortalRepositories
-);
+public record VerifyProcessData(
+ Process? Process,
+ IEnumerable>? ProcessSteps
+)
+where TProcessTypeId : struct, IConvertible
+where TProcessStepTypeId : struct, IConvertible;
diff --git a/src/framework/Framework.Processes.Library/README.md b/src/framework/Framework.Processes.Library/README.md
new file mode 100644
index 0000000000..d1f6f541d2
--- /dev/null
+++ b/src/framework/Framework.Processes.Library/README.md
@@ -0,0 +1,22 @@
+# Catena-X Portal Backend Framework Processes Library
+
+The Catena-X Portal Backend Framework Processes Library provides some base models.
+
+This content is produced and maintained by the Eclipse Tractus-X project.
+
+* Project home: https://projects.eclipse.org/projects/automotive.tractusx
+
+## Installation
+
+dotnet add package Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library
+
+## Source Code
+
+The project maintains the following source code repositories in the GitHub organization https://github.com/eclipse-tractusx:
+
+- https://github.com/eclipse-tractusx/portal-backend
+
+
+## License
+
+Distributed under the Apache 2.0 License.
diff --git a/src/framework/Framework.Processes.ProcessIdentity/Directory.Build.props b/src/framework/Framework.Processes.ProcessIdentity/Directory.Build.props
new file mode 100644
index 0000000000..f3653737f2
--- /dev/null
+++ b/src/framework/Framework.Processes.ProcessIdentity/Directory.Build.props
@@ -0,0 +1,25 @@
+
+
+
+
+ 2.14.0
+
+
+
diff --git a/src/portalbackend/PortalBackend.DBAccess/Models/VerifyProcessData.cs b/src/framework/Framework.Processes.ProcessIdentity/Extensions/ProcessIdentitySettings.cs
similarity index 72%
rename from src/portalbackend/PortalBackend.DBAccess/Models/VerifyProcessData.cs
rename to src/framework/Framework.Processes.ProcessIdentity/Extensions/ProcessIdentitySettings.cs
index 1f85415cf3..88de97e716 100644
--- a/src/portalbackend/PortalBackend.DBAccess/Models/VerifyProcessData.cs
+++ b/src/framework/Framework.Processes.ProcessIdentity/Extensions/ProcessIdentitySettings.cs
@@ -1,5 +1,5 @@
/********************************************************************************
- * Copyright (c) 2023 Contributors to the Eclipse Foundation
+ * Copyright (c) 2024 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
@@ -17,11 +17,12 @@
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/
-using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Entities;
+using System.ComponentModel.DataAnnotations;
-namespace Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Models;
+namespace Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.ProcessIdentity.Extensions;
-public record VerifyProcessData(
- Process? Process,
- IEnumerable? ProcessSteps
-);
+public class ProcessIdentitySettings
+{
+ [Required]
+ public Guid ProcessUserId { get; set; } = Guid.Empty;
+}
diff --git a/src/framework/Framework.Processes.ProcessIdentity/Framework.Processes.ProcessIdentity.csproj b/src/framework/Framework.Processes.ProcessIdentity/Framework.Processes.ProcessIdentity.csproj
new file mode 100644
index 0000000000..28769a7347
--- /dev/null
+++ b/src/framework/Framework.Processes.ProcessIdentity/Framework.Processes.ProcessIdentity.csproj
@@ -0,0 +1,69 @@
+
+
+
+ net8.0
+ enable
+ enable
+ Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.ProcessIdentity
+ Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.ProcessIdentity
+
+
+
+
+ Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.ProcessIdentity
+ Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.ProcessIdentity
+ TractusX
+ All content is the property of the respective authors or their employers. For more information regarding authorship of content, please consult the listed source code repository logs.
+
+ The Catena-X Portal Backend Framework library is a versatile .NET library that provides a set of powerful tools and utilities for common development tasks.
+ This package simplifies various aspects of your application, including database interactions, asynchronous programming, file I/O, LINQ operations, logging, and database seeding.
+
+ README.md
+ LICENSE
+ https://github.com/eclipse-tractusx/portal-backend
+ https://github.com/eclipse-tractusx/portal-backend
+ git
+
+ true
+
+
+ true
+
+
+ true
+ snupkg
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/processes/Processes.ProcessIdentity/IProcessIdentityDataBuilder.cs b/src/framework/Framework.Processes.ProcessIdentity/IProcessIdentityDataBuilder.cs
similarity index 81%
rename from src/processes/Processes.ProcessIdentity/IProcessIdentityDataBuilder.cs
rename to src/framework/Framework.Processes.ProcessIdentity/IProcessIdentityDataBuilder.cs
index b4b2974f48..0c058f88b4 100644
--- a/src/processes/Processes.ProcessIdentity/IProcessIdentityDataBuilder.cs
+++ b/src/framework/Framework.Processes.ProcessIdentity/IProcessIdentityDataBuilder.cs
@@ -17,10 +17,9 @@
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/
-using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Enums;
-using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Identities;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Identity;
-namespace Org.Eclipse.TractusX.Portal.Backend.Processes.ProcessIdentity;
+namespace Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.ProcessIdentity;
public interface IProcessIdentityDataBuilder : IIdentityData
{
diff --git a/src/processes/Processes.ProcessIdentity/IProcessIdentityDataDetermination.cs b/src/framework/Framework.Processes.ProcessIdentity/IProcessIdentityDataDetermination.cs
similarity index 92%
rename from src/processes/Processes.ProcessIdentity/IProcessIdentityDataDetermination.cs
rename to src/framework/Framework.Processes.ProcessIdentity/IProcessIdentityDataDetermination.cs
index 1ff5a00282..c468220ec8 100644
--- a/src/processes/Processes.ProcessIdentity/IProcessIdentityDataDetermination.cs
+++ b/src/framework/Framework.Processes.ProcessIdentity/IProcessIdentityDataDetermination.cs
@@ -17,7 +17,7 @@
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/
-namespace Org.Eclipse.TractusX.Portal.Backend.Processes.ProcessIdentity;
+namespace Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.ProcessIdentity;
public interface IProcessIdentityDataDetermination
{
diff --git a/src/framework/Framework.Processes.ProcessIdentity/README.md b/src/framework/Framework.Processes.ProcessIdentity/README.md
new file mode 100644
index 0000000000..6d09e7ec36
--- /dev/null
+++ b/src/framework/Framework.Processes.ProcessIdentity/README.md
@@ -0,0 +1,22 @@
+# Catena-X Portal Backend Framework Processes ProcessIdentity Library
+
+The Catena-X Portal Backend Framework Processes ProcessIdentity Library provides some base handling for process identities.
+
+This content is produced and maintained by the Eclipse Tractus-X project.
+
+* Project home: https://projects.eclipse.org/projects/automotive.tractusx
+
+## Installation
+
+dotnet add package Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.ProcessIdentity
+
+## Source Code
+
+The project maintains the following source code repositories in the GitHub organization https://github.com/eclipse-tractusx:
+
+- https://github.com/eclipse-tractusx/portal-backend
+
+
+## License
+
+Distributed under the Apache 2.0 License.
diff --git a/src/framework/Framework.Processes.Worker.Library/Directory.Build.props b/src/framework/Framework.Processes.Worker.Library/Directory.Build.props
new file mode 100644
index 0000000000..f3653737f2
--- /dev/null
+++ b/src/framework/Framework.Processes.Worker.Library/Directory.Build.props
@@ -0,0 +1,25 @@
+
+
+
+
+ 2.14.0
+
+
+
diff --git a/src/framework/Framework.Processes.Worker.Library/Framework.Processes.Worker.Library.csproj b/src/framework/Framework.Processes.Worker.Library/Framework.Processes.Worker.Library.csproj
new file mode 100644
index 0000000000..690adea2ac
--- /dev/null
+++ b/src/framework/Framework.Processes.Worker.Library/Framework.Processes.Worker.Library.csproj
@@ -0,0 +1,79 @@
+
+
+
+
+
+ Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Worker.Library
+ Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Worker.Library
+ net8.0
+ enable
+ enable
+
+
+
+
+ Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Worker.Library
+ Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Worker.Library
+ TractusX
+ All content is the property of the respective authors or their employers. For more information regarding authorship of content, please consult the listed source code repository logs.
+
+ The Catena-X Portal Backend Framework library is a versatile .NET library that provides a set of powerful tools and utilities for common development tasks.
+ This package simplifies various aspects of your application, including database interactions, asynchronous programming, file I/O, LINQ operations, logging, and database seeding.
+
+ README.md
+ LICENSE
+ https://github.com/eclipse-tractusx/portal-backend
+ https://github.com/eclipse-tractusx/portal-backend
+ git
+
+ true
+
+
+ true
+
+
+ true
+ snupkg
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/processes/Processes.Worker.Library/IProcessExecutor.cs b/src/framework/Framework.Processes.Worker.Library/IProcessExecutor.cs
similarity index 71%
rename from src/processes/Processes.Worker.Library/IProcessExecutor.cs
rename to src/framework/Framework.Processes.Worker.Library/IProcessExecutor.cs
index 3add06e9bc..dfef0e5b23 100644
--- a/src/processes/Processes.Worker.Library/IProcessExecutor.cs
+++ b/src/framework/Framework.Processes.Worker.Library/IProcessExecutor.cs
@@ -18,11 +18,11 @@
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/
-using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Enums;
+namespace Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Worker.Library;
-namespace Org.Eclipse.TractusX.Portal.Backend.Processes.Worker.Library;
-
-public interface IProcessExecutor
+public interface IProcessExecutor
+ where TProcessTypeId : struct, IConvertible
+ where TProcessStepTypeId : struct, IConvertible
{
enum ProcessExecutionResult
{
@@ -30,7 +30,8 @@ enum ProcessExecutionResult
LockRequested = 2,
Unmodified = 3
}
- IAsyncEnumerable ExecuteProcess(Guid processId, ProcessTypeId processTypeId, CancellationToken cancellationToken);
- IEnumerable GetRegisteredProcessTypeIds();
- IEnumerable GetExecutableStepTypeIds();
+
+ IAsyncEnumerable ExecuteProcess(Guid processId, TProcessTypeId processTypeId, CancellationToken cancellationToken);
+ IEnumerable GetRegisteredProcessTypeIds();
+ IEnumerable GetExecutableStepTypeIds();
}
diff --git a/src/processes/Processes.Worker.Library/IProcessTypeExecutor.cs b/src/framework/Framework.Processes.Worker.Library/IProcessTypeExecutor.cs
similarity index 53%
rename from src/processes/Processes.Worker.Library/IProcessTypeExecutor.cs
rename to src/framework/Framework.Processes.Worker.Library/IProcessTypeExecutor.cs
index 3487a64d48..db96f1df40 100644
--- a/src/processes/Processes.Worker.Library/IProcessTypeExecutor.cs
+++ b/src/framework/Framework.Processes.Worker.Library/IProcessTypeExecutor.cs
@@ -17,17 +17,20 @@
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/
-using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Enums;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Enums;
-namespace Org.Eclipse.TractusX.Portal.Backend.Processes.Worker.Library;
+namespace Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Worker.Library;
-public interface IProcessTypeExecutor
+public interface IProcessTypeExecutor
+ where TProcessTypeId : struct, IConvertible
+ where TProcessStepTypeId : struct, IConvertible
{
- record InitializationResult(bool Modified, IEnumerable? ScheduleStepTypeIds);
- record StepExecutionResult(bool Modified, ProcessStepStatusId ProcessStepStatusId, IEnumerable? ScheduleStepTypeIds, IEnumerable? SkipStepTypeIds, string? ProcessMessage);
+ record InitializationResult(bool Modified, IEnumerable? ScheduleStepTypeIds);
- ValueTask InitializeProcess(Guid processId, IEnumerable processStepTypeIds);
- ValueTask IsLockRequested(ProcessStepTypeId processStepTypeId);
+ record StepExecutionResult(bool Modified, ProcessStepStatusId ProcessStepStatusId, IEnumerable? ScheduleStepTypeIds, IEnumerable? SkipStepTypeIds, string? ProcessMessage);
+
+ ValueTask InitializeProcess(Guid processId, IEnumerable processStepTypeIds);
+ ValueTask IsLockRequested(TProcessStepTypeId processStepTypeId);
///
/// tbd
@@ -36,8 +39,9 @@ record StepExecutionResult(bool Modified, ProcessStepStatusId ProcessStepStatusI
///
///
///
- ValueTask ExecuteProcessStep(ProcessStepTypeId processStepTypeId, IEnumerable processStepTypeIds, CancellationToken cancellationToken);
- bool IsExecutableStepTypeId(ProcessStepTypeId processStepTypeId);
- ProcessTypeId GetProcessTypeId();
- IEnumerable GetExecutableStepTypeIds();
+ ValueTask ExecuteProcessStep(TProcessStepTypeId processStepTypeId, IEnumerable processStepTypeIds, CancellationToken cancellationToken);
+
+ bool IsExecutableStepTypeId(TProcessStepTypeId processStepTypeId);
+ TProcessTypeId GetProcessTypeId();
+ IEnumerable GetExecutableStepTypeIds();
}
diff --git a/src/processes/Processes.Worker.Library/ProcessExecutionService.cs b/src/framework/Framework.Processes.Worker.Library/ProcessExecutionService.cs
similarity index 81%
rename from src/processes/Processes.Worker.Library/ProcessExecutionService.cs
rename to src/framework/Framework.Processes.Worker.Library/ProcessExecutionService.cs
index d2a00a32d0..7d7a2a3a42 100644
--- a/src/processes/Processes.Worker.Library/ProcessExecutionService.cs
+++ b/src/framework/Framework.Processes.Worker.Library/ProcessExecutionService.cs
@@ -23,23 +23,24 @@
using Org.Eclipse.TractusX.Portal.Backend.Framework.DateTimeProvider;
using Org.Eclipse.TractusX.Portal.Backend.Framework.DBAccess;
using Org.Eclipse.TractusX.Portal.Backend.Framework.ErrorHandling;
-using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess;
-using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Repositories;
-using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Entities;
-using Org.Eclipse.TractusX.Portal.Backend.Processes.ProcessIdentity;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Context;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Entities;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.ProcessIdentity;
using System.Runtime.CompilerServices;
-namespace Org.Eclipse.TractusX.Portal.Backend.Processes.Worker.Library;
+namespace Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Worker.Library;
///
/// Service that reads all open/pending processSteps of a checklist and triggers their execution.
///
-public class ProcessExecutionService
+public class ProcessExecutionService
+ where TProcessTypeId : struct, IConvertible
+ where TProcessStepTypeId : struct, IConvertible
{
private readonly IServiceScopeFactory _serviceScopeFactory;
private readonly IDateTimeProvider _dateTimeProvider;
private readonly TimeSpan _lockExpiryTime;
- private readonly ILogger _logger;
+ private readonly ILogger> _logger;
///
/// Creates a new instance of
@@ -52,7 +53,7 @@ public ProcessExecutionService(
IServiceScopeFactory serviceScopeFactory,
IDateTimeProvider dateTimeProvider,
IOptions options,
- ILogger logger)
+ ILogger> logger)
{
_serviceScopeFactory = serviceScopeFactory;
_dateTimeProvider = dateTimeProvider;
@@ -69,16 +70,16 @@ public async Task ExecuteAsync(CancellationToken stoppingToken)
try
{
using var processServiceScope = _serviceScopeFactory.CreateScope();
- var executorRepositories = processServiceScope.ServiceProvider.GetRequiredService();
- var processExecutor = processServiceScope.ServiceProvider.GetRequiredService();
+ var executorRepositories = processServiceScope.ServiceProvider.GetRequiredService();
+ var processExecutor = processServiceScope.ServiceProvider.GetRequiredService>();
var processIdentityDataDetermination = processServiceScope.ServiceProvider.GetRequiredService();
//call processIdentityDataDetermination.GetIdentityData() once to initialize IdentityService IdentityData for synchronous use:
await processIdentityDataDetermination.GetIdentityData().ConfigureAwait(ConfigureAwaitOptions.None);
using var outerLoopScope = _serviceScopeFactory.CreateScope();
- var outerLoopRepositories = outerLoopScope.ServiceProvider.GetRequiredService();
+ var outerLoopRepositories = outerLoopScope.ServiceProvider.GetRequiredService();
- var activeProcesses = outerLoopRepositories.GetInstance().GetActiveProcesses(processExecutor.GetRegisteredProcessTypeIds(), processExecutor.GetExecutableStepTypeIds(), _dateTimeProvider.OffsetNow);
+ var activeProcesses = outerLoopRepositories.GetInstance>().GetActiveProcesses(processExecutor.GetRegisteredProcessTypeIds(), processExecutor.GetExecutableStepTypeIds(), _dateTimeProvider.OffsetNow);
await foreach (var process in activeProcesses.WithCancellation(stoppingToken).ConfigureAwait(false))
{
try
@@ -88,14 +89,15 @@ public async Task ExecuteAsync(CancellationToken stoppingToken)
_logger.LogInformation("skipping locked process {processId} type {processType}, lock expires at {lockExpireDate}", process.Id, process.ProcessTypeId, process.LockExpiryDate);
continue;
}
- _logger.LogInformation("start processing process {processId} type {processType}", process.Id, process.ProcessTypeId);
+ _logger.LogInformation("start processing process {processId} type {processType}", process.Id, process.ProcessTypeId);
await foreach (var hasChanged in ExecuteProcess(processExecutor, process, stoppingToken).ConfigureAwait(false))
{
if (hasChanged)
{
await executorRepositories.SaveAsync().ConfigureAwait(ConfigureAwaitOptions.None);
}
+
executorRepositories.Clear();
}
@@ -104,6 +106,7 @@ public async Task ExecuteAsync(CancellationToken stoppingToken)
await executorRepositories.SaveAsync().ConfigureAwait(ConfigureAwaitOptions.None);
executorRepositories.Clear();
}
+
_logger.LogInformation("finished processing process {processId}", process.Id);
}
catch (SystemException ex) when (ex is not OutOfMemoryException)
@@ -125,14 +128,14 @@ public async Task ExecuteAsync(CancellationToken stoppingToken)
}
}
- private async IAsyncEnumerable ExecuteProcess(IProcessExecutor processExecutor, Process process, [EnumeratorCancellation] CancellationToken cancellationToken)
+ private async IAsyncEnumerable ExecuteProcess(IProcessExecutor processExecutor, Process process, [EnumeratorCancellation] CancellationToken cancellationToken)
{
await foreach (var executionResult in processExecutor.ExecuteProcess(process.Id, process.ProcessTypeId, cancellationToken).ConfigureAwait(false))
{
yield return executionResult switch
{
- IProcessExecutor.ProcessExecutionResult.LockRequested => EnsureLock(process),
- IProcessExecutor.ProcessExecutionResult.SaveRequested => UpdateVersion(process),
+ IProcessExecutor.ProcessExecutionResult.LockRequested => EnsureLock(process),
+ IProcessExecutor.ProcessExecutionResult.SaveRequested => UpdateVersion(process),
_ => false
};
}
@@ -144,10 +147,12 @@ private bool EnsureLock(ILockableEntity entity)
{
return false;
}
+
if (!entity.TryLock(_dateTimeProvider.OffsetNow.Add(_lockExpiryTime)))
{
throw new UnexpectedConditionException("process TryLock should never fail here");
}
+
return true;
}
@@ -157,6 +162,7 @@ private static bool UpdateVersion(ILockableEntity entity)
{
entity.UpdateVersion();
}
+
return true;
}
}
diff --git a/src/processes/Processes.Worker.Library/ProcessExecutionServiceExtensions.cs b/src/framework/Framework.Processes.Worker.Library/ProcessExecutionServiceExtensions.cs
similarity index 56%
rename from src/processes/Processes.Worker.Library/ProcessExecutionServiceExtensions.cs
rename to src/framework/Framework.Processes.Worker.Library/ProcessExecutionServiceExtensions.cs
index 529cd42442..ccb8f13f40 100644
--- a/src/processes/Processes.Worker.Library/ProcessExecutionServiceExtensions.cs
+++ b/src/framework/Framework.Processes.Worker.Library/ProcessExecutionServiceExtensions.cs
@@ -1,5 +1,4 @@
/********************************************************************************
- * Copyright (c) 2022 BMW Group AG
* Copyright (c) 2022 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
@@ -21,17 +20,24 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Org.Eclipse.TractusX.Portal.Backend.Framework.DateTimeProvider;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Models.Validation;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Context;
-namespace Org.Eclipse.TractusX.Portal.Backend.Processes.Worker.Library;
+namespace Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Worker.Library;
public static class ProcessExecutionServiceExtensions
{
- public static IServiceCollection AddProcessExecutionService(this IServiceCollection services, IConfigurationSection section)
+ public static IServiceCollection AddProcessExecutionService(this IServiceCollection services, IConfigurationSection section)
+ where TProcessTypeId : struct, IConvertible
+ where TProcessStepTypeId : struct, IConvertible
{
- services.AddOptions().Bind(section);
+ services.AddOptions()
+ .Bind(section)
+ .EnvironmentalValidation(section);
services
- .AddTransient()
- .AddTransient()
+ .AddScoped>()
+ .AddTransient>()
+ .AddTransient, ProcessExecutor>()
.AddTransient();
return services;
}
diff --git a/src/processes/Processes.Worker.Library/ProcessExecutionServiceSettings.cs b/src/framework/Framework.Processes.Worker.Library/ProcessExecutionServiceSettings.cs
similarity index 93%
rename from src/processes/Processes.Worker.Library/ProcessExecutionServiceSettings.cs
rename to src/framework/Framework.Processes.Worker.Library/ProcessExecutionServiceSettings.cs
index e099f30ecc..0ac86abe33 100644
--- a/src/processes/Processes.Worker.Library/ProcessExecutionServiceSettings.cs
+++ b/src/framework/Framework.Processes.Worker.Library/ProcessExecutionServiceSettings.cs
@@ -20,7 +20,7 @@
using System.ComponentModel.DataAnnotations;
-namespace Org.Eclipse.TractusX.Portal.Backend.Processes.Worker.Library;
+namespace Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Worker.Library;
public class ProcessExecutionServiceSettings
{
diff --git a/src/processes/Processes.Worker.Library/ProcessExecutor.cs b/src/framework/Framework.Processes.Worker.Library/ProcessExecutor.cs
similarity index 62%
rename from src/processes/Processes.Worker.Library/ProcessExecutor.cs
rename to src/framework/Framework.Processes.Worker.Library/ProcessExecutor.cs
index 0a1f9a1cbd..9583f57691 100644
--- a/src/processes/Processes.Worker.Library/ProcessExecutor.cs
+++ b/src/framework/Framework.Processes.Worker.Library/ProcessExecutor.cs
@@ -21,31 +21,32 @@
using Microsoft.Extensions.Logging;
using Org.Eclipse.TractusX.Portal.Backend.Framework.Async;
using Org.Eclipse.TractusX.Portal.Backend.Framework.ErrorHandling;
-using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess;
-using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Repositories;
-using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Enums;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Context;
+using Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Library.Enums;
using System.Collections.Immutable;
using System.Runtime.CompilerServices;
-namespace Org.Eclipse.TractusX.Portal.Backend.Processes.Worker.Library;
+namespace Org.Eclipse.TractusX.Portal.Backend.Framework.Processes.Worker.Library;
-public class ProcessExecutor : IProcessExecutor
+public class ProcessExecutor : IProcessExecutor
+ where TProcessTypeId : struct, IConvertible
+ where TProcessStepTypeId : struct, IConvertible
{
- private readonly ImmutableDictionary _executors;
- private readonly IProcessStepRepository _processStepRepository;
- private readonly ILogger _logger;
+ private readonly ImmutableDictionary> _executors;
+ private readonly IProcessStepRepository _processStepRepository;
+ private readonly ILogger> _logger;
- public ProcessExecutor(IEnumerable executors, IPortalRepositories portalRepositories, ILogger logger)
+ public ProcessExecutor(IEnumerable> executors, IProcessRepositories processRepositories, ILogger> logger)
{
- _processStepRepository = portalRepositories.GetInstance();
+ _processStepRepository = processRepositories.GetInstance