File tree Expand file tree Collapse file tree 2 files changed +17
-5
lines changed Expand file tree Collapse file tree 2 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -227,7 +227,7 @@ private void DetermineNextExecutionTime(WorkflowInstance workflow)
227
227
if ( workflow . Status == WorkflowStatus . Complete )
228
228
return ;
229
229
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 ) )
231
231
{
232
232
if ( ! pointer . SleepUntil . HasValue )
233
233
{
@@ -238,7 +238,19 @@ private void DetermineNextExecutionTime(WorkflowInstance workflow)
238
238
long pointerSleep = pointer . SleepUntil . Value . ToUniversalTime ( ) . Ticks ;
239
239
workflow . NextExecution = Math . Min ( pointerSleep , workflow . NextExecution ?? pointerSleep ) ;
240
240
}
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
+
242
254
if ( ( workflow . NextExecution == null ) && ( workflow . ExecutionPointers . All ( x => x . EndTime != null ) ) )
243
255
{
244
256
workflow . Status = WorkflowStatus . Complete ;
Original file line number Diff line number Diff line change 18
18
<GenerateAssemblyCompanyAttribute >false</GenerateAssemblyCompanyAttribute >
19
19
<GenerateAssemblyProductAttribute >false</GenerateAssemblyProductAttribute >
20
20
<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 >
24
24
</PropertyGroup >
25
25
26
26
<ItemGroup >
You can’t perform that action at this time.
0 commit comments