From c33801de1f426bb737a330b2ab5990f5cd7db8a1 Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Fri, 29 Dec 2023 19:37:31 +0100 Subject: [PATCH] Add workflow result variable to context scope In the ExpressionExecutionContextExtensions module, an additional check and yield operation has been implemented. This allows the inclusion of the workflow result variable, if it exists, to the current context scope. --- .../Extensions/ExpressionExecutionContextExtensions.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/modules/Elsa.Workflows.Core/Extensions/ExpressionExecutionContextExtensions.cs b/src/modules/Elsa.Workflows.Core/Extensions/ExpressionExecutionContextExtensions.cs index 05d5d1d55..cb9dd853c 100644 --- a/src/modules/Elsa.Workflows.Core/Extensions/ExpressionExecutionContextExtensions.cs +++ b/src/modules/Elsa.Workflows.Core/Extensions/ExpressionExecutionContextExtensions.cs @@ -314,6 +314,12 @@ public static class ExpressionExecutionContextExtensions currentScope = currentScope.ParentContext; } + + if (context.TryGetWorkflowExecutionContext(out var workflowExecutionContext)) + { + if (workflowExecutionContext.Workflow.ResultVariable != null) + yield return workflowExecutionContext.Workflow.ResultVariable; + } } ///