From 9439e8c204f493ba53449091e54544215e6fa530 Mon Sep 17 00:00:00 2001 From: Lillie Dae <61380713+lillie-dae@users.noreply.github.com> Date: Mon, 5 Jun 2023 08:30:34 +0100 Subject: [PATCH] ac-2247 (#822) Signed-off-by: Lillie Dae --- .../Common/Services/WorkflowService.cs | 13 ------------- .../Services/WorkflowExecuterService.cs | 1 + 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/WorkflowManager/Common/Services/WorkflowService.cs b/src/WorkflowManager/Common/Services/WorkflowService.cs index 086c50c3a..788e1a98b 100644 --- a/src/WorkflowManager/Common/Services/WorkflowService.cs +++ b/src/WorkflowManager/Common/Services/WorkflowService.cs @@ -54,11 +54,6 @@ public async Task CreateAsync(Workflow workflow) { Guard.Against.Null(workflow); - foreach (var task in workflow.Tasks) - { - task.Args["workflow_name"] = workflow.Name; - } - var id = await _workflowRepository.CreateAsync(workflow); _logger.WorkflowCreated(id, workflow.Name); return id; @@ -76,14 +71,6 @@ public async Task CreateAsync(Workflow workflow) return null; } - if (isUpdateToWorkflowName) - { - foreach (var task in workflow.Tasks) - { - task.Args["workflow_name"] = workflow.Name; - } - } - var result = await _workflowRepository.UpdateAsync(workflow, existingWorkflow); _logger.WorkflowUpdated(id, workflow.Name); return result; diff --git a/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs b/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs index 5f9024f3e..3813b2234 100755 --- a/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs +++ b/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs @@ -743,6 +743,7 @@ private async Task DispatchTask(WorkflowInstance workflowInstance, Workflo AttachPatientMetaData(taskExec, payload.PatientDetails); } + taskExec.TaskPluginArguments["workflow_name"] = workflow!.Workflow!.Name; _logger.LogGeneralTaskDispatchInformation(workflowInstance.PayloadId, taskExec.TaskId, workflowInstance.Id, workflow?.Id, JsonConvert.SerializeObject(pathOutputArtifacts)); var taskDispatchEvent = EventMapper.ToTaskDispatchEvent(taskExec, workflowInstance, pathOutputArtifacts, correlationId, _storageConfiguration); var jsonMesssage = new JsonMessage(taskDispatchEvent, MessageBrokerConfiguration.WorkflowManagerApplicationId, taskDispatchEvent.CorrelationId, Guid.NewGuid().ToString());