Skip to content

Commit 11b96f1

Browse files
authored
Merge pull request #242 from common-workflow-language/scatter-inputs
Scatter inputs valueFrom use post-scatter inputs
2 parents 9caa2cf + 93b60d9 commit 11b96f1

File tree

3 files changed

+70
-4
lines changed

3 files changed

+70
-4
lines changed

draft-4/Workflow.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,12 @@ $graph:
255255
the value of the parameter(s) specified in the `source` field, or
256256
null if there is no `source` field.
257257
258-
The value of `inputs` in the parameter reference or expression is the
259-
input object to the workflow step after assigning the `source` values,
260-
but before evaluating any step with `valueFrom`. The order of
261-
evaluating `valueFrom` among step input parameters is undefined.
258+
The value of `inputs` in the parameter reference or expression must be
259+
the input object to the workflow step after assigning the `source`
260+
values and then scattering. The order of evaluating `valueFrom` among
261+
step input parameters is undefined and the result of evaluating
262+
`valueFrom` on a parameter must not be visible to evaluation of
263+
`valueFrom` on other parameters.
262264
263265
264266
- type: record

draft-4/conformance_test_draft-4.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,12 @@
691691
tool: "draft-4/scatter-valuefrom-wf4.cwl#main"
692692
doc: Test workflow scatter with two scatter parameters and dotproduct join method and valueFrom on step input
693693

694+
- job: draft-4/scatter-valuefrom-job1.json
695+
output:
696+
out: ["foo one one", "foo two two", "foo three three", "foo four four"]
697+
tool: draft-4/scatter-valuefrom-wf5.cwl
698+
doc: Test workflow scatter with single scatter parameter and valueFrom on step input
699+
694700
- job: draft-4/conflict-job.json
695701
output: {
696702
"fileout": {
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#!/usr/bin/env cwl-runner
2+
cwlVersion: cwl:draft-4.dev3
3+
class: Workflow
4+
inputs:
5+
inp:
6+
type:
7+
type: array
8+
items:
9+
type: record
10+
name: instr
11+
fields:
12+
- name: instr
13+
type: string
14+
outputs:
15+
out:
16+
type:
17+
type: array
18+
items: string
19+
outputSource: step1/echo_out
20+
21+
requirements:
22+
- class: ScatterFeatureRequirement
23+
- class: StepInputExpressionRequirement
24+
25+
steps:
26+
step1:
27+
in:
28+
echo_in:
29+
source: inp
30+
valueFrom: $(self.instr)
31+
first:
32+
source: inp
33+
valueFrom: $(inputs.echo_in.instr)
34+
out: [echo_out]
35+
scatter: echo_in
36+
run:
37+
class: CommandLineTool
38+
inputs:
39+
first:
40+
type: string
41+
inputBinding:
42+
position: 1
43+
echo_in:
44+
type: string
45+
inputBinding:
46+
position: 2
47+
outputs:
48+
echo_out:
49+
type: string
50+
outputBinding:
51+
glob: "step1_out"
52+
loadContents: true
53+
outputEval: $(self[0].contents)
54+
baseCommand: "echo"
55+
arguments:
56+
- "-n"
57+
- "foo"
58+
stdout: "step1_out"

0 commit comments

Comments
 (0)