@@ -190,11 +190,21 @@ You can specify arrays of arrays, arrays of records, and other complex types.
190
190
191
191
## Inclusive and Exclusive Inputs
192
192
193
- Sometimes an underlying tool has several arguments that must be provided
194
- together (they are dependent) or several arguments that cannot be provided
195
- together (they are exclusive). You can use records and type unions to group
193
+ Sometimes an underlying tool has several arguments that must all be provided
194
+ together (they are inclusive/ dependent) or several arguments that cannot be provided
195
+ together, only one of the arguments can be provided (they are exclusive). You can use records and type unions to group
196
196
parameters together to describe these two conditions.
197
197
198
+ ``` {image} /_static/images/diagrams/inclusive_v_exclusive.png
199
+ :name: inclusive_v_exclusive-diagram
200
+ :width: 600px
201
+ :align: center
202
+ ```
203
+
204
+
205
+ With cwltool, if not all inclusive arguments are provided, an error is thrown.
206
+ If multiple exclusive arguments are provided, the first one is used and the rest are ignored.
207
+
198
208
``` {literalinclude} /_includes/cwl/inputs/record.cwl
199
209
:language: cwl
200
210
:caption: "`record.cwl`"
@@ -212,7 +222,7 @@ parameters together to describe these two conditions.
212
222
:emphasize-lines: 6-7
213
223
```
214
224
215
- In the first example, you can't provide ` itemA ` without also providing ` itemB ` .
225
+ In the first example, you can't provide ` itemA ` without also providing ` itemB ` , or an error is thrown. This is because they are inclusive (dependent) parameters. If you provide one, you must provide the other .
216
226
217
227
``` {literalinclude} /_includes/cwl/inputs/record-job2.yml
218
228
:language: yaml
@@ -230,8 +240,8 @@ $ cat output.txt
230
240
-A one -B two -C three
231
241
```
232
242
233
- In the second example, ` itemC ` and ` itemD ` are exclusive, so only the first
234
- matching item (` itemC ` ) is added to the command line and remaining item (` itemD ` ) is ignored.
243
+ In the second example, ` itemC ` and ` itemD ` are exclusive, but ` record-job2.yml ` provides both arguments, so only the first
244
+ matching item provided (` itemC ` ) is added to the command line and remaining item (` itemD ` ) is ignored.
235
245
236
246
``` {literalinclude} /_includes/cwl/inputs/record-job3.yml
237
247
:language: yaml
@@ -249,8 +259,8 @@ $ cat output.txt
249
259
-A one -B two -D four
250
260
```
251
261
252
- In the third example, only ` itemD ` is provided , so it appears on the
253
- command line.
262
+ In the third example, ` record-job3.yml ` only provides ` itemD ` , so ` itemD ` is what appears on the
263
+ command line.
254
264
255
265
### Exclusive Input Parameters with Expressions
256
266
0 commit comments