diff --git a/guidelines/mwm-workflow-spec.md b/guidelines/mwm-workflow-spec.md index 275d1e470..0b3957a79 100644 --- a/guidelines/mwm-workflow-spec.md +++ b/guidelines/mwm-workflow-spec.md @@ -120,6 +120,8 @@ This is the top-level object in a workflow spec. It contains the following prope |description|Optional[str] (200)| |informatics_gateway|[InformaticsGateway](#informatics-gateway)| |tasks|list[[Task](#tasks)]| +|dataRetentionDays|int| +|predicate|string[]| The following is an example of the structure of a workflow. @@ -134,8 +136,9 @@ The following is an example of the structure of a workflow. ┗ tasks\     ┣ task1\     ┣ task2\ -    ┗ task3 - +    ┗ task3\ +┣ dataRetentionDays\ +┣ predicate [A detailed breakdown of predicate logic can be found here.](https://github.com/Project-MONAI/monai-deploy-workflow-manager/blob/develop/guidelines/mwm-conditionals.md) #### Examples @@ -159,6 +162,8 @@ An example of a workflow with two tasks: "ORTHANC" ] }, + "dataRetentionDays": -1, + "predicate" : [] "tasks": [ { "id": "mean-pixel-calc", diff --git a/src/WorkflowManager/Contracts/Models/Workflow.cs b/src/WorkflowManager/Contracts/Models/Workflow.cs index f09178c99..ab53b299d 100755 --- a/src/WorkflowManager/Contracts/Models/Workflow.cs +++ b/src/WorkflowManager/Contracts/Models/Workflow.cs @@ -39,8 +39,8 @@ public class Workflow [JsonProperty(PropertyName = "dataRetentionDays")] public int? DataRetentionDays { get; set; } = 3;// note. -1 = never delete - [JsonProperty(PropertyName = "conditions")] - public string[] Conditions { get; set; } = []; + [JsonProperty(PropertyName = "predicate")] + public string[] Predicate { get; set; } = []; } } diff --git a/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs b/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs index a8779ea1c..361cdddae 100644 --- a/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs +++ b/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs @@ -1120,9 +1120,9 @@ private async Task ClinicalReviewTimeOutEvent(WorkflowInstance workflowIns // check if the conditionals allow the workflow to be created - if (workflow.Workflow.Conditions.Length != 0) + if (workflow.Workflow.Predicate.Length != 0) { - var conditionalMet = _conditionalParameterParser.TryParse(workflow.Workflow.Conditions, workflowInstance, out var resolvedConditional); + var conditionalMet = _conditionalParameterParser.TryParse(workflow.Workflow.Predicate, workflowInstance, out var resolvedConditional); if (conditionalMet is false) { return null; diff --git a/tests/UnitTests/WorkflowExecuter.Tests/Services/WorkflowExecuterServiceTests.cs b/tests/UnitTests/WorkflowExecuter.Tests/Services/WorkflowExecuterServiceTests.cs index 3312894b9..c6697ccb5 100755 --- a/tests/UnitTests/WorkflowExecuter.Tests/Services/WorkflowExecuterServiceTests.cs +++ b/tests/UnitTests/WorkflowExecuter.Tests/Services/WorkflowExecuterServiceTests.cs @@ -3903,7 +3903,7 @@ public async Task ProcessPayload_With_Failing_Workflow_Conditional_Should_Not_Pr Description = "taskdesc" } ], - Conditions = ["{{ context.dicom.series.any('0010','0040') }} == 'lordge'"] + Predicate = ["{{ context.dicom.series.any('0010','0040') }} == 'lordge'"] } } }; @@ -3956,7 +3956,7 @@ public async Task ProcessPayload_With_Passing_Workflow_Conditional_Should_Procce Description = "taskdesc" } ], - Conditions = ["{{ context.dicom.series.any('0010','0040') }} == 'lordge'"] + Predicate = ["{{ context.dicom.series.any('0010','0040') }} == 'lordge'"] } } };