From 6d12ec61c163c76669eeb11fd8aaf3fba96b491a Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Thu, 20 May 2021 15:04:18 +0200 Subject: [PATCH] Do not return unnecessary Done outcome in case of explicitly defined outcomes Fixes #1018 --- src/core/Elsa.Abstractions/Services/CompositeActivity.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/core/Elsa.Abstractions/Services/CompositeActivity.cs b/src/core/Elsa.Abstractions/Services/CompositeActivity.cs index 9ba1ca191..e666cd2f1 100644 --- a/src/core/Elsa.Abstractions/Services/CompositeActivity.cs +++ b/src/core/Elsa.Abstractions/Services/CompositeActivity.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using System.ComponentModel; +using System.Linq; using System.Threading.Tasks; using Elsa.ActivityResults; using Elsa.Builders; @@ -65,7 +66,12 @@ namespace Elsa.Services if (finishOutput != null) { - outcomes.AddRange(finishOutput.Outcomes); + // If any outcomes were specified explicitly, we use them instead of Done. + var finishOutcomes = finishOutput.Outcomes.ToList(); + + if (finishOutcomes.Any()) + outcomes = finishOutcomes; + output = finishOutput.Output; }