Reference implementation rejects step without inputs
1
0
Entering edit mode
8.0 years ago
unduthegun • 0

I'm trying to build a workflow with a step that doesn't take any input:

The workflow fails to validate with this error:

/home/psafont/.virtualenvs/cwl/bin/cwl-runner 1.0.20161207161158
Resolved 'textures.cwl' to 'file:///home/psafont/dev/stellaris-emblem-lab/textures/scripts/textures.cwl'
Tool definition failed validation:
Validation error in object file:///home/psafont/dev/stellaris-emblem-lab/textures/scripts/textures.cwl
  Could not validate `Workflow` because
    Workflow record could not validate field `steps` because
      the value `[{'id': u'file:///home/psafont/dev/stellaris-emblem-lab/textures/scripts/textures.cwl#gradients',
        'out': [u'file:///home/psafont/dev/stellaris-emblem-lab/text[...]`
       is not a valid type in the union, expected one of:
      - array of <WorkflowStep>, but
         At position 0
          missing required field `in`

This is the workflow:

cwlVersion: v1.0
doc: Create emblem textures
class: Workflow

inputs:
  outlines: File[]
outputs:
  texture_small:
    type: File
    outputSource: textures/small
    outputBinding:
      outputEval: texture/$(inputs.outline.nameroot).dds

steps:
  gradients:
    id: gradients
    run: tools/gradients_gen.cwl
    out: [fill_gradient, highlight_gradient]

  textures:
    id: textures
    run: texture_emblem.cwl
    requirements: ScatterfeatureRequirement
    scatter: outline
    in:
      outline: outlines
      fill_gradient: gradients/fill_gradient
      highlight_gradient: gradients/highlight_gradient
    out: [small]

I'd like to know if the 'in' parameter is not-so-optional or there's something else I'm missing.

Note: I'm sure there are other mistakes in the workflow, but this is the error I'm encountering right now :)

Common-Workflow-Language cwl • 1.9k views
ADD COMMENT
2
Entering edit mode
8.0 years ago
peter.amstutz ▴ 300

You need to provide an "in" section with an empty list. Also "id: gradients" is redundant:

gradients:
    run: tools/gradients_gen.cwl
    in: []
    out: [fill_gradient, highlight_gradient]

However you're right, as a general rule, fields which can accept empty lists should be optional.

ADD COMMENT
0
Entering edit mode

I see, I found it confusing because I understood from the documentation that the field is optional.

From Fields in Subworkflows in http://www.commonwl.org/v1.0/Workflow.html#WorkflowStep :

field: in; type: [...]; required: Optional; description: [...]
ADD REPLY
1
Entering edit mode

The website has been fixed -- thank you for bringing that to our attention. I agree with Peter that fields which can accept empty lists should be optional.

ADD REPLY
0
Entering edit mode

That's odd, there is an error with the website generation; that field is indeed required in v1.0. [Peter, looks like a bad version of schema salad?]

ADD REPLY

Login before adding your answer.

Traffic: 2350 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6