Skip to content

Commit f14aa30

Browse files
GlassOfWhiskeytetron
authored andcommitted
Sink type refactoring
This commit is motivated by the fact that the `linkMerge` and `pickValue` fields were repeated in the `Sink` and `WorkflowOutputParameter` types. To remove this repetition, these two fields have been isolated in a new type called `Sink`. The previous `Sink` type, which is now named `InputSink` extends `Sink` with the `source` field, while a new `OutputSink` type extends `Sink` with the `outputSource` field. The `WorkflowInputParameter` type extends the `InputSink`, while the `WorkflowOutputParameter` type inherits from `OutputSink`. Note that this separation will be useful also for future extensions. For example, the proposed `loop` feature will build upon the `OutputSink` type to map the step outputs into the inputs of the next iteration.
1 parent b9f1506 commit f14aa30

File tree

1 file changed

+52
-52
lines changed

1 file changed

+52
-52
lines changed

Workflow.yml

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -349,18 +349,46 @@ $graph:
349349
- all_non_null
350350

351351

352-
- name: WorkflowOutputParameter
352+
- name: Sink
353353
type: record
354-
extends: OutputParameter
355-
docParent: "#Workflow"
356-
doc: |
357-
Describe an output parameter of a workflow. The parameter must be
358-
connected to one or more parameters defined in the workflow that
359-
will provide the value of the output parameter. It is legal to
360-
connect a WorkflowInputParameter to a WorkflowOutputParameter.
354+
abstract: true
355+
fields:
356+
- name: linkMerge
357+
type: LinkMergeMethod?
358+
jsonldPredicate: "cwl:linkMerge"
359+
default: merge_nested
360+
doc: |
361+
The method to use to merge multiple inbound links into a single array.
362+
If not specified, the default method is "merge_nested".
363+
- name: pickValue
364+
type: [ "null", PickValueMethod ]
365+
jsonldPredicate: "cwl:pickValue"
366+
doc: |
367+
The method to use to choose non-null elements among multiple sources.
361368
362-
See [WorkflowStepInput](#WorkflowStepInput) for discussion of
363-
`linkMerge` and `pickValue`.
369+
370+
- name: InputSink
371+
type: record
372+
extends: Sink
373+
abstract: true
374+
fields:
375+
- name: source
376+
doc: |
377+
Specifies one or more workflow parameters that will provide input to
378+
the underlying step parameter.
379+
jsonldPredicate:
380+
"_id": "cwl:source"
381+
"_type": "@id"
382+
refScope: 2
383+
type:
384+
- string?
385+
- string[]?
386+
387+
388+
- name: OutputSink
389+
type: record
390+
extends: Sink
391+
abstract: true
364392
fields:
365393
- name: outputSource
366394
doc: |
@@ -376,20 +404,21 @@ $graph:
376404
type:
377405
- string?
378406
- string[]?
379-
- name: linkMerge
380-
type: ["null", LinkMergeMethod]
381-
jsonldPredicate: "cwl:linkMerge"
382-
default: merge_nested
383-
doc: |
384-
The method to use to merge multiple sources into a single array.
385-
If not specified, the default method is "merge_nested".
386407

387-
- name: pickValue
388-
type: ["null", PickValueMethod]
389-
jsonldPredicate: "cwl:pickValue"
390-
doc: |
391-
The method to use to choose non-null elements among multiple sources.
392408

409+
- name: WorkflowOutputParameter
410+
type: record
411+
extends: [OutputParameter, OutputSink]
412+
docParent: "#Workflow"
413+
doc: |
414+
Describe an output parameter of a workflow. The parameter must be
415+
connected to one or more parameters defined in the workflow that
416+
will provide the value of the output parameter. It is legal to
417+
connect a WorkflowInputParameter to a WorkflowOutputParameter.
418+
419+
See [WorkflowStepInput](#WorkflowStepInput) for discussion of
420+
`linkMerge` and `pickValue`.
421+
fields:
393422
- name: type
394423
type:
395424
- CWLType
@@ -413,38 +442,9 @@ $graph:
413442
Specify valid types of data that may be assigned to this parameter.
414443
415444
416-
- name: Sink
417-
type: record
418-
abstract: true
419-
fields:
420-
- name: source
421-
doc: |
422-
Specifies one or more workflow parameters that will provide input to
423-
the underlying step parameter.
424-
jsonldPredicate:
425-
"_id": "cwl:source"
426-
"_type": "@id"
427-
refScope: 2
428-
type:
429-
- string?
430-
- string[]?
431-
- name: linkMerge
432-
type: LinkMergeMethod?
433-
jsonldPredicate: "cwl:linkMerge"
434-
default: merge_nested
435-
doc: |
436-
The method to use to merge multiple inbound links into a single array.
437-
If not specified, the default method is "merge_nested".
438-
- name: pickValue
439-
type: ["null", PickValueMethod]
440-
jsonldPredicate: "cwl:pickValue"
441-
doc: |
442-
The method to use to choose non-null elements among multiple sources.
443-
444-
445445
- type: record
446446
name: WorkflowStepInput
447-
extends: [Identified, Sink, LoadContents, Labeled]
447+
extends: [Identified, InputSink, LoadContents, Labeled]
448448
docParent: "#WorkflowStep"
449449
doc: |
450450
The input of a workflow step connects an upstream parameter (from the

0 commit comments

Comments
 (0)