Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions guidelines/mwm-workflow-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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
Expand All @@ -159,6 +162,8 @@ An example of a workflow with two tasks:
"ORTHANC"
]
},
"dataRetentionDays": -1,
"predicate" : []
"tasks": [
{
"id": "mean-pixel-calc",
Expand Down
4 changes: 2 additions & 2 deletions src/WorkflowManager/Contracts/Models/Workflow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; } = [];

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1120,9 +1120,9 @@ private async Task<bool> 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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'"]
}
}
};
Expand Down Expand Up @@ -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'"]
}
}
};
Expand Down