Skip to content

Commit 056c20a

Browse files
fix CaseFlow
1 parent 2334eee commit 056c20a

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Signum.Engine.Extensions/Workflow/CaseFlowLogic.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,14 @@ public static CaseFlow GetCaseFlow(CaseEntity @case)
4343
if (from is WorkflowActivityEntity wa)
4444
{
4545
var conns = wa.BoundaryTimers.Where(a => a.Type == WorkflowEventType.BoundaryInterruptingTimer)
46-
.SelectMany(e => gr.GetAllConnections(e, to, path => path.All(a => a.Type == ConnectionType.Normal)));
46+
.SelectMany(e => gr.GetAllConnections(e, to, path =>
47+
{
48+
if (prev.DoneDecision != null)
49+
return IsValidPath(DoneType.Timeout, prev.DoneDecision, path);
50+
51+
return path.All(a => a.Type == ConnectionType.Normal);
52+
}));
53+
4754
if (conns.Any())
4855
return conns.Select(c => new CaseConnectionStats().WithConnection(c).WithDone(prev));
4956
}
@@ -192,10 +199,10 @@ private static bool IsValidPath(DoneType doneType, string? doneDecision, Stack<W
192199
case DoneType.Next:
193200
case DoneType.ScriptSuccess:
194201
case DoneType.Recompose:
202+
case DoneType.Timeout:
195203
return path.All(a => a.Type == ConnectionType.Normal || doneDecision != null && (a.DoneDecision() == doneDecision));
196204
case DoneType.Jump: return path.All(a => a.Is(path.FirstEx()) ? a.Type == ConnectionType.Jump : a.Type == ConnectionType.Normal);
197205
case DoneType.ScriptFailure: return path.All(a => a.Is(path.FirstEx()) ? a.Type == ConnectionType.ScriptException : a.Type == ConnectionType.Normal);
198-
case DoneType.Timeout:
199206
default:
200207
throw new InvalidOperationException();
201208
}

0 commit comments

Comments
 (0)