diff --git a/src/modules/Elsa.Workflows.Core/Contexts/WorkflowExecutionContext.cs b/src/modules/Elsa.Workflows.Core/Contexts/WorkflowExecutionContext.cs index b25bb012c..9c7ed3910 100644 --- a/src/modules/Elsa.Workflows.Core/Contexts/WorkflowExecutionContext.cs +++ b/src/modules/Elsa.Workflows.Core/Contexts/WorkflowExecutionContext.cs @@ -520,10 +520,10 @@ public partial class WorkflowExecutionContext : IExecutionContext if (Status == WorkflowStatus.Finished) FinishedAt = UpdatedAt; - + if (Status == WorkflowStatus.Finished || SubStatus == WorkflowSubStatus.Suspended) { - foreach (var registration in _cancellationRegistrations) + foreach (var registration in _cancellationRegistrations) registration.Dispose(); } } @@ -610,7 +610,7 @@ public partial class WorkflowExecutionContext : IExecutionContext WorkflowSubStatus.Suspended => WorkflowStatus.Running, _ => throw new ArgumentOutOfRangeException(nameof(subStatus), subStatus, null) }; - + // TODO: Check if we should not use the target subStatus here instead. private bool ValidateStatusTransition() {