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.
This commit is contained in:
Sipke Schoorstra 2021-07-09 19:39:45 +02:00
parent a93f40bfb3
commit eb378865cc

View file

@ -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