Skip to content

Commit 89d6372

Browse files
committed
Merge branch 'master' into remove_reflection
2 parents 534ff22 + 3430a77 commit 89d6372

File tree

14 files changed

+45
-35
lines changed

14 files changed

+45
-35
lines changed

ReleaseNotes/1.6.6.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Workflow Core 1.6.6
2+
3+
* Added optional `Reference` parameter to StartWorkflow methods

WorkflowCore.sln

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 15
4-
VisualStudioVersion = 15.0.27130.2026
4+
VisualStudioVersion = 15.0.27130.2027
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{EF47161E-E399-451C-BDE8-E92AAD3BD761}"
77
EndProject
@@ -91,6 +91,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ReleaseNotes", "ReleaseNote
9191
ReleaseNotes\1.3.3.md = ReleaseNotes\1.3.3.md
9292
ReleaseNotes\1.4.0.md = ReleaseNotes\1.4.0.md
9393
ReleaseNotes\1.6.0.md = ReleaseNotes\1.6.0.md
94+
ReleaseNotes\1.6.6.md = ReleaseNotes\1.6.6.md
9495
EndProjectSection
9596
EndProject
9697
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WorkflowCore.Sample14", "src\samples\WorkflowCore.Sample14\WorkflowCore.Sample14.csproj", "{6BC66637-B42A-4334-ADFB-DBEC9F29D293}"

src/WorkflowCore/Interface/IWorkflowController.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ namespace WorkflowCore.Interface
77
{
88
public interface IWorkflowController
99
{
10-
Task<string> StartWorkflow(string workflowId, object data = null);
11-
Task<string> StartWorkflow(string workflowId, int? version, object data = null);
12-
Task<string> StartWorkflow<TData>(string workflowId, TData data = null) where TData : class, new();
13-
Task<string> StartWorkflow<TData>(string workflowId, int? version, TData data = null) where TData : class, new();
10+
Task<string> StartWorkflow(string workflowId, object data = null, string reference=null);
11+
Task<string> StartWorkflow(string workflowId, int? version, object data = null, string reference=null);
12+
Task<string> StartWorkflow<TData>(string workflowId, TData data = null, string reference=null) where TData : class, new();
13+
Task<string> StartWorkflow<TData>(string workflowId, int? version, TData data = null, string reference=null) where TData : class, new();
1414

1515
Task PublishEvent(string eventName, string eventKey, object eventData, DateTime? effectiveDate = null);
1616
void RegisterWorkflow<TWorkflow>() where TWorkflow : IWorkflow, new();

src/WorkflowCore/ServiceCollectionExtensions.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace Microsoft.Extensions.DependencyInjection
1616
{
1717
public static class ServiceCollectionExtensions
1818
{
19-
public static void AddWorkflow(this IServiceCollection services, Action<WorkflowOptions> setupAction = null)
19+
public static IServiceCollection AddWorkflow(this IServiceCollection services, Action<WorkflowOptions> setupAction = null)
2020
{
2121
if (services.Any(x => x.ServiceType == typeof(WorkflowOptions)))
2222
throw new InvalidOperationException("Workflow services already registered");
@@ -47,6 +47,8 @@ public static void AddWorkflow(this IServiceCollection services, Action<Workflow
4747
services.AddTransient<IDefinitionLoader, DefinitionLoader>();
4848

4949
services.AddTransient<Foreach>();
50+
51+
return services;
5052
}
5153
}
5254
}

src/WorkflowCore/Services/WorkflowController.cs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,23 @@ public WorkflowController(IPersistenceProvider persistenceStore, IDistributedLoc
2929
_logger = loggerFactory.CreateLogger<WorkflowController>();
3030
}
3131

32-
public Task<string> StartWorkflow(string workflowId, object data = null)
32+
public Task<string> StartWorkflow(string workflowId, object data = null, string reference=null)
3333
{
34-
return StartWorkflow(workflowId, null, data);
34+
return StartWorkflow(workflowId, null, data, reference);
3535
}
3636

37-
public Task<string> StartWorkflow(string workflowId, int? version, object data = null)
37+
public Task<string> StartWorkflow(string workflowId, int? version, object data = null, string reference=null)
3838
{
39-
return StartWorkflow<object>(workflowId, version, data);
39+
return StartWorkflow<object>(workflowId, version, data, reference);
4040
}
4141

42-
public Task<string> StartWorkflow<TData>(string workflowId, TData data = null)
42+
public Task<string> StartWorkflow<TData>(string workflowId, TData data = null, string reference=null)
4343
where TData : class, new()
4444
{
45-
return StartWorkflow<TData>(workflowId, null, data);
45+
return StartWorkflow<TData>(workflowId, null, data, reference);
4646
}
4747

48-
public async Task<string> StartWorkflow<TData>(string workflowId, int? version, TData data = null)
48+
public async Task<string> StartWorkflow<TData>(string workflowId, int? version, TData data = null, string reference=null)
4949
where TData : class, new()
5050
{
5151

@@ -63,7 +63,8 @@ public async Task<string> StartWorkflow<TData>(string workflowId, int? version,
6363
Description = def.Description,
6464
NextExecution = 0,
6565
CreateTime = DateTime.Now.ToUniversalTime(),
66-
Status = WorkflowStatus.Runnable
66+
Status = WorkflowStatus.Runnable,
67+
Reference = reference
6768
};
6869

6970
if ((def.DataType != null) && (data == null))

src/WorkflowCore/Services/WorkflowHost.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,27 +43,27 @@ public WorkflowHost(IPersistenceProvider persistenceStore, IQueueProvider queueP
4343
persistenceStore.EnsureStoreExists();
4444
}
4545

46-
public Task<string> StartWorkflow(string workflowId, object data = null)
46+
public Task<string> StartWorkflow(string workflowId, object data = null, string reference=null)
4747
{
48-
return _workflowController.StartWorkflow(workflowId, data);
48+
return _workflowController.StartWorkflow(workflowId, data, reference);
4949
}
5050

51-
public Task<string> StartWorkflow(string workflowId, int? version, object data = null)
51+
public Task<string> StartWorkflow(string workflowId, int? version, object data = null, string reference=null)
5252
{
53-
return _workflowController.StartWorkflow<object>(workflowId, version, data);
53+
return _workflowController.StartWorkflow<object>(workflowId, version, data, reference);
5454
}
5555

56-
public Task<string> StartWorkflow<TData>(string workflowId, TData data = null)
56+
public Task<string> StartWorkflow<TData>(string workflowId, TData data = null, string reference=null)
5757
where TData : class, new()
5858
{
59-
return _workflowController.StartWorkflow<TData>(workflowId, null, data);
59+
return _workflowController.StartWorkflow<TData>(workflowId, null, data, reference);
6060
}
6161

6262

63-
public Task<string> StartWorkflow<TData>(string workflowId, int? version, TData data = null)
63+
public Task<string> StartWorkflow<TData>(string workflowId, int? version, TData data = null, string reference=null)
6464
where TData : class, new()
6565
{
66-
return _workflowController.StartWorkflow(workflowId, version, data);
66+
return _workflowController.StartWorkflow(workflowId, version, data, reference);
6767
}
6868

6969
public Task PublishEvent(string eventName, string eventKey, object eventData, DateTime? effectiveDate = null)

src/WorkflowCore/WorkflowCore.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
1616
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
1717
<Description>Workflow Core is a light weight workflow engine targeting .NET Standard.</Description>
18-
<Version>1.6.5</Version>
19-
<AssemblyVersion>1.6.5.0</AssemblyVersion>
20-
<FileVersion>1.6.5.0</FileVersion>
18+
<Version>1.6.6</Version>
19+
<AssemblyVersion>1.6.6.0</AssemblyVersion>
20+
<FileVersion>1.6.6.0</FileVersion>
2121
<PackageReleaseNotes></PackageReleaseNotes>
2222
<PackageIconUrl>https://github.com/danielgerlag/workflow-core/raw/master/src/logo.png</PackageIconUrl>
2323
</PropertyGroup>

src/extensions/WorkflowCore.WebAPI/Controllers/WorkflowsController.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public async Task<IActionResult> Get(string id)
4545

4646
[HttpPost("{id}")]
4747
[HttpPost("{id}/{version}")]
48-
public async Task<IActionResult> Post(string id, int? version, [FromBody]JObject data)
48+
public async Task<IActionResult> Post(string id, int? version, string reference, [FromBody]JObject data)
4949
{
5050
string workflowId = null;
5151
var def = _registry.GetDefinition(id, version);
@@ -55,11 +55,11 @@ public async Task<IActionResult> Post(string id, int? version, [FromBody]JObject
5555
{
5656
var dataStr = JsonConvert.SerializeObject(data);
5757
var dataObj = JsonConvert.DeserializeObject(dataStr, def.DataType);
58-
workflowId = await _workflowHost.StartWorkflow(id, version, dataObj);
58+
workflowId = await _workflowHost.StartWorkflow(id, version, dataObj, reference);
5959
}
6060
else
6161
{
62-
workflowId = await _workflowHost.StartWorkflow(id, version, null);
62+
workflowId = await _workflowHost.StartWorkflow(id, version, null, reference);
6363
}
6464

6565
return Ok(workflowId);

src/samples/WorkflowCore.Sample01/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public static void Main(string[] args)
2222
host.RegisterWorkflow<HelloWorldWorkflow>();
2323
host.Start();
2424

25-
host.StartWorkflow("HelloWorld", 1, null);
25+
host.StartWorkflow("HelloWorld");
2626

2727
Console.ReadLine();
2828
host.Stop();

src/samples/WorkflowCore.Sample02/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public static void Main(string[] args)
2121
host.RegisterWorkflow<SimpleDecisionWorkflow>();
2222
host.Start();
2323

24-
host.StartWorkflow("Simple Decision Workflow", 1, null);
24+
host.StartWorkflow("Simple Decision Workflow");
2525

2626
Console.ReadLine();
2727
host.Stop();

0 commit comments

Comments
 (0)