Skip to content

Commit

Permalink
upgrade tooling
Browse files Browse the repository at this point in the history
refactor for readability
  • Loading branch information
danielgerlag committed Feb 28, 2017
1 parent 0e13848 commit 40b6086
Show file tree
Hide file tree
Showing 115 changed files with 1,542 additions and 2,001 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -242,4 +242,5 @@ ModelManifest.xml
.paket/paket.exe

# FAKE - F# Make
.fake/
.fake/
*.migration_in_place_backup
71 changes: 35 additions & 36 deletions WorkflowCore.sln
Original file line number Diff line number Diff line change
@@ -1,79 +1,78 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
# Visual Studio 15
VisualStudioVersion = 15.0.26206.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{EF47161E-E399-451C-BDE8-E92AAD3BD761}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{F6AC9AEB-24EF-475A-B190-AA4D9E01270A}"
ProjectSection(SolutionItems) = preProject
global.json = global.json
readme.md = readme.md
EndProjectSection
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WorkflowCore", "src\WorkflowCore\WorkflowCore.xproj", "{B7B2EA4D-E7F0-43E2-942A-3A5AA8F57272}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{5080DB09-CBE8-4C45-9957-C3BB7651755E}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "providers", "providers", "{2EEE6ABD-EE9B-473F-AF2D-6DABB85D7BA2}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WorkflowCore.Persistence.MongoDB", "src\providers\WorkflowCore.Persistence.MongoDB\WorkflowCore.Persistence.MongoDB.xproj", "{DD26E7B4-9D3A-4E1E-8585-862DB6DE21EB}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{E6CEAD8D-F565-471E-A0DC-676F54EAEDEB}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WorkflowCore.Sample01", "src\samples\WorkflowCore.Sample01\WorkflowCore.Sample01.xproj", "{660FEDAB-D085-476B-9E16-73E42F66DB4F}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "extensions", "extensions", "{6803696C-B19A-4B27-9193-082A02B6F205}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WorkflowCore.Sample02", "src\samples\WorkflowCore.Sample02\WorkflowCore.Sample02.xproj", "{BC6F28F1-9F47-4FFE-AD06-2B74CB89E76B}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WorkflowCore", "src\WorkflowCore\WorkflowCore.csproj", "{B7B2EA4D-E7F0-43E2-942A-3A5AA8F57272}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WorkflowCore.Sample03", "src\samples\WorkflowCore.Sample03\WorkflowCore.Sample03.xproj", "{FB738255-0304-4A25-B256-22E36EDF9507}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WorkflowCore.Persistence.MongoDB", "src\providers\WorkflowCore.Persistence.MongoDB\WorkflowCore.Persistence.MongoDB.csproj", "{DD26E7B4-9D3A-4E1E-8585-862DB6DE21EB}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WorkflowCore.Sample04", "src\samples\WorkflowCore.Sample04\WorkflowCore.Sample04.xproj", "{91301F52-E589-499E-97DE-91FA074B790C}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WorkflowCore.Sample01", "src\samples\WorkflowCore.Sample01\WorkflowCore.Sample01.csproj", "{660FEDAB-D085-476B-9E16-73E42F66DB4F}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WorkflowCore.Sample05", "src\samples\WorkflowCore.Sample05\WorkflowCore.Sample05.xproj", "{68883A5C-BD59-404D-A394-18104D6F472C}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WorkflowCore.Sample02", "src\samples\WorkflowCore.Sample02\WorkflowCore.Sample02.csproj", "{BC6F28F1-9F47-4FFE-AD06-2B74CB89E76B}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WorkflowCore.Persistence.EntityFramework", "src\providers\WorkflowCore.Persistence.EntityFramework\WorkflowCore.Persistence.EntityFramework.xproj", "{FE54AD67-817A-4CC6-A9EF-C9F7A5122CA4}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WorkflowCore.Sample03", "src\samples\WorkflowCore.Sample03\WorkflowCore.Sample03.csproj", "{FB738255-0304-4A25-B256-22E36EDF9507}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WorkflowCore.Persistence.SqlServer", "src\providers\WorkflowCore.Persistence.SqlServer\WorkflowCore.Persistence.SqlServer.xproj", "{1DE96D4F-F2CA-4740-8764-BADD1000040A}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WorkflowCore.Sample04", "src\samples\WorkflowCore.Sample04\WorkflowCore.Sample04.csproj", "{91301F52-E589-499E-97DE-91FA074B790C}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WorkflowCore.Persistence.PostgreSQL", "src\providers\WorkflowCore.Persistence.PostgreSQL\WorkflowCore.Persistence.PostgreSQL.xproj", "{9274B938-3996-4FBA-AE2F-0C82009B1116}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WorkflowCore.Sample05", "src\samples\WorkflowCore.Sample05\WorkflowCore.Sample05.csproj", "{68883A5C-BD59-404D-A394-18104D6F472C}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WorkflowCore.Persistence.Sqlite", "src\providers\WorkflowCore.Persistence.Sqlite\WorkflowCore.Persistence.Sqlite.xproj", "{86BC1E05-E9CE-4E53-B324-885A2FDBCE74}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WorkflowCore.Persistence.EntityFramework", "src\providers\WorkflowCore.Persistence.EntityFramework\WorkflowCore.Persistence.EntityFramework.csproj", "{FE54AD67-817A-4CC6-A9EF-C9F7A5122CA4}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WorkflowCore.LockProviders.Redlock", "src\providers\WorkflowCore.LockProviders.Redlock\WorkflowCore.LockProviders.Redlock.xproj", "{05250D58-A59E-4212-8D55-E7BC0396E9F5}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WorkflowCore.Persistence.SqlServer", "src\providers\WorkflowCore.Persistence.SqlServer\WorkflowCore.Persistence.SqlServer.csproj", "{1DE96D4F-F2CA-4740-8764-BADD1000040A}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WorkflowCore.LockProviders.ZooKeeper", "src\providers\WorkflowCore.LockProviders.ZooKeeper\WorkflowCore.LockProviders.ZooKeeper.xproj", "{3BBA51EE-765A-4772-A940-7F853E1010FC}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WorkflowCore.Persistence.PostgreSQL", "src\providers\WorkflowCore.Persistence.PostgreSQL\WorkflowCore.Persistence.PostgreSQL.csproj", "{9274B938-3996-4FBA-AE2F-0C82009B1116}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WorkflowCore.QueueProviders.RabbitMQ", "src\providers\WorkflowCore.QueueProviders.RabbitMQ\WorkflowCore.QueueProviders.RabbitMQ.xproj", "{AFAD87C7-B2EE-451E-BA7E-3F5A91358C48}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WorkflowCore.Persistence.Sqlite", "src\providers\WorkflowCore.Persistence.Sqlite\WorkflowCore.Persistence.Sqlite.csproj", "{86BC1E05-E9CE-4E53-B324-885A2FDBCE74}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WorkflowCore.Sample06", "src\samples\WorkflowCore.Sample06\WorkflowCore.Sample06.xproj", "{8FEAFD74-C304-4F75-BA38-4686BE55C891}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WorkflowCore.LockProviders.Redlock", "src\providers\WorkflowCore.LockProviders.Redlock\WorkflowCore.LockProviders.Redlock.csproj", "{05250D58-A59E-4212-8D55-E7BC0396E9F5}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{E6CEAD8D-F565-471E-A0DC-676F54EAEDEB}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WorkflowCore.LockProviders.ZooKeeper", "src\providers\WorkflowCore.LockProviders.ZooKeeper\WorkflowCore.LockProviders.ZooKeeper.csproj", "{3BBA51EE-765A-4772-A940-7F853E1010FC}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WorkflowCore.UnitTests", "test\WorkflowCore.UnitTests\WorkflowCore.UnitTests.xproj", "{37B598A8-B054-4ABA-884D-96AEF2511600}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WorkflowCore.QueueProviders.RabbitMQ", "src\providers\WorkflowCore.QueueProviders.RabbitMQ\WorkflowCore.QueueProviders.RabbitMQ.csproj", "{AFAD87C7-B2EE-451E-BA7E-3F5A91358C48}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WorkflowCore.TestAssets", "test\WorkflowCore.TestAssets\WorkflowCore.TestAssets.xproj", "{17C270A8-EC88-4883-9318-74BB28EFF508}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WorkflowCore.Sample06", "src\samples\WorkflowCore.Sample06\WorkflowCore.Sample06.csproj", "{8FEAFD74-C304-4F75-BA38-4686BE55C891}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WorkflowCore.Sample07", "src\samples\WorkflowCore.Sample07\WorkflowCore.Sample07.xproj", "{0631B4BA-D5DD-4C9E-8842-0D370A3D714A}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WorkflowCore.UnitTests", "test\WorkflowCore.UnitTests\WorkflowCore.UnitTests.csproj", "{37B598A8-B054-4ABA-884D-96AEF2511600}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WorkflowCore.QueueProviders.ZeroMQ", "src\providers\WorkflowCore.QueueProviders.ZeroMQ\WorkflowCore.QueueProviders.ZeroMQ.xproj", "{F33E89F6-BC8A-4E11-BEA1-C9A80E815DE8}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WorkflowCore.TestAssets", "test\WorkflowCore.TestAssets\WorkflowCore.TestAssets.csproj", "{17C270A8-EC88-4883-9318-74BB28EFF508}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WorkflowCore.LockProviders.ZeroMQ", "src\providers\WorkflowCore.LockProviders.ZeroMQ\WorkflowCore.LockProviders.ZeroMQ.xproj", "{4DC2200D-BA4F-4508-8426-F0CAE5EE90B5}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WorkflowCore.Sample07", "src\samples\WorkflowCore.Sample07\WorkflowCore.Sample07.csproj", "{0631B4BA-D5DD-4C9E-8842-0D370A3D714A}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WorkflowCore.Tests.ZeroMQ", "test\WorkflowCore.Tests.ZeroMQ\WorkflowCore.Tests.ZeroMQ.xproj", "{15FB5CB9-075B-4A54-98EC-2A1F5C40BE48}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WorkflowCore.QueueProviders.ZeroMQ", "src\providers\WorkflowCore.QueueProviders.ZeroMQ\WorkflowCore.QueueProviders.ZeroMQ.csproj", "{F33E89F6-BC8A-4E11-BEA1-C9A80E815DE8}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ScratchPad", "test\ScratchPad\ScratchPad.xproj", "{6B1C4B1E-AB43-4E87-A137-3AD9F534F059}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WorkflowCore.LockProviders.ZeroMQ", "src\providers\WorkflowCore.LockProviders.ZeroMQ\WorkflowCore.LockProviders.ZeroMQ.csproj", "{4DC2200D-BA4F-4508-8426-F0CAE5EE90B5}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WorkflowCore.IntegrationTests", "test\WorkflowCore.IntegrationTests\WorkflowCore.IntegrationTests.xproj", "{9162B6AD-AD06-4C64-9032-0E727643B1B9}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WorkflowCore.Tests.ZeroMQ", "test\WorkflowCore.Tests.ZeroMQ\WorkflowCore.Tests.ZeroMQ.csproj", "{15FB5CB9-075B-4A54-98EC-2A1F5C40BE48}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WorkflowCore.Tests.MongoDB", "test\WorkflowCore.Tests.MongoDB\WorkflowCore.Tests.MongoDB.xproj", "{58EC09C7-EC0A-4708-9B6F-FBE6243CEB49}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ScratchPad", "test\ScratchPad\ScratchPad.csproj", "{6B1C4B1E-AB43-4E87-A137-3AD9F534F059}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WorkflowCore.Tests.PostgreSQL", "test\WorkflowCore.Tests.PostgreSQL\WorkflowCore.Tests.PostgreSQL.xproj", "{8C2BD4D2-43EC-4930-9364-CDA938C01803}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WorkflowCore.IntegrationTests", "test\WorkflowCore.IntegrationTests\WorkflowCore.IntegrationTests.csproj", "{9162B6AD-AD06-4C64-9032-0E727643B1B9}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WorkflowCore.Users", "src\extensions\WorkflowCore.Users\WorkflowCore.Users.xproj", "{4C4DE624-9D91-484F-8BF7-2D71264EAB8B}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WorkflowCore.Tests.MongoDB", "test\WorkflowCore.Tests.MongoDB\WorkflowCore.Tests.MongoDB.csproj", "{58EC09C7-EC0A-4708-9B6F-FBE6243CEB49}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "extensions", "extensions", "{6803696C-B19A-4B27-9193-082A02B6F205}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WorkflowCore.Tests.PostgreSQL", "test\WorkflowCore.Tests.PostgreSQL\WorkflowCore.Tests.PostgreSQL.csproj", "{8C2BD4D2-43EC-4930-9364-CDA938C01803}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WorkflowCore.Sample08", "src\samples\WorkflowCore.Sample08\WorkflowCore.Sample08.xproj", "{ED5074AF-A09E-4357-A419-FE3476C0FAE7}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WorkflowCore.Users", "src\extensions\WorkflowCore.Users\WorkflowCore.Users.csproj", "{4C4DE624-9D91-484F-8BF7-2D71264EAB8B}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WorkflowCore.WebAPI", "src\extensions\WorkflowCore.WebAPI\WorkflowCore.WebAPI.xproj", "{FBF8D151-A3BF-4EB3-8F80-D71618696362}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WorkflowCore.Sample08", "src\samples\WorkflowCore.Sample08\WorkflowCore.Sample08.csproj", "{ED5074AF-A09E-4357-A419-FE3476C0FAE7}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WorkflowCore.WebAPI", "src\extensions\WorkflowCore.WebAPI\WorkflowCore.WebAPI.csproj", "{FBF8D151-A3BF-4EB3-8F80-D71618696362}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -198,9 +197,10 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{B7B2EA4D-E7F0-43E2-942A-3A5AA8F57272} = {EF47161E-E399-451C-BDE8-E92AAD3BD761}
{5080DB09-CBE8-4C45-9957-C3BB7651755E} = {EF47161E-E399-451C-BDE8-E92AAD3BD761}
{2EEE6ABD-EE9B-473F-AF2D-6DABB85D7BA2} = {EF47161E-E399-451C-BDE8-E92AAD3BD761}
{6803696C-B19A-4B27-9193-082A02B6F205} = {EF47161E-E399-451C-BDE8-E92AAD3BD761}
{B7B2EA4D-E7F0-43E2-942A-3A5AA8F57272} = {EF47161E-E399-451C-BDE8-E92AAD3BD761}
{DD26E7B4-9D3A-4E1E-8585-862DB6DE21EB} = {2EEE6ABD-EE9B-473F-AF2D-6DABB85D7BA2}
{660FEDAB-D085-476B-9E16-73E42F66DB4F} = {5080DB09-CBE8-4C45-9957-C3BB7651755E}
{BC6F28F1-9F47-4FFE-AD06-2B74CB89E76B} = {5080DB09-CBE8-4C45-9957-C3BB7651755E}
Expand All @@ -226,7 +226,6 @@ Global
{58EC09C7-EC0A-4708-9B6F-FBE6243CEB49} = {E6CEAD8D-F565-471E-A0DC-676F54EAEDEB}
{8C2BD4D2-43EC-4930-9364-CDA938C01803} = {E6CEAD8D-F565-471E-A0DC-676F54EAEDEB}
{4C4DE624-9D91-484F-8BF7-2D71264EAB8B} = {6803696C-B19A-4B27-9193-082A02B6F205}
{6803696C-B19A-4B27-9193-082A02B6F205} = {EF47161E-E399-451C-BDE8-E92AAD3BD761}
{ED5074AF-A09E-4357-A419-FE3476C0FAE7} = {5080DB09-CBE8-4C45-9957-C3BB7651755E}
{FBF8D151-A3BF-4EB3-8F80-D71618696362} = {6803696C-B19A-4B27-9193-082A02B6F205}
EndGlobalSection
Expand Down
7 changes: 1 addition & 6 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
{
"projects": [ "src", "test", "src/providers", "src/extensions" ],
"sdk": {
"version": "1.0.0-preview2-003131"
}
}
{"projects":["src","test","src/providers","src/extensions"]}
27 changes: 0 additions & 27 deletions src/WorkflowCore/ExtensionMethods.cs

This file was deleted.

9 changes: 9 additions & 0 deletions src/WorkflowCore/Interface/IBackgroundWorker.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

namespace WorkflowCore.Interface
{
public interface IBackgroundWorker
{
void Start();
void Stop();
}
}
7 changes: 7 additions & 0 deletions src/WorkflowCore/Interface/IPublishThread.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

namespace WorkflowCore.Interface
{
interface IPublishThread : IBackgroundWorker
{
}
}
7 changes: 7 additions & 0 deletions src/WorkflowCore/Interface/IRunnablePoller.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

namespace WorkflowCore.Interface
{
interface IRunnablePoller : IBackgroundWorker
{
}
}
7 changes: 7 additions & 0 deletions src/WorkflowCore/Interface/IWorkflowThread.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

namespace WorkflowCore.Interface
{
interface IWorkflowThread : IBackgroundWorker
{
}
}
14 changes: 14 additions & 0 deletions src/WorkflowCore/Models/WorkflowStep.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Threading.Tasks;
using WorkflowCore.Interface;

Expand Down Expand Up @@ -39,6 +40,19 @@ public virtual void AfterExecute(IWorkflowHost host, IPersistenceProvider persis
{
}

public virtual IStepBody ConstructBody(IServiceProvider serviceProvider)
{
IStepBody body = (serviceProvider.GetService(BodyType) as IStepBody);
if (body == null)
{
var stepCtor = BodyType.GetConstructor(new Type[] { });
if (stepCtor != null)
body = (stepCtor.Invoke(null) as IStepBody);
}

return body;
}

}

public enum ExecutionPipelineDirective { Next = 0, Defer = 1 }
Expand Down
5 changes: 5 additions & 0 deletions src/WorkflowCore/Models/WorkflowStepInline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,10 @@ namespace WorkflowCore.Models
public class WorkflowStepInline : WorkflowStep<InlineStepBody>
{
public Func<IStepExecutionContext, ExecutionResult> Body { get; set; }

public override IStepBody ConstructBody(IServiceProvider serviceProvider)
{
return new InlineStepBody(Body);
}
}
}
17 changes: 7 additions & 10 deletions src/WorkflowCore/ServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,18 @@ public static void AddWorkflow(this IServiceCollection services, Action<Workflow
if (setupAction != null)
setupAction.Invoke(options);
services.AddTransient<IPersistenceProvider>(options.PersistanceFactory);
services.AddTransient<IQueueProvider>(options.QueueFactory);
services.AddSingleton<IQueueProvider>(options.QueueFactory);
services.AddSingleton<IDistributedLockProvider>(options.LockFactory);
services.AddSingleton<IWorkflowRegistry, WorkflowRegistry>();
services.AddSingleton<WorkflowOptions>(options);

services.AddSingleton<IWorkflowHost, WorkflowHost>();

services.AddSingleton<IWorkflowHost, WorkflowHost>(sp =>
new WorkflowHost(sp.GetService<IPersistenceProvider>(),
sp.GetService<IQueueProvider>(),
options,
sp.GetService<ILoggerFactory>(),
sp,
sp.GetService<IWorkflowRegistry>(),
sp.GetService<IDistributedLockProvider>())
);
services.AddTransient<IWorkflowExecutor, WorkflowExecutor>();
services.AddTransient<IWorkflowBuilder, WorkflowBuilder>();
services.AddTransient<IWorkflowThread, WorkflowThread>();
services.AddTransient<IPublishThread, PublishThread>();
services.AddTransient<IRunnablePoller, RunnablePoller>();
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/WorkflowCore/Services/MemoryPersistenceProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

namespace WorkflowCore.Services
{
#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously
/// <summary>
/// In-memory implementation of IPersistenceProvider for demo and testing purposes
/// </summary>
Expand All @@ -18,6 +19,7 @@ public class MemoryPersistenceProvider : IPersistenceProvider
private static List<EventSubscription> _subscriptions = new List<EventSubscription>();
private static List<EventPublication> _unpublishedEvents = new List<EventPublication>();


public async Task<string> CreateNewWorkflow(WorkflowInstance workflow)
{
workflow.Id = Guid.NewGuid().ToString();
Expand Down Expand Up @@ -103,4 +105,5 @@ public async Task<IEnumerable<EventPublication>> GetUnpublishedEvents()
return _unpublishedEvents;
}
}
#pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously
}
Loading

0 comments on commit 40b6086

Please sign in to comment.