-
-
Notifications
You must be signed in to change notification settings - Fork 199
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
How to specify lower and upper bound for type array
in WorkflowInputParameter
#907
Comments
Hello @emmanuelmathot . There is a proposal to add this to CWL but it hasn't been implemented yet. Assistance with implementing the proposal is welcome, just leave a comment in that issue (linked above) to indicate your interest and to ask us for the next steps. Here are options for a workaround that will get the job done on all CWL v1.x compliant systems today:
cwlVersion: v1.0
class: CommandLineTool
requirements:
InlineJavascriptRequirement: {}
inputs:
main_input:
type: string
label: Main input
correlated_input:
type:
type: array
items: string
inputBinding:
valueFrom: |
${
if (self.length > 2 && self.length <= 10) {
return self;
} else {
throw "value is out of bounds!";
}
}
cwlVersion: v1.0
class: Workflow
requirements:
InlineJavascriptRequirement: {}
inputs:
corr: string[]
steps:
correlation:
run: correlate.cwl
in:
correlated_input:
source: corr
valueFrom: |
${
if (self.length > 2 && self.length <= 10) {
return self;
} else {
throw "value is out of bounds!";
}
}
out: []
Once you get comfortable doing this you are partially on your way to implementing the proposed extension, as we can help you write a tool that takes CWL documents that use the proposed syntax and inserts the |
We would like to know if it is possible to specify a lower and upper boundary in the number of items in array of an input parameter. That specification would of course imply a validation of the number of input parameter.
So the input definition in CWL would be similar to :
Thank you for your help.
The text was updated successfully, but these errors were encountered: