diff --git a/src/WorkflowExecuter/Services/WorkflowExecuterService.cs b/src/WorkflowExecuter/Services/WorkflowExecuterService.cs index 38f3564f6..055c0071e 100644 --- a/src/WorkflowExecuter/Services/WorkflowExecuterService.cs +++ b/src/WorkflowExecuter/Services/WorkflowExecuterService.cs @@ -239,6 +239,7 @@ public async Task ProcessTaskUpdate(TaskUpdateEvent message) if (message.Metadata.Any()) { currentTask.ResultMetadata = message.Metadata; + await _workflowInstanceRepository.UpdateTaskAsync(workflowInstance.Id, currentTask.TaskId, currentTask); } await HandleOutputArtifacts(workflowInstance, message.Outputs, currentTask); diff --git a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Features/TaskStatusUpdate.feature b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Features/TaskStatusUpdate.feature index 3b8d38773..832fe99da 100644 --- a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Features/TaskStatusUpdate.feature +++ b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Features/TaskStatusUpdate.feature @@ -29,10 +29,10 @@ Scenario Outline: Publish a valid Task Update event which updates the Task statu | Failed | | Canceled | -@TaskUpdate @ignore #Bug https://github.com/Project-MONAI/monai-deploy-workflow-manager/issues/279 +@TaskUpdate Scenario Outline: Publish a successful Task Update event which updates the Task status and copies the metadata Given I have a clinical workflow Task_Status_Update_Workflow - And I have a Workflow Instance WFI_Task_Status_Update + And I have a Workflow Instance WFI_Task_Status_Update with no artifacts When I publish a Task Update Message with status Succeeded Then I can see the status of the Task is updated And I can see the Metadata is copied to the workflow instance diff --git a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/StepDefinitions/TaskStatusUpdateStepDefinitions.cs b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/StepDefinitions/TaskStatusUpdateStepDefinitions.cs index c3b49fc3d..1ca800b0a 100644 --- a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/StepDefinitions/TaskStatusUpdateStepDefinitions.cs +++ b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/StepDefinitions/TaskStatusUpdateStepDefinitions.cs @@ -160,7 +160,7 @@ public void ThenTheMetadataIsCopied() } else { - taskUpdated?.ResultMetadata.Should().AllBeEquivalentTo(DataHelper.TaskUpdateEvent.Metadata); + taskUpdated?.ResultMetadata.Should().BeEquivalentTo(DataHelper.TaskUpdateEvent.Metadata); } }); }