Skip to content

Commit 7732be5

Browse files
authored
Merge pull request #48 from common-workflow-language/main_is_default
defaulting to #main for CWL $graphs
2 parents 498c78d + ac64307 commit 7732be5

File tree

6 files changed

+100
-11
lines changed

6 files changed

+100
-11
lines changed

CommandLineTool.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ $graph:
5757
* When defining record types with `CommandInputRecordSchema`, fields of
5858
type `File` may now include `format`, `loadContents`,
5959
`secondaryFiles` and `streamable`.
60-
* `CommandInputRecordSchema`, `CommandOutputRecordSchema`,
61-
`CommandInputEnumSchema and `CommandInputArraySchema` now have an optional
60+
* `CommandInputRecordSchema`, `CommandOutputRecordSchema`,
61+
`CommandInputEnumSchema and `CommandInputArraySchema` now have an optional
6262
`doc` field.
6363
* `inputBinding` has been added as an optional field for
6464
`CommandInputRecordSchema` (was previously in CWL `draft-3` but
@@ -108,6 +108,8 @@ $graph:
108108
* [Better explain](#map) the `map<…>` notation that has existed since v1.0.
109109
* Fixed schema error where the `type` field inside the `inputs` and
110110
`outputs` field was incorrectly listed as optional.
111+
* For multi-Process CWL documents, if no particular process is named then
112+
the process with the `id` of `#main` is chosen.
111113
112114
See also the [CWL Workflow Description, v1.1.0-dev1 changelog](Workflow.html#Changelog).
113115

Workflow.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ $graph:
9292
* Fixed schema error where the `type` field inside the `inputs` and
9393
`outputs` fields for both `Workflow` and `ExpressionTool` was
9494
incorrectly listed as optional.
95+
* For multi-Process CWL documents, if no particular process is named then
96+
the process with the `id` of `#main` is chosen.
9597
9698
See also the [CWL Command Line Tool Description, v1.1.0-dev1 changelog](CommandLineTool.html#Changelog).
9799

concepts.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -366,15 +366,19 @@ of [process requirements](#Requirements_and_hints).
366366
The generic execution sequence of a CWL process (including workflows and
367367
command line line tools) is as follows.
368368

369-
1. Load, process and validate a CWL document, yielding a process object.
370-
2. Load input object.
371-
3. Validate the input object against the `inputs` schema for the process.
372-
4. Validate process requirements are met.
373-
5. Perform any further setup required by the specific process type.
374-
6. Execute the process.
375-
7. Capture results of process execution into the output object.
376-
8. Validate the output object against the `outputs` schema for the process.
377-
9. Report the output object to the process caller.
369+
1. Load input object.
370+
1. Load, process and validate a CWL document, yielding one or more process objects.
371+
1. If there are multiple process objects (due to [`$graph`](SchemaSalad.html#Document_graph))
372+
and which process object to start with is not specified in the input object (via
373+
a [`cwl:tool`](#Executing_CWL_documents_as_scripts) entry) or by any other means
374+
(like a URL fragment) then choose the process with the `id` of "#main" or "main".
375+
1. Validate the input object against the `inputs` schema for the process.
376+
1. Validate process requirements are met.
377+
1. Perform any further setup required by the specific process type.
378+
1. Execute the process.
379+
1. Capture results of process execution into the output object.
380+
1. Validate the output object against the `outputs` schema for the process.
381+
1. Report the output object to the process caller.
378382

379383
## Requirements and hints
380384

conformance_tests.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3200,3 +3200,22 @@
32003200
code: 7
32013201
doc: Can access exit code in outputEval
32023202
tags: [ command_line_tool, required ]
3203+
3204+
- tool: tests/echo-tool-packed.cwl
3205+
job: tests/env-job.json
3206+
output:
3207+
{"out": "hello test env\n"}
3208+
label: any_input_param_graph_no_default
3209+
doc: Test use of $graph without specifying which process to run
3210+
tags: [ required, command_line_tool ]
3211+
3212+
- tool: tests/echo-tool-packed2.cwl
3213+
job: tests/env-job.json
3214+
output:
3215+
{"out": "hello test env\n"}
3216+
label: any_input_param_graph_no_default_hashmain
3217+
doc: |
3218+
Test use of $graph without specifying which process to run,
3219+
hash-prefixed "main"
3220+
tags: [ required, command_line_tool ]
3221+

tests/echo-tool-packed.cwl

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
cwlVersion: v1.1.0-dev1
2+
$graph:
3+
- class: CommandLineTool
4+
id: first
5+
inputs:
6+
in:
7+
type: Any
8+
outputs:
9+
out:
10+
type: string
11+
outputBinding:
12+
glob: out.txt
13+
loadContents: true
14+
outputEval: $(self[0].contents)
15+
baseCommand: [ echo, first ]
16+
stdout: out.txt
17+
- class: CommandLineTool
18+
id: main
19+
inputs:
20+
in:
21+
type: Any
22+
inputBinding: {}
23+
outputs:
24+
out:
25+
type: string
26+
outputBinding:
27+
glob: out.txt
28+
loadContents: true
29+
outputEval: $(self[0].contents)
30+
baseCommand: echo
31+
stdout: out.txt

tests/echo-tool-packed2.cwl

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
cwlVersion: v1.1.0-dev1
2+
$graph:
3+
- class: CommandLineTool
4+
id: first
5+
inputs:
6+
in:
7+
type: Any
8+
outputs:
9+
out:
10+
type: string
11+
outputBinding:
12+
glob: out.txt
13+
loadContents: true
14+
outputEval: $(self[0].contents)
15+
baseCommand: [ echo, first ]
16+
stdout: out.txt
17+
- class: CommandLineTool
18+
id: '#main'
19+
inputs:
20+
in:
21+
type: Any
22+
inputBinding: {}
23+
outputs:
24+
out:
25+
type: string
26+
outputBinding:
27+
glob: out.txt
28+
loadContents: true
29+
outputEval: $(self[0].contents)
30+
baseCommand: echo
31+
stdout: out.txt

0 commit comments

Comments
 (0)