Skip to content

Commit 1675ba7

Browse files
committed
don't run outputs on non proceed
1 parent 876d9a2 commit 1675ba7

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

src/WorkflowCore/ServiceCollectionExtensions.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@ public static class ServiceCollectionExtensions
1717
{
1818
public static void AddWorkflow(this IServiceCollection services, Action<WorkflowOptions> setupAction = null)
1919
{
20-
WorkflowOptions options = new WorkflowOptions();
21-
if (setupAction != null)
22-
setupAction.Invoke(options);
20+
if (services.Any(x => x.ServiceType == typeof(WorkflowOptions)))
21+
throw new InvalidOperationException("Workflow services already registered");
22+
23+
var options = new WorkflowOptions();
24+
setupAction?.Invoke(options);
2325
services.AddTransient<IPersistenceProvider>(options.PersistanceFactory);
2426
services.AddSingleton<IQueueProvider>(options.QueueFactory);
2527
services.AddSingleton<IDistributedLockProvider>(options.LockFactory);

src/WorkflowCore/Services/WorkflowExecutor.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ public async Task<WorkflowExecutorResult> Execute(WorkflowInstance workflow, Wor
102102

103103
var result = await body.RunAsync(context);
104104

105-
ProcessOutputs(workflow, step, body);
105+
if (result.Proceed)
106+
ProcessOutputs(workflow, step, body);
107+
106108
ProcessExecutionResult(workflow, def, pointer, step, result, wfResult);
107109
step.AfterExecute(wfResult, context, result, pointer);
108110
}

src/WorkflowCore/WorkflowCore.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
1919
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
2020
<Description>Workflow Core is a light weight workflow engine targeting .NET Standard.</Description>
21-
<Version>1.3.0</Version>
22-
<AssemblyVersion>1.3.0.0</AssemblyVersion>
23-
<FileVersion>1.3.0.0</FileVersion>
21+
<Version>1.3.1</Version>
22+
<AssemblyVersion>1.3.1.0</AssemblyVersion>
23+
<FileVersion>1.3.1.0</FileVersion>
2424
<PackageReleaseNotes></PackageReleaseNotes>
2525
</PropertyGroup>
2626

0 commit comments

Comments
 (0)