From f10d33b77e7f21035008c5ac55105b4d913ef80a Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Mon, 22 Mar 2021 08:40:16 +0100 Subject: [PATCH] Fix Switch activity The Switch activity did not reset its state in full, causing it to not re-evaluate its branches when looping back onto it --- src/core/Elsa.Core/Activities/ControlFlow/Switch/Switch.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/Elsa.Core/Activities/ControlFlow/Switch/Switch.cs b/src/core/Elsa.Core/Activities/ControlFlow/Switch/Switch.cs index 729b34e1b..fdb959d0b 100644 --- a/src/core/Elsa.Core/Activities/ControlFlow/Switch/Switch.cs +++ b/src/core/Elsa.Core/Activities/ControlFlow/Switch/Switch.cs @@ -51,6 +51,7 @@ namespace Elsa.Activities.ControlFlow else { EnteredScope = false; + Evaluated = false; return Done(); } } @@ -76,6 +77,7 @@ namespace Elsa.Activities.ControlFlow var data = notification.WorkflowExecutionContext.WorkflowInstance.ActivityData.GetItem(notification.EvictedScope.Id, () => new JObject()); data.SetState(nameof(EnteredScope), false); + data.SetState(nameof(Evaluated), false); return Task.CompletedTask; }