Skip to content

Clarify priority between when and step input valueFrom #110

@bogdang989

Description

@bogdang989

When a step input is transformed with valueFrom and is used in when expression, from the specification and conformance tests it's not clear should the when expression use the original or the transformed value.
Minimal example:

class: Workflow
cwlVersion: v1.2
inputs:
- id: input
  type: string?
- id: custom_input
  type: boolean
outputs:
- id: output
  outputSource:
  - step1/output
  type: string?
steps:
- id: step1
  in:
  - id: input
    source: input
  - id: custom_input
    source: custom_input
    valueFrom: "$(!self)"
  out:
  - id: output
  run:
    class: CommandLineTool
    cwlVersion: v1.2
    baseCommand:
    - echo
    inputs:
    - id: input
      type: string?
      inputBinding:
        position: 0
    outputs:
    - id: output
      type: string?
      outputBinding:
        outputEval: "$(inputs.input)"
  when: "$(inputs.custom_input)"
requirements:
- class: InlineJavascriptRequirement
- class: StepInputExpressionRequirement

When running with

custom_input: true

The transformation converts the value to false and the step is skipped if the transformed value is used, but it is not skipped if the original value is used. Right now cwltool uses the transformed value, just wanted to make sure this is expected and that it gets documented. The example can be used as a conformance test.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions