From eb378865cce66371aed97da4a5a99a6691e03aef Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Fri, 9 Jul 2021 19:39:45 +0200 Subject: [PATCH] Breaking behavior! Update OutcomeResult to NOT auto-connect to Done connections This was originally added to support workflows created with the workflow builder API to automatically move on to the next activity. This is discouraged and one should instead always create an explicit connection. The code being removed was causing a bug where the Done activity would always execute if there was a connection, even though the activity explicitly returned a different outcome. --- src/core/Elsa.Abstractions/ActivityResults/OutcomeResult.cs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/core/Elsa.Abstractions/ActivityResults/OutcomeResult.cs b/src/core/Elsa.Abstractions/ActivityResults/OutcomeResult.cs index b3041d0f7..11c80c3b8 100644 --- a/src/core/Elsa.Abstractions/ActivityResults/OutcomeResult.cs +++ b/src/core/Elsa.Abstractions/ActivityResults/OutcomeResult.cs @@ -29,12 +29,6 @@ namespace Elsa.ActivityResults var workflowExecutionContext = activityExecutionContext.WorkflowExecutionContext; var nextConnections = GetNextConnections(workflowExecutionContext, activityExecutionContext.ActivityBlueprint.Id, outcomes).ToList(); - // See if we got a "default" connection (from the current activity to the next activity via the default "Done" outcome). - // Unless the current activity is a "scope" activity, in which case it will schedule a Done outcome itself. - // TODO: This is another sign that we need to refactor activity scopes into a natural contained activity structure. - if (!outcomes.Contains(OutcomeNames.Done) && !nextConnections.Any() && activityExecutionContext.ActivityId != activityExecutionContext.CurrentScope?.ActivityId) - nextConnections = GetNextConnections(workflowExecutionContext, activityExecutionContext.ActivityId, new[] { OutcomeNames.Done }).ToList(); - var nextActivities = ( from connection in nextConnections