Skip to content

Commit 31aa4ea

Browse files
author
Peter Amstutz
committed
Optional secondaryFiles
1 parent f78455f commit 31aa4ea

File tree

4 files changed

+34
-8
lines changed

4 files changed

+34
-8
lines changed

Process.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,9 @@ $graph:
237237
- "null"
238238
- type: array
239239
items: [File, Directory]
240-
jsonldPredicate: "cwl:secondaryFiles"
240+
jsonldPredicate:
241+
_id: "cwl:secondaryFiles"
242+
secondaryFilesDSL: true
241243
doc: |
242244
A list of additional files or directories that are associated with the
243245
primary file and must be transferred alongside the primary file.
@@ -458,12 +460,12 @@ $graph:
458460
secondaryFiles:
459461
type:
460462
- "null"
461-
- string
462-
- Expression
463463
- SecondaryFileSchema
464464
- type: array
465-
items: [string, Expression, SecondaryFileSchema, "null"]
466-
jsonldPredicate: "cwl:secondaryFiles"
465+
items: SecondaryFileSchema
466+
jsonldPredicate:
467+
_id: "cwl:secondaryFiles"
468+
secondaryFilesDSL: true
467469
doc: |
468470
Only valid when `type: File` or is an array of `items: File`.
469471
@@ -902,7 +904,7 @@ $graph:
902904
the resulting secondary file as optional.
903905
3. Append the remainder of the string to the end of the file path.
904906
- name: required
905-
type: boolean?
907+
type: ["null", boolean, string, Expression]
906908
doc: |
907909
An implementation must not fail workflow execution if `required` is
908910
set to `false` and the expected secondary file does not exist.

conformance_tests.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1369,6 +1369,14 @@
13691369
doc: Test required, optional and null secondaryFiles on array of files.
13701370
tags: [ docker, inline_javascript, shell_command, command_line_tool ]
13711371

1372+
- job: tests/docker-array-secondaryfiles-job2.json
1373+
should_fail: true
1374+
tool: tests/docker-array-secondaryfiles.cwl
1375+
label: filesarray_secondaryfiles2
1376+
id: 100
1377+
doc: Test required, optional and null secondaryFiles on array of files.
1378+
tags: [ docker, inline_javascript, shell_command, command_line_tool ]
1379+
13721380
- job: tests/dir7.yml
13731381
output: {
13741382
"dir": {
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"fasta_path": [
3+
{
4+
"class": "File",
5+
"location": "ref.fasta"
6+
},
7+
{
8+
"class": "File",
9+
"location": "ref2.fasta"
10+
}
11+
],
12+
"require_dat": true
13+
}

tests/docker-array-secondaryfiles.cwl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@ inputs:
2121
- pattern: .crai
2222
required: false
2323
- .bai?
24-
- pattern: "${ return null }"
25-
24+
- "${ if (inputs.require_dat) {return '.dat'} else {return null} }"
25+
- "${ return null; }"
26+
- pattern: .dat2
27+
required: $(inputs.require_dat)
28+
require_dat: boolean?
2629

2730
outputs:
2831
bai_list:

0 commit comments

Comments
 (0)