Skip to content

Commit 4d45f3e

Browse files
author
Daniel Gerlag
committed
next execution time for control steps
1 parent 5c4d57b commit 4d45f3e

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

src/WorkflowCore/Services/WorkflowExecutor.cs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ private void DetermineNextExecutionTime(WorkflowInstance workflow)
227227
if (workflow.Status == WorkflowStatus.Complete)
228228
return;
229229

230-
foreach (var pointer in workflow.ExecutionPointers.Where(x => x.Active))
230+
foreach (var pointer in workflow.ExecutionPointers.Where(x => x.Active && (x.Children ?? new List<string>()).Count == 0))
231231
{
232232
if (!pointer.SleepUntil.HasValue)
233233
{
@@ -238,7 +238,19 @@ private void DetermineNextExecutionTime(WorkflowInstance workflow)
238238
long pointerSleep = pointer.SleepUntil.Value.ToUniversalTime().Ticks;
239239
workflow.NextExecution = Math.Min(pointerSleep, workflow.NextExecution ?? pointerSleep);
240240
}
241-
241+
242+
if (workflow.NextExecution == null)
243+
{
244+
foreach (var pointer in workflow.ExecutionPointers.Where(x => x.Active && (x.Children ?? new List<string>()).Count > 0))
245+
{
246+
if (workflow.ExecutionPointers.Where(x => pointer.Children.Contains(x.Id)).All(x => x.EndTime != null))
247+
{
248+
workflow.NextExecution = 0;
249+
return;
250+
}
251+
}
252+
}
253+
242254
if ((workflow.NextExecution == null) && (workflow.ExecutionPointers.All(x => x.EndTime != null)))
243255
{
244256
workflow.Status = WorkflowStatus.Complete;

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.2.0</Version>
22-
<AssemblyVersion>1.2.0.0</AssemblyVersion>
23-
<FileVersion>1.2.0.0</FileVersion>
21+
<Version>1.2.1</Version>
22+
<AssemblyVersion>1.2.1.0</AssemblyVersion>
23+
<FileVersion>1.2.1.0</FileVersion>
2424
</PropertyGroup>
2525

2626
<ItemGroup>

0 commit comments

Comments
 (0)