Skip to content

Commit 90fe42a

Browse files
committed
Handled Exception Metadata documentation
Signed-off-by: Lillie Dae <[email protected]>
1 parent 9afe61c commit 90fe42a

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

docs/setup/mwm-workflow-spec.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ Workflows can be created or updated via the [Workflow API](https://github.com/Pr
4848
- [Plugin](#plugin)
4949
- [Task Arguments](#task-arguments)
5050
- [Argo](#argo)
51-
- [Resource Request Object](#resource-request-object)
5251
- [Clinical Review](#clinical-review)
5352
- [Router](#router-1)
5453
- [Export](#export-1)
@@ -69,6 +68,7 @@ Workflows can be created or updated via the [Workflow API](https://github.com/Pr
6968
- [Execution Context](#execution-context)
7069
- [Result Metadata \& Execution Stats - Using Dictionary Values](#result-metadata--execution-stats---using-dictionary-values)
7170
- [Argo Metadata](#argo-metadata)
71+
- [Handled Exception Metadata](#handled-exception-metadata)
7272
- [DICOM Tags](#dicom-tags)
7373
- [Patient Details Context](#patient-details-context)
7474
- [Workflow Context](#workflow-context)
@@ -711,7 +711,7 @@ Conditional evaluators are logical statement strings that may be used to determi
711711

712712
NOT_CONTAINS (Valid for integers and strings compared to lists)
713713

714-
more information on conditionals can be found [Conditionals Docs](guidelines\mwm-conditionals.md)
714+
more information on conditionals can be found [Conditionals Docs](..\..\guidelines\mwm-conditionals.md)
715715

716716
### Context
717717
The workflow metadata is any data that can be used by Evaluators. This includes metadata added by previous tasks, but can also include metadata about the input files (most notably DICOM tags).
@@ -799,6 +799,30 @@ An example format of the metadata.json can be found below:
799799

800800
execution stats are populated from the argo execution values returned automatically.
801801

802+
#### Handled Exception Metadata
803+
Application models can throw handled exceptions to do this application model should output to the `metadata.json` and include for example...
804+
```json
805+
{
806+
"exception": "NoDicomFilesException",
807+
"exception_message": "No dicom files found."
808+
}
809+
```
810+
811+
This can be used in the workflow task destinations queries for example like the following examples...
812+
813+
```python
814+
{{ context.executions.task_id.result.exception }} == 'NoDicomFilesException' && {{ context.executions.task_id.result.exception_message }} == 'No dicom files found.'
815+
```
816+
817+
818+
```python
819+
{{ context.executions.task_id.result.exception_message }} CONTAINS 'No dicom files'
820+
```
821+
822+
```python
823+
{{ context.executions.task_id.result.exception }} == NULL
824+
```
825+
802826

803827
#### DICOM Tags
804828
When the input data is DICOM, Evaluators can use DICOM tag values in conditional statements.

0 commit comments

Comments
 (0)