Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions Framework/TaskOrchestrationContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ internal class TaskOrchestrationContext : OrchestrationContext
readonly IDictionary<int, OrchestratorAction> orchestratorActionsMap;
readonly TaskScheduler taskScheduler;
OrchestrationCompleteOrchestratorAction continueAsNew;
bool executionTerminated;
int idCounter;

public TaskOrchestrationContext(OrchestrationInstance orchestrationInstance, TaskScheduler taskScheduler)
Expand Down Expand Up @@ -340,12 +341,19 @@ public void HandleTimerFiredEvent(TimerFiredEvent timerFiredEvent)

public void HandleExecutionTerminatedEvent(ExecutionTerminatedEvent terminatedEvent)
{
CompleteOrchestration(terminatedEvent.Input, null, OrchestrationStatus.Terminated);
if (!executionTerminated)
{
executionTerminated = true;
CompleteOrchestration(terminatedEvent.Input, null, OrchestrationStatus.Terminated);
}
}

public void CompleteOrchestration(string result)
{
CompleteOrchestration(result, null, OrchestrationStatus.Completed);
if (!executionTerminated)
{
CompleteOrchestration(result, null, OrchestrationStatus.Completed);
}
}

public void FailOrchestration(Exception failure)
Expand Down