diff --git a/src/Shared/Shared/ValidationConstants.cs b/src/Shared/Shared/ValidationConstants.cs
index 460d1e0a4..739532c27 100644
--- a/src/Shared/Shared/ValidationConstants.cs
+++ b/src/Shared/Shared/ValidationConstants.cs
@@ -48,11 +48,6 @@ public static class ValidationConstants
///
public static readonly string Mode = "mode";
- ///
- /// Key for the notifications.
- ///
- public static readonly string Notifications = "notifications";
-
public enum ModeValues
{
QA,
@@ -60,12 +55,6 @@ public enum ModeValues
Clinical
}
- public enum NotificationValues
- {
- True,
- False
- }
-
///
/// Required arguments to run the clinical review task workflow args.
///
diff --git a/src/WorkflowManager/WorkflowManager/Validators/WorkflowValidator.cs b/src/WorkflowManager/WorkflowManager/Validators/WorkflowValidator.cs
index d25a3352d..1f1ced29e 100644
--- a/src/WorkflowManager/WorkflowManager/Validators/WorkflowValidator.cs
+++ b/src/WorkflowManager/WorkflowManager/Validators/WorkflowValidator.cs
@@ -407,16 +407,6 @@ private void ValidateClinicalReviewRequiredFields(TaskObject[] tasks, TaskObject
return;
}
- if (!currentTask.Args.ContainsKey(Notifications))
- {
- Errors.Add($"Task: '{currentTask.Id}' notifications must be specified.");
- return;
- }
- else if (!Enum.TryParse(typeof(NotificationValues), currentTask.Args[Notifications], true, out var _))
- {
- Errors.Add($"Task: '{currentTask.Id}' notifications is incorrectly specified{Comma}please specify 'true' or 'false'");
- }
-
var reviewedTask = tasks.First(t => t.Id.ToLower() == currentTask.Args[ReviewedTaskId].ToLower());
if (reviewedTask.Type.Equals(ArgoTaskType, StringComparison.OrdinalIgnoreCase) is false)
diff --git a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Features/WorkflowApi.feature b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Features/WorkflowApi.feature
index 5e3643cca..1e9e21908 100644
--- a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Features/WorkflowApi.feature
+++ b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Features/WorkflowApi.feature
@@ -99,33 +99,31 @@ Scenario Outline: Update workflow with invalid details
Then I will get a 400 response
And I will receive the error message
Examples:
- | endpoint | put_body | message |
- | /workflows/1 | Basic_Workflow_1 | Failed to validate id, not a valid guid |
- | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Workflow_Missing_Name | Missing Workflow Name |
- | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Workflow_AETitle_Length | AeTitle is required in the InformaticsGateaway section and must be under 16 characters. |
- | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Workflow_TaskType | has an invalid type, please specify: argo, aide_clinical_review, router, export, docker |
- | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Workflow_TaskID_Content | Contains Invalid Characters. |
- | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Workflow_Unreferenced_Task | Found Task(s) without any task destinations to it |
- | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Workflow_Loopback_Task | Converging Tasks Destinations in task |
- | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Workflow_0_Tasks | Workflow does not contain Tasks, please review Workflow. |
- | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Workflow_Version_Null | Missing Workflow Version |
- | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Workflow_Version_Blank | Missing Workflow Version |
- | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Workflow_Body_Object | Missing InformaticsGateway section. |
+ | endpoint | put_body | message |
+ | /workflows/1 | Basic_Workflow_1 | Failed to validate id, not a valid guid |
+ | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Workflow_Missing_Name | Missing Workflow Name |
+ | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Workflow_AETitle_Length | AeTitle is required in the InformaticsGateaway section and must be under 16 characters. |
+ | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Workflow_TaskType | has an invalid type, please specify: argo, aide_clinical_review, router, export, docker |
+ | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Workflow_TaskID_Content | Contains Invalid Characters. |
+ | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Workflow_Unreferenced_Task | Found Task(s) without any task destinations to it |
+ | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Workflow_Loopback_Task | Converging Tasks Destinations in task |
+ | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Workflow_0_Tasks | Workflow does not contain Tasks, please review Workflow. |
+ | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Workflow_Version_Null | Missing Workflow Version |
+ | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Workflow_Version_Blank | Missing Workflow Version |
+ | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Workflow_Body_Object | Missing InformaticsGateway section. |
| /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Empty_Workflow_Body | Failed to validate workflow: Missing Workflow Name.;Missing Workflow Version.;Missing InformaticsGateway section.;Workflow does not contain Tasks, please review Workflow. |
- | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Workflow_Dup_Output | has multiple output names with the same value |
- | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Workflow_Missing_WorkflowName | workflow_template_name must be specified, this corresponds to an Argo template name. |
- | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Workflow_Missing_ReviewedTaskId | reviewed_task_id must be specified. |
- | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Workflow_Missing_All_Argo_Args | workflow_template_name must be specified, this corresponds to an Argo template name. |
- | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Workflow_Missing_2_Argo_Args_1 | workflow_template_name must be specified, this corresponds to an Argo template name. |
- | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Workflow_Missing_2_Argo_Args_2 | workflow_template_name must be specified, this corresponds to an Argo template name. |
- | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Workflow_Missing_2_Argo_Args_3 | workflow_template_name must be specified, this corresponds to an Argo template name. |
- | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Workflow_Incorrect_Clinical_Review_Artifact | Invalid input artifact 'test' in task 'Clinical_Review_Task': No matching task for ID 'mean-pixel-calc' |
- | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Workflow_Dup_Task_Id | Found duplicate task id 'liver-seg' |
- | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Workflow_Coverging_Task_Dest | Converging Tasks Destinations in tasks |
- | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Clinical_Review_Task_Id | 'clinical-review' reviewed_task_id: 'router' does not reference an Argo task. |
- | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Clinical_Review_Multiple_Argo_Inputs | Invalid input artifact 'Argo2' in task 'clinical-review': Task cannot reference a non-reviewed task artifacts 'argo-task-2' |
- | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Clinical_Review_Missing_Notifications | notifications must be specified |
- | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Clinical_Review_Invalid_Notifications | notifications is incorrectly specified |
+ | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Workflow_Dup_Output | has multiple output names with the same value |
+ | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Workflow_Missing_WorkflowName | workflow_template_name must be specified, this corresponds to an Argo template name. |
+ | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Workflow_Missing_ReviewedTaskId | reviewed_task_id must be specified. |
+ | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Workflow_Missing_All_Argo_Args | workflow_template_name must be specified, this corresponds to an Argo template name. |
+ | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Workflow_Missing_2_Argo_Args_1 | workflow_template_name must be specified, this corresponds to an Argo template name. |
+ | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Workflow_Missing_2_Argo_Args_2 | workflow_template_name must be specified, this corresponds to an Argo template name. |
+ | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Workflow_Missing_2_Argo_Args_3 | workflow_template_name must be specified, this corresponds to an Argo template name. |
+ | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Workflow_Incorrect_Clinical_Review_Artifact | Invalid input artifact 'test' in task 'Clinical_Review_Task': No matching task for ID 'mean-pixel-calc' |
+ | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Workflow_Dup_Task_Id | Found duplicate task id 'liver-seg' |
+ | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Workflow_Coverging_Task_Dest | Converging Tasks Destinations in tasks |
+ | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Clinical_Review_Task_Id | 'clinical-review' reviewed_task_id: 'router' does not reference an Argo task. |
+ | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Clinical_Review_Multiple_Argo_Inputs | Invalid input artifact 'Argo2' in task 'clinical-review': Task cannot reference a non-reviewed task artifacts 'argo-task-2' |
@UpdateWorkflows
@@ -152,13 +150,6 @@ Scenario: Add workflow with valid details
When I send a POST request
Then I will get a 201 response
-@AddWorkflows
-Scenario: Add workflow with valid details with clinical review task
- Given I have an endpoint /workflows
- And I have a workflow body Valid_Workflow_With_Clinical_Review
- When I send a POST request
- Then I will get a 201 response
-
@AddWorkflows
Scenario: Add workflow with valid empty details
Given I have an endpoint /workflows
@@ -174,32 +165,31 @@ Scenario Outline: Add workflow with invalid details
Then I will get a 400 response
And I will receive the error message
Examples:
- | post_body | message |
- | Invalid_Workflow_TaskType | has an invalid type, please specify: argo, aide_clinical_review, router, export, docker |
- | Invalid_Workflow_Missing_Name | Missing Workflow Name. |
- | Invalid_Workflow_AETitle_Length | AeTitle is required in the InformaticsGateaway section and must be under 16 characters. |
- | Invalid_Workflow_TaskID_Content | Contains Invalid Characters. |
- | Invalid_Workflow_Unreferenced_Task | Found Task(s) without any task destinations to it |
- | Invalid_Workflow_Loopback_Task | Converging Tasks Destinations in task |
- | Invalid_Workflow_0_Tasks | Workflow does not contain Tasks, please review Workflow. |
- | Invalid_Workflow_Version_Null | Missing Workflow Version |
- | Invalid_Workflow_Version_Blank | Missing Workflow Version |
- | Invalid_Workflow_Body_Object | Missing InformaticsGateway section. |
+ | post_body | message |
+ | Invalid_Workflow_TaskType | has an invalid type, please specify: argo, aide_clinical_review, router, export, docker |
+ | Invalid_Workflow_Missing_Name | Missing Workflow Name. |
+ | Invalid_Workflow_AETitle_Length | AeTitle is required in the InformaticsGateaway section and must be under 16 characters. |
+ | Invalid_Workflow_TaskID_Content | Contains Invalid Characters. |
+ | Invalid_Workflow_Unreferenced_Task | Found Task(s) without any task destinations to it |
+ | Invalid_Workflow_Loopback_Task | Converging Tasks Destinations in task |
+ | Invalid_Workflow_0_Tasks | Workflow does not contain Tasks, please review Workflow. |
+ | Invalid_Workflow_Version_Null | Missing Workflow Version |
+ | Invalid_Workflow_Version_Blank | Missing Workflow Version |
+ | Invalid_Workflow_Body_Object | Missing InformaticsGateway section. |
| Empty_Workflow_Body | Failed to validate workflow: Missing Workflow Name.;Missing Workflow Version.;Missing InformaticsGateway section.;Workflow does not contain Tasks, please review Workflow. |
- | Invalid_Workflow_Dup_Output | has multiple output names with the same value |
- | Invalid_Workflow_Missing_WorkflowName | workflow_template_name must be specified, this corresponds to an Argo template name. |
- | Invalid_Workflow_Missing_ReviewedTaskId | reviewed_task_id must be specified. |
- | Invalid_Workflow_Missing_All_Argo_Args | workflow_template_name must be specified, this corresponds to an Argo template name. |
- | Invalid_Workflow_Missing_2_Argo_Args_1 | workflow_template_name must be specified, this corresponds to an Argo template name. |
- | Invalid_Workflow_Missing_2_Argo_Args_2 | workflow_template_name must be specified, this corresponds to an Argo template name. |
- | Invalid_Workflow_Missing_2_Argo_Args_3 | workflow_template_name must be specified, this corresponds to an Argo template name. |
- | Invalid_Workflow_Incorrect_Clinical_Review_Artifact | Invalid input artifact 'test' in task 'Clinical_Review_Task': No matching task for ID 'mean-pixel-calc' |
- | Invalid_Workflow_Dup_Task_Id | Found duplicate task id 'liver-seg' |
- | Invalid_Workflow_Coverging_Task_Dest | Converging Tasks Destinations in tasks |
- | Invalid_Clinical_Review_Task_Id | 'clinical-review' reviewed_task_id: 'router' does not reference an Argo task. |
- | Invalid_Clinical_Review_Multiple_Argo_Inputs | Invalid input artifact 'Argo2' in task 'clinical-review': Task cannot reference a non-reviewed task artifacts 'argo-task-2' |
- | Invalid_Clinical_Review_Missing_Notifications | notifications must be specified |
- | Invalid_Clinical_Review_Invalid_Notifications | notifications is incorrectly specified |
+ | Invalid_Workflow_Dup_Output | has multiple output names with the same value |
+ | Invalid_Workflow_Missing_WorkflowName | workflow_template_name must be specified, this corresponds to an Argo template name. |
+ | Invalid_Workflow_Missing_ReviewedTaskId | reviewed_task_id must be specified. |
+ | Invalid_Workflow_Missing_All_Argo_Args | workflow_template_name must be specified, this corresponds to an Argo template name. |
+ | Invalid_Workflow_Missing_2_Argo_Args_1 | workflow_template_name must be specified, this corresponds to an Argo template name. |
+ | Invalid_Workflow_Missing_2_Argo_Args_2 | workflow_template_name must be specified, this corresponds to an Argo template name. |
+ | Invalid_Workflow_Missing_2_Argo_Args_3 | workflow_template_name must be specified, this corresponds to an Argo template name. |
+ | Invalid_Workflow_Incorrect_Clinical_Review_Artifact | Invalid input artifact 'test' in task 'Clinical_Review_Task': No matching task for ID 'mean-pixel-calc' |
+ | Invalid_Workflow_Dup_Task_Id | Found duplicate task id 'liver-seg' |
+ | Invalid_Workflow_Coverging_Task_Dest | Converging Tasks Destinations in tasks |
+ | Invalid_Clinical_Review_Task_Id | 'clinical-review' reviewed_task_id: 'router' does not reference an Argo task. |
+ | Invalid_Clinical_Review_Multiple_Argo_Inputs | Invalid input artifact 'Argo2' in task 'clinical-review': Task cannot reference a non-reviewed task artifacts 'argo-task-2' |
+
@AddWorkflows
Scenario Outline: Add workflow with duplicate workflow name
@@ -225,30 +215,28 @@ Scenario Outline: Validate workflow with invalid details
Then I will get a 400 response
And I will receive the error message
Examples:
- | post_body | message |
- | Invalid_Workflow_TaskType | has an invalid type, please specify: argo, aide_clinical_review, router, export, docker |
- | Invalid_Workflow_TaskID_Content | Contains Invalid Characters. |
- | Invalid_Workflow_Unreferenced_Task | Found Task(s) without any task destinations to it |
- | Invalid_Workflow_Loopback_Task | Converging Tasks Destinations in task |
- | Invalid_Workflow_0_Tasks | Workflow does not contain Tasks, please review Workflow. |
- | Invalid_Workflow_Version_Null | Missing Workflow Version |
- | Invalid_Workflow_Version_Blank | Missing Workflow Version |
- | Invalid_Workflow_Body_Object | Missing InformaticsGateway section. |
+ | post_body | message |
+ | Invalid_Workflow_TaskType | has an invalid type, please specify: argo, aide_clinical_review, router, export, docker |
+ | Invalid_Workflow_TaskID_Content | Contains Invalid Characters. |
+ | Invalid_Workflow_Unreferenced_Task | Found Task(s) without any task destinations to it |
+ | Invalid_Workflow_Loopback_Task | Converging Tasks Destinations in task |
+ | Invalid_Workflow_0_Tasks | Workflow does not contain Tasks, please review Workflow. |
+ | Invalid_Workflow_Version_Null | Missing Workflow Version |
+ | Invalid_Workflow_Version_Blank | Missing Workflow Version |
+ | Invalid_Workflow_Body_Object | Missing InformaticsGateway section. |
| Empty_Workflow_Body | Failed to validate workflow: Missing Workflow Name.;Missing Workflow Version.;Missing InformaticsGateway section.;Workflow does not contain Tasks, please review Workflow. |
- | Invalid_Workflow_Dup_Output | has multiple output names with the same value |
- | Invalid_Workflow_Missing_WorkflowName | workflow_template_name must be specified, this corresponds to an Argo template name. |
- | Invalid_Workflow_Missing_ReviewedTaskId | reviewed_task_id must be specified. |
- | Invalid_Workflow_Missing_All_Argo_Args | workflow_template_name must be specified, this corresponds to an Argo template name. |
- | Invalid_Workflow_Missing_2_Argo_Args_1 | workflow_template_name must be specified, this corresponds to an Argo template name. |
- | Invalid_Workflow_Missing_2_Argo_Args_2 | workflow_template_name must be specified, this corresponds to an Argo template name. |
- | Invalid_Workflow_Missing_2_Argo_Args_3 | workflow_template_name must be specified, this corresponds to an Argo template name. |
- | Invalid_Workflow_Incorrect_Clinical_Review_Artifact | Invalid input artifact 'test' in task 'Clinical_Review_Task': No matching task for ID 'mean-pixel-calc' |
- | Invalid_Workflow_Dup_Task_Id | Found duplicate task id 'liver-seg' |
- | Invalid_Workflow_Coverging_Task_Dest | Converging Tasks Destinations in tasks |
- | Invalid_Clinical_Review_Task_Id | 'clinical-review' reviewed_task_id: 'router' does not reference an Argo task. |
- | Invalid_Clinical_Review_Multiple_Argo_Inputs | Invalid input artifact 'Argo2' in task 'clinical-review': Task cannot reference a non-reviewed task artifacts 'argo-task-2' |
- | Invalid_Clinical_Review_Missing_Notifications | notifications must be specified |
- | Invalid_Clinical_Review_Invalid_Notifications | notifications is incorrectly specified |
+ | Invalid_Workflow_Dup_Output | has multiple output names with the same value |
+ | Invalid_Workflow_Missing_WorkflowName | workflow_template_name must be specified, this corresponds to an Argo template name. |
+ | Invalid_Workflow_Missing_ReviewedTaskId | reviewed_task_id must be specified. |
+ | Invalid_Workflow_Missing_All_Argo_Args | workflow_template_name must be specified, this corresponds to an Argo template name. |
+ | Invalid_Workflow_Missing_2_Argo_Args_1 | workflow_template_name must be specified, this corresponds to an Argo template name. |
+ | Invalid_Workflow_Missing_2_Argo_Args_2 | workflow_template_name must be specified, this corresponds to an Argo template name. |
+ | Invalid_Workflow_Missing_2_Argo_Args_3 | workflow_template_name must be specified, this corresponds to an Argo template name. |
+ | Invalid_Workflow_Incorrect_Clinical_Review_Artifact | Invalid input artifact 'test' in task 'Clinical_Review_Task': No matching task for ID 'mean-pixel-calc' |
+ | Invalid_Workflow_Dup_Task_Id | Found duplicate task id 'liver-seg' |
+ | Invalid_Workflow_Coverging_Task_Dest | Converging Tasks Destinations in tasks |
+ | Invalid_Clinical_Review_Task_Id | 'clinical-review' reviewed_task_id: 'router' does not reference an Argo task. |
+ | Invalid_Clinical_Review_Multiple_Argo_Inputs | Invalid input artifact 'Argo2' in task 'clinical-review': Task cannot reference a non-reviewed task artifacts 'argo-task-2' |
@DeleteWorkflows
Scenario: Delete a workflow with one revision
diff --git a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/StepDefinitions/WorkflowInstanceStepDefintions.cs b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/StepDefinitions/WorkflowInstanceStepDefintions.cs
index b31569f7e..fb01eb1fd 100644
--- a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/StepDefinitions/WorkflowInstanceStepDefintions.cs
+++ b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/StepDefinitions/WorkflowInstanceStepDefintions.cs
@@ -14,6 +14,7 @@
* limitations under the License.
*/
+using System.Globalization;
using BoDi;
using Monai.Deploy.Messaging.Events;
using Monai.Deploy.WorkflowManager.Contracts.Models;
diff --git a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/TestData/WorkflowObjectTestData.cs b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/TestData/WorkflowObjectTestData.cs
index 09b0d4424..a3198698d 100644
--- a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/TestData/WorkflowObjectTestData.cs
+++ b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/TestData/WorkflowObjectTestData.cs
@@ -1,1061 +1,1061 @@
-/*
- * Copyright 2022 MONAI Consortium
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-using Monai.Deploy.WorkflowManager.Contracts.Models;
-
-namespace Monai.Deploy.WorkflowManager.WorkflowExecutor.IntegrationTests.TestData
-{
- public class WorkflowObjectTestData
- {
- public string? Name { get; set; }
-
- public Workflow? Workflow { get; set; }
- }
-
- public static class WorkflowObjectsTestData
- {
- public static List TestData = new List()
- {
- new WorkflowObjectTestData()
- {
- Name = "Basic_Workflow_1",
- Workflow = new Workflow()
- {
- Name = "Basic update",
- Description = "Basic workflow update",
- Version = "1",
- Tasks = new TaskObject[]
- {
- new TaskObject
- {
- Id = "basic_id_with-legal-chars",
- Type = "router",
- Description = "Basic Workflow update Task update",
- Args = new Dictionary { { "test", "test" } },
- Artifacts = new ArtifactMap()
- {
- Input = new Artifact[] {},
- Output = new Artifact[] {}
- },
- TaskDestinations = new TaskDestination[] {}
- }
- },
- InformaticsGateway = new InformaticsGateway()
- {
- AeTitle = "Update",
- DataOrigins = new string[]{"test"},
- ExportDestinations = new string[]{"test"}
- }
- }
- },
- new WorkflowObjectTestData()
- {
- Name = "Basic_Workflow_2",
- Workflow = new Workflow()
- {
- Name = "Basic update",
- Description = "Basic workflow update",
- Version = "1",
- Tasks = new TaskObject[]
- {
- new TaskObject
- {
- Id = "basic_id_with-legal-chars",
- Type = "router",
- Description = "Basic Workflow update Task update",
- Artifacts = new ArtifactMap()
- {
- Input = new Artifact[] {}
- }
- }
- },
- InformaticsGateway = new InformaticsGateway()
- {
- AeTitle = "Update",
- ExportDestinations = new string[]{"test"}
- }
- }
- },
- new WorkflowObjectTestData()
- {
- Name = "Invalid_Workflow_Missing_Name",
- Workflow = new Workflow()
- {
- Name = "",
- Description = "Basic workflow 1",
- Version = "1",
- Tasks = new TaskObject[]
- {
- new TaskObject
- {
- Id = Guid.NewGuid().ToString(),
- Type = "router",
- Description = "Basic Workflow 1 Task 1",
- Artifacts = new ArtifactMap()
- {
- Input = new Artifact[] {},
- Output = new Artifact[] {}
- },
- Args = new Dictionary { { "test", "test" } }
- }
- },
- InformaticsGateway = new InformaticsGateway()
- {
- AeTitle = "Basic_AE",
- DataOrigins = new string[]{"test"},
- ExportDestinations = new string[]{"test"}
- }
- }
- },
- new WorkflowObjectTestData()
- {
- Name = "Invalid_Workflow_Desc_Length",
- Workflow = new Workflow()
- {
- Name = "Basic workflow",
- Description = "Over 200 chars dolor sit amet, consectetur adipiscing elit. Donec bibendum dapibus elit, quis tempus metus. Sed aliquam metus tempus pretium pharetra. Etiam a est id nunc tempor consectetur. Proin turpis.",
- Version = "1",
- Tasks = new TaskObject[]
- {
- new TaskObject
- {
- Id = Guid.NewGuid().ToString(),
- Type = "router",
- Description = "Basic Workflow 1 Task 1",
- Artifacts = new ArtifactMap()
- {
- Input = new Artifact[] {},
- Output = new Artifact[] {}
- },
- Args = new Dictionary { { "test", "test" } }
- }
- },
- InformaticsGateway = new InformaticsGateway()
- {
- AeTitle = "Basic_AE",
- DataOrigins = new string[]{"test"},
- ExportDestinations = new string[]{"test"}
- }
- }
- },
- new WorkflowObjectTestData()
- {
- Name = "Invalid_Workflow_Desc_Length",
- Workflow = new Workflow()
- {
- Name = "Inv_Desc",
- Description = "Over 200 chars dolor sit amet, consectetur adipiscing elit. Donec bibendum dapibus elit, quis tempus metus. Sed aliquam metus tempus pretium pharetra. Etiam a est id nunc tempor consectetur. Proin turpis.",
- Version = "1",
- Tasks = new TaskObject[]
- {
- new TaskObject
- {
- Id = Guid.NewGuid().ToString(),
- Type = "router",
- Description = "Basic Workflow 1 Task 1",
- Artifacts = new ArtifactMap()
- {
- Input = new Artifact[] {},
- Output = new Artifact[] {}
- },
- Args = new Dictionary { { "test", "test" } }
- }
- },
- InformaticsGateway = new InformaticsGateway()
- {
- AeTitle = "Basic_AE",
- DataOrigins = new string[]{"test"},
- ExportDestinations = new string[]{"test"}
- }
- }
- },
- new WorkflowObjectTestData()
- {
- Name = "Invalid_Workflow_AETitle_Length",
- Workflow = new Workflow()
- {
- Name = "Inv_AE",
- Description = "Inv_AE",
- Version = "1",
- Tasks = new TaskObject[]
- {
- new TaskObject
- {
- Id = Guid.NewGuid().ToString(),
- Type = "router",
- Description = "Basic Workflow 1 Task 1",
- Artifacts = new ArtifactMap()
- {
- Input = new Artifact[] {},
- Output = new Artifact[] {}
- },
- Args = new Dictionary { { "test", "test" } }
- }
- },
- InformaticsGateway = new InformaticsGateway()
- {
- AeTitle = "Over 15 characters",
- DataOrigins = new string[]{"test"},
- ExportDestinations = new string[]{"test"}
- }
- }
- },
- new WorkflowObjectTestData()
- {
- Name = "Invalid_Workflow_DataOrg",
- Workflow = new Workflow()
- {
- Name = "Inv_DataOrg",
- Description = "Inv_DataOrg",
- Version = "1",
- Tasks = new TaskObject[]
- {
- new TaskObject
- {
- Id = Guid.NewGuid().ToString(),
- Type = "router",
- Description = "Basic Workflow 1 Task 1",
- Artifacts = new ArtifactMap()
- {
- Input = new Artifact[] {},
- Output = new Artifact[] {}
- },
- Args = new Dictionary { { "test", "test" } }
- }
- },
- InformaticsGateway = new InformaticsGateway()
- {
- AeTitle = "Basic_AE",
- DataOrigins = new string[]{},
- ExportDestinations = new string[]{"test"}
- }
- }
- },
- new WorkflowObjectTestData()
- {
- Name = "Invalid_Workflow_ExportDest",
- Workflow = new Workflow()
- {
- Name = "Inv_ExpDest",
- Description = "Inv_ExpDest",
- Version = "1",
- Tasks = new TaskObject[]
- {
- new TaskObject
- {
- Id = Guid.NewGuid().ToString(),
- Type = "router",
- Description = "Basic Workflow 1 Task 1",
- Artifacts = new ArtifactMap()
- {
- Input = new Artifact[] {},
- Output = new Artifact[] {}
- },
- Args = new Dictionary { { "test", "test" } }
- }
- },
- InformaticsGateway = new InformaticsGateway()
- {
- AeTitle = "Basic_AE",
- DataOrigins = new string[]{"test"},
- ExportDestinations = new string[]{}
- }
- }
- },
- new WorkflowObjectTestData()
- {
- Name = "Invalid_Workflow_TaskDesc_Length",
- Workflow = new Workflow()
- {
- Name = "Inv_TaskDesc",
- Description = "Inv_TaskDesc",
- Version = "1",
- Tasks = new TaskObject[]
- {
- new TaskObject
- {
- Id = Guid.NewGuid().ToString(),
- Type = "router",
- Description = "Over 2000 chars dolor sit amet, consectetur adipiscing elit. Praesent eget consequat ante. Vivamus convallis porttitor vehicula. Proin turpis ante, fringilla nec sem sit amet, commodo tristique magna. Cras quam est, vehicula vitae tellus et, faucibus hendrerit lacus. Curabitur at ligula urna. Nam pretium felis et orci consectetur suscipit. In finibus arcu erat, quis congue libero finibus quis. Praesent mollis viverra arcu, vel finibus ligula auctor et. Phasellus ac lacus id tellus tempor porta. Sed quis nibh malesuada, consectetur sem sed, aliquam sapien. Mauris vehicula massa elit, vel varius massa fringilla non. Proin hendrerit dui nibh, ultrices egestas lacus ultrices ut. Vestibulum vitae nunc eget nunc hendrerit blandit. Nunc ut erat nisl. Sed condimentum gravida augue. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur vel mi congue, vehicula arcu quis, placerat ligula. In dapibus quam eget aliquam euismod. Praesent eget augue lacus. Aenean malesuada rhoncus fringilla. Sed non lectus nulla. Morbi maximus mi nec vulputate rhoncus. In sit amet ultrices massa. Duis a nunc congue, blandit purus non, dignissim nisl. In risus neque, fringilla sit amet laoreet vitae, aliquam et risus. In nec sem nulla. Aenean rutrum urna odio, et ornare diam pharetra nec. Cras suscipit diam vitae condimentum rutrum. Proin lacinia augue leo, et consectetur eros accumsan eget. Donec nec lacinia dui. Aenean imperdiet finibus volutpat. Proin scelerisque ante ligula, at faucibus odio bibendum vitae. Duis luctus arcu nibh, ac elementum libero ullamcorper id. Curabitur fermentum neque dui, ut suscipit ipsum pellentesque eu. Curabitur dapibus, magna egestas semper volutpat, ligula urna eleifend nunc, eget tristique lacus sapien in nisi. Etiam id bibendum purus. Proin dictum, orci in egestas faucibus, ipsum felis ullamcorper lectus, ac bibendum arcu arcu eu tellus. Aliquam a posuere nibh. Duis euismod magna a faucibus tempor. Vestibulum et lacus molestie.",
- Artifacts = new ArtifactMap()
- {
- Input = new Artifact[] {},
- Output = new Artifact[] {}
- },
- Args = new Dictionary { { "test", "test" } }
- }
- },
- InformaticsGateway = new InformaticsGateway()
- {
- AeTitle = "Basic_AE",
- DataOrigins = new string[]{"test"},
- ExportDestinations = new string[]{"test"}
- }
- }
- },
- new WorkflowObjectTestData()
- {
- Name = "Invalid_Workflow_TaskType",
- Workflow = new Workflow()
- {
- Name = "Inv_TaskType",
- Description = "Inv_TaskType",
- Version = "1",
- Tasks = new TaskObject[]
- {
- new TaskObject
- {
- Id = Guid.NewGuid().ToString(),
- Type = "Over 2000 chars dolor sit amet, consectetur adipiscing elit. Praesent eget consequat ante. Vivamus convallis porttitor vehicula. Proin turpis ante, fringilla nec sem sit amet, commodo tristique magna. Cras quam est, vehicula vitae tellus et, faucibus hendrerit lacus. Curabitur at ligula urna. Nam pretium felis et orci consectetur suscipit. In finibus arcu erat, quis congue libero finibus quis. Praesent mollis viverra arcu, vel finibus ligula auctor et. Phasellus ac lacus id tellus tempor porta. Sed quis nibh malesuada, consectetur sem sed, aliquam sapien. Mauris vehicula massa elit, vel varius massa fringilla non. Proin hendrerit dui nibh, ultrices egestas lacus ultrices ut. Vestibulum vitae nunc eget nunc hendrerit blandit. Nunc ut erat nisl. Sed condimentum gravida augue. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur vel mi congue, vehicula arcu quis, placerat ligula. In dapibus quam eget aliquam euismod. Praesent eget augue lacus. Aenean malesuada rhoncus fringilla. Sed non lectus nulla. Morbi maximus mi nec vulputate rhoncus. In sit amet ultrices massa. Duis a nunc congue, blandit purus non, dignissim nisl. In risus neque, fringilla sit amet laoreet vitae, aliquam et risus. In nec sem nulla. Aenean rutrum urna odio, et ornare diam pharetra nec. Cras suscipit diam vitae condimentum rutrum. Proin lacinia augue leo, et consectetur eros accumsan eget. Donec nec lacinia dui. Aenean imperdiet finibus volutpat. Proin scelerisque ante ligula, at faucibus odio bibendum vitae. Duis luctus arcu nibh, ac elementum libero ullamcorper id. Curabitur fermentum neque dui, ut suscipit ipsum pellentesque eu. Curabitur dapibus, magna egestas semper volutpat, ligula urna eleifend nunc, eget tristique lacus sapien in nisi. Etiam id bibendum purus. Proin dictum, orci in egestas faucibus, ipsum felis ullamcorper lectus, ac bibendum arcu arcu eu tellus. Aliquam a posuere nibh. Duis euismod magna a faucibus tempor. Vestibulum et lacus molestie.",
- Artifacts = new ArtifactMap()
- {
- Input = new Artifact[] {},
- Output = new Artifact[] {}
- },
- Description = "Basic Workflow 1 Task 1",
- Args = new Dictionary { { "test", "test" } }
- }
- },
- InformaticsGateway = new InformaticsGateway()
- {
- AeTitle = "Basic_AE",
- DataOrigins = new string[]{"test"},
- ExportDestinations = new string[]{"test"}
- }
- }
- },
- new WorkflowObjectTestData()
- {
- Name = "Invalid_Workflow_TaskArgs",
- Workflow = new Workflow()
- {
- Name = "Inv_TaskArgs",
- Description = "Inv_TaskArgs",
- Version = "1",
- Tasks = new TaskObject[]
- {
- new TaskObject
- {
- Id = Guid.NewGuid().ToString(),
- Type = "router",
- Description = "Basic Workflow 1 Task 1",
- Artifacts = new ArtifactMap()
- {
- Input = new Artifact[] {},
- Output = new Artifact[] {}
- },
- }
- },
- InformaticsGateway = new InformaticsGateway()
- {
- AeTitle = "Basic_AE",
- DataOrigins = new string[]{"test"},
- ExportDestinations = new string[]{"test"}
- }
- }
- },
- new WorkflowObjectTestData()
- {
- Name = "Invalid_Workflow_TaskID_Length",
- Workflow = new Workflow()
- {
- Name = "Inv_TaskID",
- Description = "Inv_TaskID",
- Version = "1",
- Tasks = new TaskObject[]
- {
- new TaskObject
- {
- Id = "Over 50 chars Lorem ipsum dolor sit amet consectetur adipiscing elit ligula",
- Type = "router",
- Artifacts = new ArtifactMap()
- {
- Input = new Artifact[] {},
- Output = new Artifact[] {}
- },
- Description = "Basic Workflow 1 Task 1",
- Args = new Dictionary { { "test", "test" } }
- }
- },
- InformaticsGateway = new InformaticsGateway()
- {
- AeTitle = "Basic_AE",
- DataOrigins = new string[]{"test"},
- ExportDestinations = new string[]{"test"}
- }
- }
- },
- new WorkflowObjectTestData()
- {
- Name = "Invalid_Workflow_TaskID_Content",
- Workflow = new Workflow()
- {
- Name = "Inv_TaskID",
- Description = "Inv_TaskID",
- Version = "1",
- Tasks = new TaskObject[]
- {
- new TaskObject
- {
- Id = "Invalid chars ./'#;][",
- Type = "router",
- Artifacts = new ArtifactMap()
- {
- Input = new Artifact[] {},
- Output = new Artifact[] {}
- },
- Description = "Basic Workflow 1 Task 1",
- Args = new Dictionary { { "test", "test" } }
- }
- },
- InformaticsGateway = new InformaticsGateway()
- {
- AeTitle = "Basic_AE",
- DataOrigins = new string[]{"test"},
- ExportDestinations = new string[]{"test"}
- }
- }
- },
- new WorkflowObjectTestData()
- {
- Name = "Invalid_Workflow_Unreferenced_Task",
- Workflow = new Workflow()
- {
- Name = "Artifact 1",
- Description = "Artifact 1",
- Version = "1",
- Tasks = new TaskObject[]
- {
- new TaskObject
- {
- Id = "artifact_task_1",
- Type = "Artifact_task",
- Description = "Artifact Workflow 1 Task 1",
- Args = new Dictionary { { "test", "test" } },
- Artifacts = new ArtifactMap()
- {
- Input = new Artifact[]
- {
- new Artifact { Name = "Dicom", Value = "{{ context.input.dicom }}" },
- },
- },
- },
- new TaskObject
- {
- Id = "artifact_task_2",
- Type = "Artifact_task",
- Description = "Artifact Workflow 1 Task 2",
- Args = new Dictionary { { "test", "test" } },
- Artifacts = new ArtifactMap()
- {
- Input = new Artifact[]
- {
- new Artifact
- {
- Name = "output",
- Value = "{{ context.executions.artifact_task_1.output_dir }}",
- Mandatory = true
- },
- },
- },
- },
- },
- InformaticsGateway = new InformaticsGateway()
- {
- AeTitle = "Artifact_AE",
- ExportDestinations = new string[]{"test"},
- DataOrigins = new string[]{"test"},
- }
- }
- },
- new WorkflowObjectTestData()
- {
- Name = "Invalid_Workflow_Loopback_Task",
- Workflow = new Workflow()
- {
- Name = "Artifact 1",
- Description = "Artifact 1",
- Version = "1",
- Tasks = new TaskObject[]
- {
- new TaskObject
- {
- Id = "artifact_task_1",
- Type = "Artifact_task",
- Description = "Artifact Workflow 1 Task 1",
- Args = new Dictionary { { "test", "test" } },
- Artifacts = new ArtifactMap()
- {
- Input = new Artifact[]
- {
- new Artifact { Name = "Dicom", Value = "{{ context.input.dicom }}" },
- },
- },
- TaskDestinations = new TaskDestination[]
- {
- new TaskDestination{ Name = "artifact_task_2" }
- }
- },
- new TaskObject
- {
- Id = "artifact_task_2",
- Type = "Artifact_task",
- Description = "Artifact Workflow 1 Task 2",
- Args = new Dictionary { { "test", "test" } },
- Artifacts = new ArtifactMap()
- {
- Input = new Artifact[]
- {
- new Artifact
- {
- Name = "output",
- Value = "{{ context.executions.artifact_task_1.output_dir }}",
- Mandatory = true
- },
- },
- },
- TaskDestinations = new TaskDestination[]
- {
- new TaskDestination{ Name = "artifact_task_1" }
- }
- },
- },
- InformaticsGateway = new InformaticsGateway()
- {
- AeTitle = "Artifact_AE",
- ExportDestinations = new string[]{"test"},
- DataOrigins = new string[]{"test"},
- }
- }
- },
- new WorkflowObjectTestData()
- {
- Name = "Invalid_Workflow_0_Tasks",
- Workflow = new Workflow()
- {
- Name = "Artifact 1",
- Description = "Artifact 1",
- Version = "1",
- Tasks = new TaskObject[] {},
- InformaticsGateway = new InformaticsGateway()
- {
- AeTitle = "Artifact_AE",
- ExportDestinations = new string[]{"test"},
- DataOrigins = new string[]{"test"},
- }
- }
- },
- new WorkflowObjectTestData()
- {
- Name = "Invalid_Workflow_Version_Null",
- Workflow = new Workflow()
- {
- Name = "Artifact 1",
- Description = "Artifact 1",
- Tasks = new TaskObject[]
- {
- new TaskObject
- {
- Id = "artifact_task_1",
- Type = "Artifact_task",
- Description = "Artifact Workflow 1 Task 1",
- Args = new Dictionary { { "test", "test" } },
- Artifacts = new ArtifactMap()
- {
- Input = new Artifact[]
- {
- new Artifact { Name = "Dicom", Value = "{{ context.input.dicom }}" },
- },
- },
- TaskDestinations = new TaskDestination[]
- {
- new TaskDestination{ Name = "artifact_task_2" }
- }
- },
- new TaskObject
- {
- Id = "artifact_task_2",
- Type = "Artifact_task",
- Description = "Artifact Workflow 1 Task 2",
- Args = new Dictionary { { "test", "test" } },
- Artifacts = new ArtifactMap()
- {
- Input = new Artifact[]
- {
- new Artifact
- {
- Name = "output",
- Value = "{{ context.executions.artifact_task_1.output_dir }}",
- Mandatory = true
- },
- },
- },
- },
- },
- InformaticsGateway = new InformaticsGateway()
- {
- AeTitle = "Artifact_AE",
- ExportDestinations = new string[]{"test"},
- DataOrigins = new string[]{"test"},
- }
- }
- },
- new WorkflowObjectTestData()
- {
- Name = "Invalid_Workflow_Version_Blank",
- Workflow = new Workflow()
- {
- Name = "Artifact 1",
- Description = "Artifact 1",
- Version = "",
- Tasks = new TaskObject[]
- {
- new TaskObject
- {
- Id = "artifact_task_1",
- Type = "Artifact_task",
- Description = "Artifact Workflow 1 Task 1",
- Args = new Dictionary { { "test", "test" } },
- Artifacts = new ArtifactMap()
- {
- Input = new Artifact[]
- {
- new Artifact { Name = "Dicom", Value = "{{ context.input.dicom }}" },
- },
- },
- TaskDestinations = new TaskDestination[]
- {
- new TaskDestination{ Name = "artifact_task_2" }
- }
- },
- new TaskObject
- {
- Id = "artifact_task_2",
- Type = "Artifact_task",
- Description = "Artifact Workflow 1 Task 2",
- Args = new Dictionary { { "test", "test" } },
- Artifacts = new ArtifactMap()
- {
- Input = new Artifact[]
- {
- new Artifact
- {
- Name = "output",
- Value = "{{ context.executions.artifact_task_1.output_dir }}",
- Mandatory = true
- },
- },
- },
- },
- },
- InformaticsGateway = new InformaticsGateway()
- {
- AeTitle = "Artifact_AE",
- ExportDestinations = new string[]{"test"},
- DataOrigins = new string[]{"test"},
- }
- }
- },
- new WorkflowObjectTestData()
- {
- Name = "Invalid_Workflow_Dup_Output",
- Workflow = new Workflow()
- {
- Name = "Dup Output",
- Description = "Basic workflow update",
- Version = "1",
- Tasks = new TaskObject[]
- {
- new TaskObject
- {
- Id = "basic_id_with-legal-chars",
- Type = "router",
- Description = "Basic Workflow update Task update",
- Args = new Dictionary { { "test", "test" } },
- Artifacts = new ArtifactMap()
- {
- Input = new Artifact[] {},
- Output = new Artifact[]
- {
- new Artifact
- {
- Name = "non_unique_name",
- Value = "{{ context.executions.artifact_task_1.output_dir }}",
- Mandatory = true
- },
- new Artifact
- {
- Name = "non_unique_name",
- Value = "{{ context.executions.artifact_task_1.output_dir }}",
- Mandatory = true
- },
- },
- },
- TaskDestinations = new TaskDestination[] {}
- }
- },
- InformaticsGateway = new InformaticsGateway()
- {
- AeTitle = "Update",
- DataOrigins = new string[]{"test"},
- ExportDestinations = new string[]{"test"}
- }
- }
- },
- new WorkflowObjectTestData()
- {
- Name = "Invalid_Workflow_Body_Object",
- Workflow = new Workflow()
- {
- Name = "Artifact 1",
- Description = "Artifact 1",
- Version = ""
- }
- },
- new WorkflowObjectTestData()
- {
- Name = "Empty_Workflow_Body",
- Workflow = new Workflow()
- },
- new WorkflowObjectTestData()
- {
- Name = "Invalid_Workflow_Missing_QueueName",
- Workflow = new Workflow()
- {
- Name = "Basic update",
- Description = "Basic workflow update",
- Version = "1",
- Tasks = new TaskObject[]
- {
- new TaskObject
- {
- Id = "Argo_Task",
- Type = "argo",
- Description = "Argo task missing QueueName",
- Args = new Dictionary {
- { "workflow_name", "Workflow Name" },
- { "reviewed_task_id", "Task ID" }
- },
- Artifacts = new ArtifactMap()
- {
- Input = new Artifact[] {},
- Output = new Artifact[] {}
- },
- TaskDestinations = new TaskDestination[] {}
- }
- },
- InformaticsGateway = new InformaticsGateway()
- {
- AeTitle = "Update",
- DataOrigins = new string[]{"test"},
- ExportDestinations = new string[]{"test"}
- }
- }
- },
- new WorkflowObjectTestData()
- {
- Name = "Invalid_Workflow_Missing_WorkflowName",
- Workflow = new Workflow()
- {
- Name = "Basic update",
- Description = "Basic workflow update",
- Version = "1",
- Tasks = new TaskObject[]
- {
- new TaskObject
- {
- Id = "Argo_Task",
- Type = "argo",
- Description = "Argo task missing QueueName",
- Args = new Dictionary {
- { "queue_name", "Queue Name" },
- { "reviewed_task_id", "Task ID" }
- },
- Artifacts = new ArtifactMap()
- {
- Input = new Artifact[] {},
- Output = new Artifact[] {}
- },
- TaskDestinations = new TaskDestination[] {}
- }
- },
- InformaticsGateway = new InformaticsGateway()
- {
- AeTitle = "Update",
- DataOrigins = new string[]{"test"},
- ExportDestinations = new string[]{"test"}
- }
- }
- },
- new WorkflowObjectTestData()
- {
- Name = "Invalid_Workflow_Missing_ReviewedTaskId",
- Workflow = new Workflow()
+/*
+ * Copyright 2022 MONAI Consortium
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using Monai.Deploy.WorkflowManager.Contracts.Models;
+
+namespace Monai.Deploy.WorkflowManager.WorkflowExecutor.IntegrationTests.TestData
+{
+ public class WorkflowObjectTestData
+ {
+ public string? Name { get; set; }
+
+ public Workflow? Workflow { get; set; }
+ }
+
+ public static class WorkflowObjectsTestData
+ {
+ public static List TestData = new List()
+ {
+ new WorkflowObjectTestData()
+ {
+ Name = "Basic_Workflow_1",
+ Workflow = new Workflow()
+ {
+ Name = "Basic update",
+ Description = "Basic workflow update",
+ Version = "1",
+ Tasks = new TaskObject[]
+ {
+ new TaskObject
+ {
+ Id = "basic_id_with-legal-chars",
+ Type = "router",
+ Description = "Basic Workflow update Task update",
+ Args = new Dictionary { { "test", "test" } },
+ Artifacts = new ArtifactMap()
+ {
+ Input = new Artifact[] {},
+ Output = new Artifact[] {}
+ },
+ TaskDestinations = new TaskDestination[] {}
+ }
+ },
+ InformaticsGateway = new InformaticsGateway()
+ {
+ AeTitle = "Update",
+ DataOrigins = new string[]{"test"},
+ ExportDestinations = new string[]{"test"}
+ }
+ }
+ },
+ new WorkflowObjectTestData()
+ {
+ Name = "Basic_Workflow_2",
+ Workflow = new Workflow()
+ {
+ Name = "Basic update",
+ Description = "Basic workflow update",
+ Version = "1",
+ Tasks = new TaskObject[]
+ {
+ new TaskObject
+ {
+ Id = "basic_id_with-legal-chars",
+ Type = "router",
+ Description = "Basic Workflow update Task update",
+ Artifacts = new ArtifactMap()
+ {
+ Input = new Artifact[] {}
+ }
+ }
+ },
+ InformaticsGateway = new InformaticsGateway()
+ {
+ AeTitle = "Update",
+ ExportDestinations = new string[]{"test"}
+ }
+ }
+ },
+ new WorkflowObjectTestData()
+ {
+ Name = "Invalid_Workflow_Missing_Name",
+ Workflow = new Workflow()
+ {
+ Name = "",
+ Description = "Basic workflow 1",
+ Version = "1",
+ Tasks = new TaskObject[]
+ {
+ new TaskObject
+ {
+ Id = Guid.NewGuid().ToString(),
+ Type = "router",
+ Description = "Basic Workflow 1 Task 1",
+ Artifacts = new ArtifactMap()
+ {
+ Input = new Artifact[] {},
+ Output = new Artifact[] {}
+ },
+ Args = new Dictionary { { "test", "test" } }
+ }
+ },
+ InformaticsGateway = new InformaticsGateway()
+ {
+ AeTitle = "Basic_AE",
+ DataOrigins = new string[]{"test"},
+ ExportDestinations = new string[]{"test"}
+ }
+ }
+ },
+ new WorkflowObjectTestData()
+ {
+ Name = "Invalid_Workflow_Desc_Length",
+ Workflow = new Workflow()
+ {
+ Name = "Basic workflow",
+ Description = "Over 200 chars dolor sit amet, consectetur adipiscing elit. Donec bibendum dapibus elit, quis tempus metus. Sed aliquam metus tempus pretium pharetra. Etiam a est id nunc tempor consectetur. Proin turpis.",
+ Version = "1",
+ Tasks = new TaskObject[]
+ {
+ new TaskObject
+ {
+ Id = Guid.NewGuid().ToString(),
+ Type = "router",
+ Description = "Basic Workflow 1 Task 1",
+ Artifacts = new ArtifactMap()
+ {
+ Input = new Artifact[] {},
+ Output = new Artifact[] {}
+ },
+ Args = new Dictionary { { "test", "test" } }
+ }
+ },
+ InformaticsGateway = new InformaticsGateway()
+ {
+ AeTitle = "Basic_AE",
+ DataOrigins = new string[]{"test"},
+ ExportDestinations = new string[]{"test"}
+ }
+ }
+ },
+ new WorkflowObjectTestData()
+ {
+ Name = "Invalid_Workflow_Desc_Length",
+ Workflow = new Workflow()
+ {
+ Name = "Inv_Desc",
+ Description = "Over 200 chars dolor sit amet, consectetur adipiscing elit. Donec bibendum dapibus elit, quis tempus metus. Sed aliquam metus tempus pretium pharetra. Etiam a est id nunc tempor consectetur. Proin turpis.",
+ Version = "1",
+ Tasks = new TaskObject[]
+ {
+ new TaskObject
+ {
+ Id = Guid.NewGuid().ToString(),
+ Type = "router",
+ Description = "Basic Workflow 1 Task 1",
+ Artifacts = new ArtifactMap()
+ {
+ Input = new Artifact[] {},
+ Output = new Artifact[] {}
+ },
+ Args = new Dictionary { { "test", "test" } }
+ }
+ },
+ InformaticsGateway = new InformaticsGateway()
+ {
+ AeTitle = "Basic_AE",
+ DataOrigins = new string[]{"test"},
+ ExportDestinations = new string[]{"test"}
+ }
+ }
+ },
+ new WorkflowObjectTestData()
+ {
+ Name = "Invalid_Workflow_AETitle_Length",
+ Workflow = new Workflow()
+ {
+ Name = "Inv_AE",
+ Description = "Inv_AE",
+ Version = "1",
+ Tasks = new TaskObject[]
+ {
+ new TaskObject
+ {
+ Id = Guid.NewGuid().ToString(),
+ Type = "router",
+ Description = "Basic Workflow 1 Task 1",
+ Artifacts = new ArtifactMap()
+ {
+ Input = new Artifact[] {},
+ Output = new Artifact[] {}
+ },
+ Args = new Dictionary { { "test", "test" } }
+ }
+ },
+ InformaticsGateway = new InformaticsGateway()
+ {
+ AeTitle = "Over 15 characters",
+ DataOrigins = new string[]{"test"},
+ ExportDestinations = new string[]{"test"}
+ }
+ }
+ },
+ new WorkflowObjectTestData()
+ {
+ Name = "Invalid_Workflow_DataOrg",
+ Workflow = new Workflow()
+ {
+ Name = "Inv_DataOrg",
+ Description = "Inv_DataOrg",
+ Version = "1",
+ Tasks = new TaskObject[]
+ {
+ new TaskObject
+ {
+ Id = Guid.NewGuid().ToString(),
+ Type = "router",
+ Description = "Basic Workflow 1 Task 1",
+ Artifacts = new ArtifactMap()
+ {
+ Input = new Artifact[] {},
+ Output = new Artifact[] {}
+ },
+ Args = new Dictionary { { "test", "test" } }
+ }
+ },
+ InformaticsGateway = new InformaticsGateway()
+ {
+ AeTitle = "Basic_AE",
+ DataOrigins = new string[]{},
+ ExportDestinations = new string[]{"test"}
+ }
+ }
+ },
+ new WorkflowObjectTestData()
+ {
+ Name = "Invalid_Workflow_ExportDest",
+ Workflow = new Workflow()
+ {
+ Name = "Inv_ExpDest",
+ Description = "Inv_ExpDest",
+ Version = "1",
+ Tasks = new TaskObject[]
+ {
+ new TaskObject
+ {
+ Id = Guid.NewGuid().ToString(),
+ Type = "router",
+ Description = "Basic Workflow 1 Task 1",
+ Artifacts = new ArtifactMap()
+ {
+ Input = new Artifact[] {},
+ Output = new Artifact[] {}
+ },
+ Args = new Dictionary { { "test", "test" } }
+ }
+ },
+ InformaticsGateway = new InformaticsGateway()
+ {
+ AeTitle = "Basic_AE",
+ DataOrigins = new string[]{"test"},
+ ExportDestinations = new string[]{}
+ }
+ }
+ },
+ new WorkflowObjectTestData()
+ {
+ Name = "Invalid_Workflow_TaskDesc_Length",
+ Workflow = new Workflow()
+ {
+ Name = "Inv_TaskDesc",
+ Description = "Inv_TaskDesc",
+ Version = "1",
+ Tasks = new TaskObject[]
+ {
+ new TaskObject
+ {
+ Id = Guid.NewGuid().ToString(),
+ Type = "router",
+ Description = "Over 2000 chars dolor sit amet, consectetur adipiscing elit. Praesent eget consequat ante. Vivamus convallis porttitor vehicula. Proin turpis ante, fringilla nec sem sit amet, commodo tristique magna. Cras quam est, vehicula vitae tellus et, faucibus hendrerit lacus. Curabitur at ligula urna. Nam pretium felis et orci consectetur suscipit. In finibus arcu erat, quis congue libero finibus quis. Praesent mollis viverra arcu, vel finibus ligula auctor et. Phasellus ac lacus id tellus tempor porta. Sed quis nibh malesuada, consectetur sem sed, aliquam sapien. Mauris vehicula massa elit, vel varius massa fringilla non. Proin hendrerit dui nibh, ultrices egestas lacus ultrices ut. Vestibulum vitae nunc eget nunc hendrerit blandit. Nunc ut erat nisl. Sed condimentum gravida augue. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur vel mi congue, vehicula arcu quis, placerat ligula. In dapibus quam eget aliquam euismod. Praesent eget augue lacus. Aenean malesuada rhoncus fringilla. Sed non lectus nulla. Morbi maximus mi nec vulputate rhoncus. In sit amet ultrices massa. Duis a nunc congue, blandit purus non, dignissim nisl. In risus neque, fringilla sit amet laoreet vitae, aliquam et risus. In nec sem nulla. Aenean rutrum urna odio, et ornare diam pharetra nec. Cras suscipit diam vitae condimentum rutrum. Proin lacinia augue leo, et consectetur eros accumsan eget. Donec nec lacinia dui. Aenean imperdiet finibus volutpat. Proin scelerisque ante ligula, at faucibus odio bibendum vitae. Duis luctus arcu nibh, ac elementum libero ullamcorper id. Curabitur fermentum neque dui, ut suscipit ipsum pellentesque eu. Curabitur dapibus, magna egestas semper volutpat, ligula urna eleifend nunc, eget tristique lacus sapien in nisi. Etiam id bibendum purus. Proin dictum, orci in egestas faucibus, ipsum felis ullamcorper lectus, ac bibendum arcu arcu eu tellus. Aliquam a posuere nibh. Duis euismod magna a faucibus tempor. Vestibulum et lacus molestie.",
+ Artifacts = new ArtifactMap()
+ {
+ Input = new Artifact[] {},
+ Output = new Artifact[] {}
+ },
+ Args = new Dictionary { { "test", "test" } }
+ }
+ },
+ InformaticsGateway = new InformaticsGateway()
+ {
+ AeTitle = "Basic_AE",
+ DataOrigins = new string[]{"test"},
+ ExportDestinations = new string[]{"test"}
+ }
+ }
+ },
+ new WorkflowObjectTestData()
+ {
+ Name = "Invalid_Workflow_TaskType",
+ Workflow = new Workflow()
+ {
+ Name = "Inv_TaskType",
+ Description = "Inv_TaskType",
+ Version = "1",
+ Tasks = new TaskObject[]
+ {
+ new TaskObject
+ {
+ Id = Guid.NewGuid().ToString(),
+ Type = "Over 2000 chars dolor sit amet, consectetur adipiscing elit. Praesent eget consequat ante. Vivamus convallis porttitor vehicula. Proin turpis ante, fringilla nec sem sit amet, commodo tristique magna. Cras quam est, vehicula vitae tellus et, faucibus hendrerit lacus. Curabitur at ligula urna. Nam pretium felis et orci consectetur suscipit. In finibus arcu erat, quis congue libero finibus quis. Praesent mollis viverra arcu, vel finibus ligula auctor et. Phasellus ac lacus id tellus tempor porta. Sed quis nibh malesuada, consectetur sem sed, aliquam sapien. Mauris vehicula massa elit, vel varius massa fringilla non. Proin hendrerit dui nibh, ultrices egestas lacus ultrices ut. Vestibulum vitae nunc eget nunc hendrerit blandit. Nunc ut erat nisl. Sed condimentum gravida augue. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur vel mi congue, vehicula arcu quis, placerat ligula. In dapibus quam eget aliquam euismod. Praesent eget augue lacus. Aenean malesuada rhoncus fringilla. Sed non lectus nulla. Morbi maximus mi nec vulputate rhoncus. In sit amet ultrices massa. Duis a nunc congue, blandit purus non, dignissim nisl. In risus neque, fringilla sit amet laoreet vitae, aliquam et risus. In nec sem nulla. Aenean rutrum urna odio, et ornare diam pharetra nec. Cras suscipit diam vitae condimentum rutrum. Proin lacinia augue leo, et consectetur eros accumsan eget. Donec nec lacinia dui. Aenean imperdiet finibus volutpat. Proin scelerisque ante ligula, at faucibus odio bibendum vitae. Duis luctus arcu nibh, ac elementum libero ullamcorper id. Curabitur fermentum neque dui, ut suscipit ipsum pellentesque eu. Curabitur dapibus, magna egestas semper volutpat, ligula urna eleifend nunc, eget tristique lacus sapien in nisi. Etiam id bibendum purus. Proin dictum, orci in egestas faucibus, ipsum felis ullamcorper lectus, ac bibendum arcu arcu eu tellus. Aliquam a posuere nibh. Duis euismod magna a faucibus tempor. Vestibulum et lacus molestie.",
+ Artifacts = new ArtifactMap()
+ {
+ Input = new Artifact[] {},
+ Output = new Artifact[] {}
+ },
+ Description = "Basic Workflow 1 Task 1",
+ Args = new Dictionary { { "test", "test" } }
+ }
+ },
+ InformaticsGateway = new InformaticsGateway()
+ {
+ AeTitle = "Basic_AE",
+ DataOrigins = new string[]{"test"},
+ ExportDestinations = new string[]{"test"}
+ }
+ }
+ },
+ new WorkflowObjectTestData()
+ {
+ Name = "Invalid_Workflow_TaskArgs",
+ Workflow = new Workflow()
+ {
+ Name = "Inv_TaskArgs",
+ Description = "Inv_TaskArgs",
+ Version = "1",
+ Tasks = new TaskObject[]
+ {
+ new TaskObject
+ {
+ Id = Guid.NewGuid().ToString(),
+ Type = "router",
+ Description = "Basic Workflow 1 Task 1",
+ Artifacts = new ArtifactMap()
+ {
+ Input = new Artifact[] {},
+ Output = new Artifact[] {}
+ },
+ }
+ },
+ InformaticsGateway = new InformaticsGateway()
+ {
+ AeTitle = "Basic_AE",
+ DataOrigins = new string[]{"test"},
+ ExportDestinations = new string[]{"test"}
+ }
+ }
+ },
+ new WorkflowObjectTestData()
+ {
+ Name = "Invalid_Workflow_TaskID_Length",
+ Workflow = new Workflow()
+ {
+ Name = "Inv_TaskID",
+ Description = "Inv_TaskID",
+ Version = "1",
+ Tasks = new TaskObject[]
+ {
+ new TaskObject
+ {
+ Id = "Over 50 chars Lorem ipsum dolor sit amet consectetur adipiscing elit ligula",
+ Type = "router",
+ Artifacts = new ArtifactMap()
+ {
+ Input = new Artifact[] {},
+ Output = new Artifact[] {}
+ },
+ Description = "Basic Workflow 1 Task 1",
+ Args = new Dictionary { { "test", "test" } }
+ }
+ },
+ InformaticsGateway = new InformaticsGateway()
+ {
+ AeTitle = "Basic_AE",
+ DataOrigins = new string[]{"test"},
+ ExportDestinations = new string[]{"test"}
+ }
+ }
+ },
+ new WorkflowObjectTestData()
+ {
+ Name = "Invalid_Workflow_TaskID_Content",
+ Workflow = new Workflow()
+ {
+ Name = "Inv_TaskID",
+ Description = "Inv_TaskID",
+ Version = "1",
+ Tasks = new TaskObject[]
+ {
+ new TaskObject
+ {
+ Id = "Invalid chars ./'#;][",
+ Type = "router",
+ Artifacts = new ArtifactMap()
+ {
+ Input = new Artifact[] {},
+ Output = new Artifact[] {}
+ },
+ Description = "Basic Workflow 1 Task 1",
+ Args = new Dictionary { { "test", "test" } }
+ }
+ },
+ InformaticsGateway = new InformaticsGateway()
+ {
+ AeTitle = "Basic_AE",
+ DataOrigins = new string[]{"test"},
+ ExportDestinations = new string[]{"test"}
+ }
+ }
+ },
+ new WorkflowObjectTestData()
+ {
+ Name = "Invalid_Workflow_Unreferenced_Task",
+ Workflow = new Workflow()
{
- Name = "Basic update",
- Description = "Basic workflow update",
+ Name = "Artifact 1",
+ Description = "Artifact 1",
Version = "1",
Tasks = new TaskObject[]
{
new TaskObject
{
- Id = "clinical_review",
- Type = "aide_clinical_review",
- Description = "Clinical Review task missing ReviewedTaskId",
- Args = new Dictionary {
- { "mode", "qa" },
- { "application_name", "Name" },
- { "application_version", "Version" },
- },
+ Id = "artifact_task_1",
+ Type = "Artifact_task",
+ Description = "Artifact Workflow 1 Task 1",
+ Args = new Dictionary { { "test", "test" } },
Artifacts = new ArtifactMap()
{
- Input = new Artifact[] {},
- Output = new Artifact[] {}
+ Input = new Artifact[]
+ {
+ new Artifact { Name = "Dicom", Value = "{{ context.input.dicom }}" },
+ },
},
- TaskDestinations = new TaskDestination[] {}
- }
- },
- InformaticsGateway = new InformaticsGateway()
- {
- AeTitle = "Update",
- DataOrigins = new string[]{"test"},
- ExportDestinations = new string[]{"test"}
- }
- }
- },
- new WorkflowObjectTestData()
- {
- Name = "Invalid_Workflow_Missing_All_Argo_Args",
- Workflow = new Workflow()
- {
- Name = "Basic update",
- Description = "Basic workflow update",
- Version = "1",
- Tasks = new TaskObject[]
- {
+ },
new TaskObject
{
- Id = "Argo_Task",
- Type = "argo",
- Description = "Argo task missing QueueName",
- Args = new Dictionary {},
+ Id = "artifact_task_2",
+ Type = "Artifact_task",
+ Description = "Artifact Workflow 1 Task 2",
+ Args = new Dictionary { { "test", "test" } },
Artifacts = new ArtifactMap()
{
- Input = new Artifact[] {},
- Output = new Artifact[] {}
+ Input = new Artifact[]
+ {
+ new Artifact
+ {
+ Name = "output",
+ Value = "{{ context.executions.artifact_task_1.output_dir }}",
+ Mandatory = true
+ },
+ },
},
- TaskDestinations = new TaskDestination[] {}
- }
+ },
},
InformaticsGateway = new InformaticsGateway()
{
- AeTitle = "Update",
+ AeTitle = "Artifact_AE",
+ ExportDestinations = new string[]{"test"},
DataOrigins = new string[]{"test"},
- ExportDestinations = new string[]{"test"}
}
- }
- },
- new WorkflowObjectTestData()
- {
- Name = "Invalid_Workflow_Missing_2_Argo_Args_1",
- Workflow = new Workflow()
+ }
+ },
+ new WorkflowObjectTestData()
+ {
+ Name = "Invalid_Workflow_Loopback_Task",
+ Workflow = new Workflow()
{
- Name = "Basic update",
- Description = "Basic workflow update",
+ Name = "Artifact 1",
+ Description = "Artifact 1",
Version = "1",
Tasks = new TaskObject[]
{
new TaskObject
{
- Id = "Argo_Task",
- Type = "argo",
- Description = "Argo task missing QueueName",
- Args = new Dictionary {
- { "workflow_name", "Workflow Name" },
- },
+ Id = "artifact_task_1",
+ Type = "Artifact_task",
+ Description = "Artifact Workflow 1 Task 1",
+ Args = new Dictionary { { "test", "test" } },
Artifacts = new ArtifactMap()
{
- Input = new Artifact[] {},
- Output = new Artifact[] {}
+ Input = new Artifact[]
+ {
+ new Artifact { Name = "Dicom", Value = "{{ context.input.dicom }}" },
+ },
},
- TaskDestinations = new TaskDestination[] {}
- }
- },
- InformaticsGateway = new InformaticsGateway()
- {
- AeTitle = "Update",
- DataOrigins = new string[]{"test"},
- ExportDestinations = new string[]{"test"}
- }
- }
- },
- new WorkflowObjectTestData()
- {
- Name = "Invalid_Workflow_Missing_2_Argo_Args_2",
- Workflow = new Workflow()
- {
- Name = "Basic update",
- Description = "Basic workflow update",
- Version = "1",
- Tasks = new TaskObject[]
- {
+ TaskDestinations = new TaskDestination[]
+ {
+ new TaskDestination{ Name = "artifact_task_2" }
+ }
+ },
new TaskObject
{
- Id = "Argo_Task",
- Type = "argo",
- Description = "Argo task missing QueueName",
- Args = new Dictionary {
- { "queue_name", "Queue Name" },
- },
+ Id = "artifact_task_2",
+ Type = "Artifact_task",
+ Description = "Artifact Workflow 1 Task 2",
+ Args = new Dictionary { { "test", "test" } },
Artifacts = new ArtifactMap()
{
- Input = new Artifact[] {},
- Output = new Artifact[] {}
+ Input = new Artifact[]
+ {
+ new Artifact
+ {
+ Name = "output",
+ Value = "{{ context.executions.artifact_task_1.output_dir }}",
+ Mandatory = true
+ },
+ },
},
- TaskDestinations = new TaskDestination[] {}
- }
+ TaskDestinations = new TaskDestination[]
+ {
+ new TaskDestination{ Name = "artifact_task_1" }
+ }
+ },
},
InformaticsGateway = new InformaticsGateway()
{
- AeTitle = "Update",
+ AeTitle = "Artifact_AE",
+ ExportDestinations = new string[]{"test"},
DataOrigins = new string[]{"test"},
- ExportDestinations = new string[]{"test"}
}
- }
- },
- new WorkflowObjectTestData()
- {
- Name = "Invalid_Workflow_Missing_2_Argo_Args_3",
- Workflow = new Workflow()
+ }
+ },
+ new WorkflowObjectTestData()
+ {
+ Name = "Invalid_Workflow_0_Tasks",
+ Workflow = new Workflow()
{
- Name = "Basic update",
- Description = "Basic workflow update",
+ Name = "Artifact 1",
+ Description = "Artifact 1",
Version = "1",
- Tasks = new TaskObject[]
- {
- new TaskObject
- {
- Id = "Argo_Task",
- Type = "argo",
- Description = "Argo task missing QueueName",
- Args = new Dictionary {
- { "reviewed_task_id", "Task ID" }
- },
- Artifacts = new ArtifactMap()
- {
- Input = new Artifact[] {},
- Output = new Artifact[] {}
- },
- TaskDestinations = new TaskDestination[] {}
- }
- },
+ Tasks = new TaskObject[] {},
InformaticsGateway = new InformaticsGateway()
{
- AeTitle = "Update",
+ AeTitle = "Artifact_AE",
+ ExportDestinations = new string[]{"test"},
DataOrigins = new string[]{"test"},
- ExportDestinations = new string[]{"test"}
}
- }
- },
- new WorkflowObjectTestData()
- {
- Name = "Invalid_Workflow_Incorrect_Clinical_Review_Artifact",
- Workflow = new Workflow()
+ }
+ },
+ new WorkflowObjectTestData()
+ {
+ Name = "Invalid_Workflow_Version_Null",
+ Workflow = new Workflow()
{
- Name = "Basic update",
- Description = "Basic workflow update",
- Version = "1",
+ Name = "Artifact 1",
+ Description = "Artifact 1",
Tasks = new TaskObject[]
{
new TaskObject
{
- Id = "Argo_Task",
- Type = "argo",
- Description = "Argo task missing QueueName",
- Args = new Dictionary {
- { "workflow_name", "Workflow Name" },
- { "queue_name", "Queue Name" },
- { "reviewed_task_id", "Task ID" }
- },
+ Id = "artifact_task_1",
+ Type = "Artifact_task",
+ Description = "Artifact Workflow 1 Task 1",
+ Args = new Dictionary { { "test", "test" } },
Artifacts = new ArtifactMap()
{
- Input = new Artifact[] {},
- Output = new Artifact[] {}
+ Input = new Artifact[]
+ {
+ new Artifact { Name = "Dicom", Value = "{{ context.input.dicom }}" },
+ },
},
- TaskDestinations = new TaskDestination[] {
- new TaskDestination
+ TaskDestinations = new TaskDestination[]
{
- Name = "Clinical_Review_Task"
+ new TaskDestination{ Name = "artifact_task_2" }
}
- }
},
new TaskObject
{
- Id = "Clinical_Review_Task",
- Type = "aide_clinical_review",
- Description = "Clinical Review incorrect Input",
- Args = new Dictionary {},
+ Id = "artifact_task_2",
+ Type = "Artifact_task",
+ Description = "Artifact Workflow 1 Task 2",
+ Args = new Dictionary { { "test", "test" } },
Artifacts = new ArtifactMap()
{
- Input = new Artifact[] { new Artifact { Name = "test", Value = "{{ context.executions.mean-pixel-calc.artifacts.report }}" } },
- Output = new Artifact[] {}
+ Input = new Artifact[]
+ {
+ new Artifact
+ {
+ Name = "output",
+ Value = "{{ context.executions.artifact_task_1.output_dir }}",
+ Mandatory = true
+ },
+ },
},
- TaskDestinations = new TaskDestination[] {}
- }
+ },
},
InformaticsGateway = new InformaticsGateway()
{
- AeTitle = "Update",
+ AeTitle = "Artifact_AE",
+ ExportDestinations = new string[]{"test"},
DataOrigins = new string[]{"test"},
- ExportDestinations = new string[]{"test"}
}
- }
- },
- new WorkflowObjectTestData()
- {
- Name = "Workflow_Dup_Workflow_Name",
- Workflow = new Workflow()
+ }
+ },
+ new WorkflowObjectTestData()
+ {
+ Name = "Invalid_Workflow_Version_Blank",
+ Workflow = new Workflow()
{
- Name = "Basic workflow",
- Description = "Basic workflow update",
- Version = "1",
+ Name = "Artifact 1",
+ Description = "Artifact 1",
+ Version = "",
Tasks = new TaskObject[]
{
new TaskObject
{
- Id = "basic_id_with-legal-chars",
- Type = "router",
- Description = "Basic Workflow update Task update",
+ Id = "artifact_task_1",
+ Type = "Artifact_task",
+ Description = "Artifact Workflow 1 Task 1",
Args = new Dictionary { { "test", "test" } },
Artifacts = new ArtifactMap()
{
- Input = new Artifact[] {},
- Output = new Artifact[] {}
+ Input = new Artifact[]
+ {
+ new Artifact { Name = "Dicom", Value = "{{ context.input.dicom }}" },
+ },
},
- TaskDestinations = new TaskDestination[] {}
- }
+ TaskDestinations = new TaskDestination[]
+ {
+ new TaskDestination{ Name = "artifact_task_2" }
+ }
+ },
+ new TaskObject
+ {
+ Id = "artifact_task_2",
+ Type = "Artifact_task",
+ Description = "Artifact Workflow 1 Task 2",
+ Args = new Dictionary { { "test", "test" } },
+ Artifacts = new ArtifactMap()
+ {
+ Input = new Artifact[]
+ {
+ new Artifact
+ {
+ Name = "output",
+ Value = "{{ context.executions.artifact_task_1.output_dir }}",
+ Mandatory = true
+ },
+ },
+ },
+ },
},
InformaticsGateway = new InformaticsGateway()
{
- AeTitle = "Update",
+ AeTitle = "Artifact_AE",
+ ExportDestinations = new string[]{"test"},
DataOrigins = new string[]{"test"},
- ExportDestinations = new string[]{"test"}
}
- }
- },
+ }
+ },
+ new WorkflowObjectTestData()
+ {
+ Name = "Invalid_Workflow_Dup_Output",
+ Workflow = new Workflow()
+ {
+ Name = "Dup Output",
+ Description = "Basic workflow update",
+ Version = "1",
+ Tasks = new TaskObject[]
+ {
+ new TaskObject
+ {
+ Id = "basic_id_with-legal-chars",
+ Type = "router",
+ Description = "Basic Workflow update Task update",
+ Args = new Dictionary { { "test", "test" } },
+ Artifacts = new ArtifactMap()
+ {
+ Input = new Artifact[] {},
+ Output = new Artifact[]
+ {
+ new Artifact
+ {
+ Name = "non_unique_name",
+ Value = "{{ context.executions.artifact_task_1.output_dir }}",
+ Mandatory = true
+ },
+ new Artifact
+ {
+ Name = "non_unique_name",
+ Value = "{{ context.executions.artifact_task_1.output_dir }}",
+ Mandatory = true
+ },
+ },
+ },
+ TaskDestinations = new TaskDestination[] {}
+ }
+ },
+ InformaticsGateway = new InformaticsGateway()
+ {
+ AeTitle = "Update",
+ DataOrigins = new string[]{"test"},
+ ExportDestinations = new string[]{"test"}
+ }
+ }
+ },
+ new WorkflowObjectTestData()
+ {
+ Name = "Invalid_Workflow_Body_Object",
+ Workflow = new Workflow()
+ {
+ Name = "Artifact 1",
+ Description = "Artifact 1",
+ Version = ""
+ }
+ },
+ new WorkflowObjectTestData()
+ {
+ Name = "Empty_Workflow_Body",
+ Workflow = new Workflow()
+ },
+ new WorkflowObjectTestData()
+ {
+ Name = "Invalid_Workflow_Missing_QueueName",
+ Workflow = new Workflow()
+ {
+ Name = "Basic update",
+ Description = "Basic workflow update",
+ Version = "1",
+ Tasks = new TaskObject[]
+ {
+ new TaskObject
+ {
+ Id = "Argo_Task",
+ Type = "argo",
+ Description = "Argo task missing QueueName",
+ Args = new Dictionary {
+ { "workflow_name", "Workflow Name" },
+ { "reviewed_task_id", "Task ID" }
+ },
+ Artifacts = new ArtifactMap()
+ {
+ Input = new Artifact[] {},
+ Output = new Artifact[] {}
+ },
+ TaskDestinations = new TaskDestination[] {}
+ }
+ },
+ InformaticsGateway = new InformaticsGateway()
+ {
+ AeTitle = "Update",
+ DataOrigins = new string[]{"test"},
+ ExportDestinations = new string[]{"test"}
+ }
+ }
+ },
+ new WorkflowObjectTestData()
+ {
+ Name = "Invalid_Workflow_Missing_WorkflowName",
+ Workflow = new Workflow()
+ {
+ Name = "Basic update",
+ Description = "Basic workflow update",
+ Version = "1",
+ Tasks = new TaskObject[]
+ {
+ new TaskObject
+ {
+ Id = "Argo_Task",
+ Type = "argo",
+ Description = "Argo task missing QueueName",
+ Args = new Dictionary {
+ { "queue_name", "Queue Name" },
+ { "reviewed_task_id", "Task ID" }
+ },
+ Artifacts = new ArtifactMap()
+ {
+ Input = new Artifact[] {},
+ Output = new Artifact[] {}
+ },
+ TaskDestinations = new TaskDestination[] {}
+ }
+ },
+ InformaticsGateway = new InformaticsGateway()
+ {
+ AeTitle = "Update",
+ DataOrigins = new string[]{"test"},
+ ExportDestinations = new string[]{"test"}
+ }
+ }
+ },
+ new WorkflowObjectTestData()
+ {
+ Name = "Invalid_Workflow_Missing_ReviewedTaskId",
+ Workflow = new Workflow()
+ {
+ Name = "Basic update",
+ Description = "Basic workflow update",
+ Version = "1",
+ Tasks = new TaskObject[]
+ {
+ new TaskObject
+ {
+ Id = "clinical_review",
+ Type = "aide_clinical_review",
+ Description = "Clinical Review task missing ReviewedTaskId",
+ Args = new Dictionary {
+ { "mode", "qa" },
+ { "application_name", "Name" },
+ { "application_version", "Version" },
+ },
+ Artifacts = new ArtifactMap()
+ {
+ Input = new Artifact[] {},
+ Output = new Artifact[] {}
+ },
+ TaskDestinations = new TaskDestination[] {}
+ }
+ },
+ InformaticsGateway = new InformaticsGateway()
+ {
+ AeTitle = "Update",
+ DataOrigins = new string[]{"test"},
+ ExportDestinations = new string[]{"test"}
+ }
+ }
+ },
+ new WorkflowObjectTestData()
+ {
+ Name = "Invalid_Workflow_Missing_All_Argo_Args",
+ Workflow = new Workflow()
+ {
+ Name = "Basic update",
+ Description = "Basic workflow update",
+ Version = "1",
+ Tasks = new TaskObject[]
+ {
+ new TaskObject
+ {
+ Id = "Argo_Task",
+ Type = "argo",
+ Description = "Argo task missing QueueName",
+ Args = new Dictionary {},
+ Artifacts = new ArtifactMap()
+ {
+ Input = new Artifact[] {},
+ Output = new Artifact[] {}
+ },
+ TaskDestinations = new TaskDestination[] {}
+ }
+ },
+ InformaticsGateway = new InformaticsGateway()
+ {
+ AeTitle = "Update",
+ DataOrigins = new string[]{"test"},
+ ExportDestinations = new string[]{"test"}
+ }
+ }
+ },
+ new WorkflowObjectTestData()
+ {
+ Name = "Invalid_Workflow_Missing_2_Argo_Args_1",
+ Workflow = new Workflow()
+ {
+ Name = "Basic update",
+ Description = "Basic workflow update",
+ Version = "1",
+ Tasks = new TaskObject[]
+ {
+ new TaskObject
+ {
+ Id = "Argo_Task",
+ Type = "argo",
+ Description = "Argo task missing QueueName",
+ Args = new Dictionary {
+ { "workflow_name", "Workflow Name" },
+ },
+ Artifacts = new ArtifactMap()
+ {
+ Input = new Artifact[] {},
+ Output = new Artifact[] {}
+ },
+ TaskDestinations = new TaskDestination[] {}
+ }
+ },
+ InformaticsGateway = new InformaticsGateway()
+ {
+ AeTitle = "Update",
+ DataOrigins = new string[]{"test"},
+ ExportDestinations = new string[]{"test"}
+ }
+ }
+ },
+ new WorkflowObjectTestData()
+ {
+ Name = "Invalid_Workflow_Missing_2_Argo_Args_2",
+ Workflow = new Workflow()
+ {
+ Name = "Basic update",
+ Description = "Basic workflow update",
+ Version = "1",
+ Tasks = new TaskObject[]
+ {
+ new TaskObject
+ {
+ Id = "Argo_Task",
+ Type = "argo",
+ Description = "Argo task missing QueueName",
+ Args = new Dictionary {
+ { "queue_name", "Queue Name" },
+ },
+ Artifacts = new ArtifactMap()
+ {
+ Input = new Artifact[] {},
+ Output = new Artifact[] {}
+ },
+ TaskDestinations = new TaskDestination[] {}
+ }
+ },
+ InformaticsGateway = new InformaticsGateway()
+ {
+ AeTitle = "Update",
+ DataOrigins = new string[]{"test"},
+ ExportDestinations = new string[]{"test"}
+ }
+ }
+ },
+ new WorkflowObjectTestData()
+ {
+ Name = "Invalid_Workflow_Missing_2_Argo_Args_3",
+ Workflow = new Workflow()
+ {
+ Name = "Basic update",
+ Description = "Basic workflow update",
+ Version = "1",
+ Tasks = new TaskObject[]
+ {
+ new TaskObject
+ {
+ Id = "Argo_Task",
+ Type = "argo",
+ Description = "Argo task missing QueueName",
+ Args = new Dictionary {
+ { "reviewed_task_id", "Task ID" }
+ },
+ Artifacts = new ArtifactMap()
+ {
+ Input = new Artifact[] {},
+ Output = new Artifact[] {}
+ },
+ TaskDestinations = new TaskDestination[] {}
+ }
+ },
+ InformaticsGateway = new InformaticsGateway()
+ {
+ AeTitle = "Update",
+ DataOrigins = new string[]{"test"},
+ ExportDestinations = new string[]{"test"}
+ }
+ }
+ },
+ new WorkflowObjectTestData()
+ {
+ Name = "Invalid_Workflow_Incorrect_Clinical_Review_Artifact",
+ Workflow = new Workflow()
+ {
+ Name = "Basic update",
+ Description = "Basic workflow update",
+ Version = "1",
+ Tasks = new TaskObject[]
+ {
+ new TaskObject
+ {
+ Id = "Argo_Task",
+ Type = "argo",
+ Description = "Argo task missing QueueName",
+ Args = new Dictionary {
+ { "workflow_name", "Workflow Name" },
+ { "queue_name", "Queue Name" },
+ { "reviewed_task_id", "Task ID" }
+ },
+ Artifacts = new ArtifactMap()
+ {
+ Input = new Artifact[] {},
+ Output = new Artifact[] {}
+ },
+ TaskDestinations = new TaskDestination[] {
+ new TaskDestination
+ {
+ Name = "Clinical_Review_Task"
+ }
+ }
+ },
+ new TaskObject
+ {
+ Id = "Clinical_Review_Task",
+ Type = "aide_clinical_review",
+ Description = "Clinical Review incorrect Input",
+ Args = new Dictionary {},
+ Artifacts = new ArtifactMap()
+ {
+ Input = new Artifact[] { new Artifact { Name = "test", Value = "{{ context.executions.mean-pixel-calc.artifacts.report }}" } },
+ Output = new Artifact[] {}
+ },
+ TaskDestinations = new TaskDestination[] {}
+ }
+ },
+ InformaticsGateway = new InformaticsGateway()
+ {
+ AeTitle = "Update",
+ DataOrigins = new string[]{"test"},
+ ExportDestinations = new string[]{"test"}
+ }
+ }
+ },
+ new WorkflowObjectTestData()
+ {
+ Name = "Workflow_Dup_Workflow_Name",
+ Workflow = new Workflow()
+ {
+ Name = "Basic workflow",
+ Description = "Basic workflow update",
+ Version = "1",
+ Tasks = new TaskObject[]
+ {
+ new TaskObject
+ {
+ Id = "basic_id_with-legal-chars",
+ Type = "router",
+ Description = "Basic Workflow update Task update",
+ Args = new Dictionary { { "test", "test" } },
+ Artifacts = new ArtifactMap()
+ {
+ Input = new Artifact[] {},
+ Output = new Artifact[] {}
+ },
+ TaskDestinations = new TaskDestination[] {}
+ }
+ },
+ InformaticsGateway = new InformaticsGateway()
+ {
+ AeTitle = "Update",
+ DataOrigins = new string[]{"test"},
+ ExportDestinations = new string[]{"test"}
+ }
+ }
+ },
new WorkflowObjectTestData()
{
Name = "Invalid_Clinical_Review_Task_Id",
@@ -1097,7 +1097,6 @@ public static class WorkflowObjectsTestData
{ "application_name", "test" },
{ "application_version", "1.1" },
{ "mode", "QA" },
- { "notifications", "false" }
},
Artifacts = new ArtifactMap()
{
@@ -1381,212 +1380,6 @@ public static class WorkflowObjectsTestData
}
}
},
- new WorkflowObjectTestData()
- {
- Name = "Invalid_Clinical_Review_Missing_Notifications",
- Workflow = new Workflow()
- {
- Name = "Basic workflow",
- Description = "Basic workflow update",
- Version = "1",
- Tasks = new TaskObject[]
- {
- new TaskObject
- {
- Id = "argo-task",
- Type = "argo",
- Description = "Argo task",
- Args = new Dictionary {
- { "workflow_template_name", "Workflow Name" },
- },
- Artifacts = new ArtifactMap()
- {
- Input = new Artifact[]
- {
- new Artifact { Name = "Dicom", Value = "{{ context.input.dicom }}" },
- },
- Output = new Artifact[]
- {
- new Artifact { Name = "Argo2" }
- }
- },
- TaskDestinations = new TaskDestination[] {
- new TaskDestination
- {
- Name = "clinical-review"
- }
- }
- },
- new TaskObject
- {
- Id = "clinical-review",
- Type = "aide_clinical_review",
- Description = "Basic Workflow update Task update",
- Args = new Dictionary
- {
- { "workflow_name", "test" },
- { "reviewed_task_id", "argo-task" },
- { "application_name", "test" },
- { "application_version", "1.1" },
- { "mode", "QA" },
- },
- Artifacts = new ArtifactMap()
- {
- Input = new Artifact[]
- {
- new Artifact { Name = "Dicom", Value = "{{ context.input.dicom }}" },
- },
- Output = new Artifact[] {}
- },
- TaskDestinations = new TaskDestination[] { }
- }
- },
- InformaticsGateway = new InformaticsGateway()
- {
- AeTitle = "Update",
- DataOrigins = new string[]{"test"},
- ExportDestinations = new string[]{"test"}
- }
- }
- },
- new WorkflowObjectTestData()
- {
- Name = "Invalid_Clinical_Review_Invalid_Notifications",
- Workflow = new Workflow()
- {
- Name = "Basic workflow",
- Description = "Basic workflow update",
- Version = "1",
- Tasks = new TaskObject[]
- {
- new TaskObject
- {
- Id = "argo-task",
- Type = "argo",
- Description = "Argo task",
- Args = new Dictionary {
- { "workflow_template_name", "Workflow Name" },
- },
- Artifacts = new ArtifactMap()
- {
- Input = new Artifact[]
- {
- new Artifact { Name = "Dicom", Value = "{{ context.input.dicom }}" },
- },
- Output = new Artifact[]
- {
- new Artifact { Name = "Argo2" }
- }
- },
- TaskDestinations = new TaskDestination[] {
- new TaskDestination
- {
- Name = "clinical-review"
- }
- }
- },
- new TaskObject
- {
- Id = "clinical-review",
- Type = "aide_clinical_review",
- Description = "Basic Workflow update Task update",
- Args = new Dictionary
- {
- { "workflow_name", "test" },
- { "reviewed_task_id", "argo-task" },
- { "application_name", "test" },
- { "application_version", "1.1" },
- { "mode", "QA" },
- { "notifications", "dog" }
- },
- Artifacts = new ArtifactMap()
- {
- Input = new Artifact[]
- {
- new Artifact { Name = "Dicom", Value = "{{ context.input.dicom }}" },
- },
- Output = new Artifact[] {}
- },
- TaskDestinations = new TaskDestination[] { }
- }
- },
- InformaticsGateway = new InformaticsGateway()
- {
- AeTitle = "Update",
- DataOrigins = new string[]{"test"},
- ExportDestinations = new string[]{"test"}
- }
- }
- },
- new WorkflowObjectTestData()
- {
- Name = "Valid_Workflow_With_Clinical_Review",
- Workflow = new Workflow()
- {
- Name = "Basic workflow",
- Description = "Basic workflow update",
- Version = "1",
- Tasks = new TaskObject[]
- {
- new TaskObject
- {
- Id = "argo-task",
- Type = "argo",
- Description = "Argo task",
- Args = new Dictionary {
- { "workflow_template_name", "Workflow Name" },
- },
- Artifacts = new ArtifactMap()
- {
- Input = new Artifact[]
- {
- new Artifact { Name = "Dicom", Value = "{{ context.input.dicom }}" },
- },
- Output = new Artifact[]
- {
- new Artifact { Name = "Argo2" }
- }
- },
- TaskDestinations = new TaskDestination[] {
- new TaskDestination
- {
- Name = "clinical-review"
- }
- }
- },
- new TaskObject
- {
- Id = "clinical-review",
- Type = "aide_clinical_review",
- Description = "Basic Workflow update Task update",
- Args = new Dictionary
- {
- { "workflow_name", "test" },
- { "reviewed_task_id", "argo-task" },
- { "application_name", "test" },
- { "application_version", "1.1" },
- { "mode", "QA" },
- { "notifications", "true" }
- },
- Artifacts = new ArtifactMap()
- {
- Input = new Artifact[]
- {
- new Artifact { Name = "Dicom", Value = "{{ context.input.dicom }}" },
- },
- Output = new Artifact[] {}
- },
- TaskDestinations = new TaskDestination[] { }
- }
- },
- InformaticsGateway = new InformaticsGateway()
- {
- AeTitle = "Update",
- DataOrigins = new string[]{"test"},
- ExportDestinations = new string[]{"test"}
- }
- }
- },
- };
- }
-}
+ };
+ }
+}
diff --git a/tests/UnitTests/WorkflowManager.Tests/Controllers/WorkflowsControllerTests.cs b/tests/UnitTests/WorkflowManager.Tests/Controllers/WorkflowsControllerTests.cs
index 9d4cf8875..efed5244a 100644
--- a/tests/UnitTests/WorkflowManager.Tests/Controllers/WorkflowsControllerTests.cs
+++ b/tests/UnitTests/WorkflowManager.Tests/Controllers/WorkflowsControllerTests.cs
@@ -221,251 +221,6 @@ public async Task ValidateAsync_WorkflowValid_Returns204()
Assert.Equal(204, objectResult.StatusCode);
}
- [Fact]
- public async Task ValidateAsync_ValidWorkflowWithClinicalReview_Returns204()
- {
- var newWorkflow = new Workflow()
- {
- Name = "Basic workflow",
- Description = "Basic workflow update",
- Version = "1",
- Tasks = new TaskObject[]
- {
- new TaskObject
- {
- Id = "argo-task",
- Type = "argo",
- Description = "Argo task",
- Args = new Dictionary {
- { "workflow_template_name", "Workflow Name" },
- },
- Artifacts = new ArtifactMap()
- {
- Input = new Artifact[]
- {
- new Artifact { Name = "Dicom", Value = "{{ context.input.dicom }}" },
- },
- Output = new Artifact[]
- {
- new Artifact { Name = "Argo2" }
- }
- },
- TaskDestinations = new TaskDestination[] {
- new TaskDestination
- {
- Name = "clinical-review"
- }
- }
- },
- new TaskObject
- {
- Id = "clinical-review",
- Type = "aide_clinical_review",
- Description = "Basic Workflow update Task update",
- Args = new Dictionary
- {
- { "workflow_name", "test" },
- { "reviewed_task_id", "argo-task" },
- { "application_name", "test" },
- { "application_version", "1.1" },
- { "mode", "QA" },
- { "notifications", "true" }
- },
- Artifacts = new ArtifactMap()
- {
- Input = new Artifact[]
- {
- new Artifact { Name = "Dicom", Value = "{{ context.input.dicom }}" },
- },
- Output = new Artifact[] {}
- },
- TaskDestinations = new TaskDestination[] { }
- }
- },
- InformaticsGateway = new InformaticsGateway()
- {
- AeTitle = "Update",
- DataOrigins = new string[] { "test" },
- ExportDestinations = new string[] { "test" }
- }
- };
-
- var request = new WorkflowUpdateRequest();
- request.Workflow = newWorkflow;
- request.OriginalWorkflowName = newWorkflow.Name + "1";
-
- var result = await WorkflowsController.ValidateAsync(request);
-
- var objectResult = Assert.IsType(result);
-
- Assert.Equal(204, objectResult.StatusCode);
- }
-
- [Fact]
- public async Task ValidateAsync_InvalidWorkflowWithClinicalReviewMissingNotifications_ReturnsBadRequest()
- {
- var newWorkflow = new Workflow()
- {
- Name = "Basic workflow",
- Description = "Basic workflow update",
- Version = "1",
- Tasks = new TaskObject[]
- {
- new TaskObject
- {
- Id = "argo-task",
- Type = "argo",
- Description = "Argo task",
- Args = new Dictionary {
- { "workflow_template_name", "Workflow Name" },
- },
- Artifacts = new ArtifactMap()
- {
- Input = new Artifact[]
- {
- new Artifact { Name = "Dicom", Value = "{{ context.input.dicom }}" },
- },
- Output = new Artifact[]
- {
- new Artifact { Name = "Argo2" }
- }
- },
- TaskDestinations = new TaskDestination[] {
- new TaskDestination
- {
- Name = "clinical-review"
- }
- }
- },
- new TaskObject
- {
- Id = "clinical-review",
- Type = "aide_clinical_review",
- Description = "Basic Workflow update Task update",
- Args = new Dictionary
- {
- { "workflow_name", "test" },
- { "reviewed_task_id", "argo-task" },
- { "application_name", "test" },
- { "application_version", "1.1" },
- { "mode", "QA" },
- },
- Artifacts = new ArtifactMap()
- {
- Input = new Artifact[]
- {
- new Artifact { Name = "Dicom", Value = "{{ context.input.dicom }}" },
- },
- Output = new Artifact[] {}
- },
- TaskDestinations = new TaskDestination[] { }
- }
- },
- InformaticsGateway = new InformaticsGateway()
- {
- AeTitle = "Update",
- DataOrigins = new string[] { "test" },
- ExportDestinations = new string[] { "test" }
- }
- };
-
- var request = new WorkflowUpdateRequest();
- request.Workflow = newWorkflow;
- request.OriginalWorkflowName = newWorkflow.Name + "1";
-
- var result = await WorkflowsController.ValidateAsync(request);
-
- var objectResult = Assert.IsType(result);
-
- Assert.Equal(400, objectResult.StatusCode);
-
- const string expectedInstance = "/workflows";
- Assert.StartsWith(expectedInstance, ((ProblemDetails)objectResult.Value).Instance);
- }
-
- [Fact]
- public async Task ValidateAsync_InvalidWorkflowWithClinicalReviewInvalidNotifications_ReturnsBadRequest()
- {
- var newWorkflow = new Workflow()
- {
- Name = "Basic workflow",
- Description = "Basic workflow update",
- Version = "1",
- Tasks = new TaskObject[]
- {
- new TaskObject
- {
- Id = "argo-task",
- Type = "argo",
- Description = "Argo task",
- Args = new Dictionary {
- { "workflow_template_name", "Workflow Name" },
- },
- Artifacts = new ArtifactMap()
- {
- Input = new Artifact[]
- {
- new Artifact { Name = "Dicom", Value = "{{ context.input.dicom }}" },
- },
- Output = new Artifact[]
- {
- new Artifact { Name = "Argo2" }
- }
- },
- TaskDestinations = new TaskDestination[] {
- new TaskDestination
- {
- Name = "clinical-review"
- }
- }
- },
- new TaskObject
- {
- Id = "clinical-review",
- Type = "aide_clinical_review",
- Description = "Basic Workflow update Task update",
- Args = new Dictionary
- {
- { "workflow_name", "test" },
- { "reviewed_task_id", "argo-task" },
- { "application_name", "test" },
- { "application_version", "1.1" },
- { "mode", "QA" },
- { "notifications", "cat" }
- },
- Artifacts = new ArtifactMap()
- {
- Input = new Artifact[]
- {
- new Artifact { Name = "Dicom", Value = "{{ context.input.dicom }}" },
- },
- Output = new Artifact[] {}
- },
- TaskDestinations = new TaskDestination[] { }
- }
- },
- InformaticsGateway = new InformaticsGateway()
- {
- AeTitle = "Update",
- DataOrigins = new string[] { "test" },
- ExportDestinations = new string[] { "test" }
- }
- };
-
- var request = new WorkflowUpdateRequest();
- request.Workflow = newWorkflow;
- request.OriginalWorkflowName = newWorkflow.Name + "1";
-
- var result = await WorkflowsController.ValidateAsync(request);
-
- var objectResult = Assert.IsType(result);
-
- Assert.Equal(400, objectResult.StatusCode);
-
- const string expectedInstance = "/workflows";
- Assert.StartsWith(expectedInstance, ((ProblemDetails)objectResult.Value).Instance);
- }
-
[Fact]
public async Task UpdateAsync_InvalidWorkflow_ReturnsBadRequest()
{