Skip to content

Example for using expressions with exclusive parameters #162

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

Closed
pvanheus opened this issue Sep 6, 2019 · 1 comment · Fixed by #247
Closed

Example for using expressions with exclusive parameters #162

pvanheus opened this issue Sep 6, 2019 · 1 comment · Fixed by #247

Comments

@pvanheus
Copy link

pvanheus commented Sep 6, 2019

If you use exclusive parameters (as documented in the Advanced Parameters) section together with expressions you might end up with a situation where an expression is undefined. An example of such non-working CWL is here.

The solution is to use logical OR to provide a default value to the expression (thanks to @tetron) for explaining this. I.e. expressions like $(inputs.output.output_file || []). This works because expressions are ECMAScript expressions, something I didn't realise until last night.

I am preparing a pull request to add this explanation to the User Guide but I cannot right now come up with a simple example illustrating this, so I'm opening this issue to ask if anyone can come up with a straightforward example and also to remind myself to complete this addition to the guide.

@kinow
Copy link
Member

kinow commented Sep 5, 2022

Link to new Advanced Inputs section, which has the same contents as the old Advanced Parameters linked above: https://www.commonwl.org/user_guide/topics/inputs.html#advanced-inputs

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