From 49715bb2a7792a002babc096a2f772d3fcae8556 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20Vasile=20Vu=C8=99can?= Date: Fri, 13 Dec 2024 12:18:15 +0200 Subject: [PATCH] Fixed issues that the outputs of a background actiity to not be mapped --- .../Services/BackgroundActivityInvoker.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/Elsa.Workflows.Runtime/Services/BackgroundActivityInvoker.cs b/src/modules/Elsa.Workflows.Runtime/Services/BackgroundActivityInvoker.cs index 13eafb8e7..c2541fe79 100644 --- a/src/modules/Elsa.Workflows.Runtime/Services/BackgroundActivityInvoker.cs +++ b/src/modules/Elsa.Workflows.Runtime/Services/BackgroundActivityInvoker.cs @@ -40,8 +40,8 @@ public class BackgroundActivityInvoker( await variablePersistenceManager.LoadVariablesAsync(workflowExecutionContext); activityExecutionContext.SetIsBackgroundExecution(); await activityInvoker.InvokeAsync(activityExecutionContext); - await ResumeWorkflowAsync(activityExecutionContext, scheduledBackgroundActivity); await variablePersistenceManager.SaveVariablesAsync(workflowExecutionContext); + await ResumeWorkflowAsync(activityExecutionContext, scheduledBackgroundActivity); } private async Task ResumeWorkflowAsync(ActivityExecutionContext activityExecutionContext, ScheduledBackgroundActivity scheduledBackgroundActivity) @@ -110,7 +110,7 @@ public class BackgroundActivityInvoker( var driver = variableMetadata?.StorageDriverType; // We only capture output written to the workflow itself. Other drivers like blob storage, etc. will be ignored since the foreground context will be loading those. - if (driver != typeof(WorkflowStorageDriver) && driver != typeof(WorkflowInstanceStorageDriver)) + if (driver != typeof(WorkflowStorageDriver) && driver != typeof(WorkflowInstanceStorageDriver) && driver != null) continue; var outputValue = activityExecutionContext.Get(memoryBlockReference);