Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ease optional access with scatter-like block #1852

Closed
cjllanwarne opened this issue Jan 12, 2017 · 3 comments
Closed

Ease optional access with scatter-like block #1852

cjllanwarne opened this issue Jan 12, 2017 · 3 comments

Comments

@cjllanwarne
Copy link
Contributor

cjllanwarne commented Jan 12, 2017

Equivalent to scatter blocks for arrays, I propose a new ifDefined block for optionals:

workflow foo {
  String? bar
  ifDefined (String concreteBar in bar) {
    call baz { input: x = concreteBar }
  }
  output {
    # Just like outputs from inside a scatter become array outputs, isDefined creates optional outputs:
    String? baz_out = baz.out
  }
}

task baz {
  String x
  command { ... }
  output { String out = ... }
}
@cjllanwarne
Copy link
Contributor Author

NB this could be pure syntactic sugar for:

workflow foo {
  String? bar
  if (length(select_all([bar])) == 1) {
    String concreteBar = select_first([bar])
    call baz { input: x = concreteBar }
  }
  output {
    String? baz_out = baz.out
  }
}

@katevoss
Copy link

@cjllanwarne can you explain when a user would encounter this? Was it something you heard requested, or was it a "we should improve this because we know it's not as good as it could be"?

@cjllanwarne
Copy link
Contributor Author

I'm moving this WDL spec change issue to openwdl/wdl#187 and closing this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants