Question: Reference implementation rejects step without inputs
0
gravatar for unduthegun
4.0 years ago by
unduthegun0
unduthegun0 wrote:

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 :)

ADD COMMENTlink modified 4.0 years ago • written 4.0 years ago by unduthegun0
2
gravatar for peter.amstutz
4.0 years ago by
peter.amstutz300
peter.amstutz300 wrote:

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 COMMENTlink written 4.0 years ago by peter.amstutz300

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 REPLYlink written 4.0 years ago by unduthegun0
1

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 REPLYlink written 4.0 years ago by Michael R. Crusoe1.8k

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 REPLYlink written 4.0 years ago by Michael R. Crusoe1.8k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1598 users visited in the last hour