1 /** 2 * Generated by schema-salad code generator 3 * 4 * Date: 2022-11-10 5 */ 6 module cwl_d_auto.v1_1; 7 8 import salad.meta.dumper : genDumper; 9 import salad.meta.impl : genCtor, genIdentifier, genOpEq; 10 import salad.meta.parser : import_ = importFromURI; 11 import salad.meta.uda : documentRoot, id, idMap, link, secondaryFilesDSL, typeDSL; 12 import salad.primitives : SchemaBase; 13 import salad.type : None, Either; 14 15 /// parser information 16 enum parserInfo = "CWL v1.1 parser generated with schema-salad-tool"; 17 18 /** 19 * Salad data types are based on Avro schema declarations. Refer to the 20 * [Avro schema declaration documentation](https://avro.apache.org/docs/current/spec.html#schemas) for 21 * detailed information. 22 * null: no value 23 * boolean: a binary value 24 * int: 32-bit signed integer 25 * long: 64-bit signed integer 26 * float: single precision (32-bit) IEEE 754 floating-point number 27 * double: double precision (64-bit) IEEE 754 floating-point number 28 * string: Unicode character sequence 29 */ 30 class PrimitiveType : SchemaBase 31 { 32 enum Symbol 33 { 34 s0 = "null", 35 s1 = "boolean", 36 s2 = "int", 37 s3 = "long", 38 s4 = "float", 39 s5 = "double", 40 s6 = "string" 41 } 42 43 Symbol value; 44 45 mixin genCtor; 46 mixin genOpEq; 47 mixin genDumper; 48 } 49 50 /// 51 public import salad.primitives : Any; 52 53 /** 54 * A field of a record. 55 */ 56 class RecordField : SchemaBase 57 { 58 /** 59 * A documentation string for this object, or an array of strings which should be concatenated. 60 */ 61 Either!(None, string, string[]) doc_; 62 /** 63 * The name of the field 64 */ 65 @id string name_; 66 /** 67 * The field type 68 */ 69 @typeDSL Either!(PrimitiveType, RecordSchema, EnumSchema, ArraySchema, string, Either!(PrimitiveType, RecordSchema, EnumSchema, ArraySchema, string)[]) type_; 70 71 mixin genCtor; 72 mixin genIdentifier; 73 mixin genDumper; 74 } 75 76 /// 77 class RecordSchema : SchemaBase 78 { 79 /** 80 * Defines the fields of the record. 81 */ 82 @idMap("name", "type") Either!(None, RecordField[]) fields_; 83 /** 84 * Must be `record` 85 */ 86 static immutable type_ = "record"; 87 88 mixin genCtor; 89 mixin genIdentifier; 90 mixin genDumper; 91 } 92 93 /** 94 * Define an enumerated type. 95 */ 96 class EnumSchema : SchemaBase 97 { 98 /** 99 * Defines the set of valid symbols. 100 */ 101 @link string[] symbols_; 102 /** 103 * Must be `enum` 104 */ 105 static immutable type_ = "enum"; 106 107 mixin genCtor; 108 mixin genIdentifier; 109 mixin genDumper; 110 } 111 112 /// 113 class ArraySchema : SchemaBase 114 { 115 /** 116 * Defines the type of the array elements. 117 */ 118 Either!(PrimitiveType, RecordSchema, EnumSchema, ArraySchema, string, Either!(PrimitiveType, RecordSchema, EnumSchema, ArraySchema, string)[]) items_; 119 /** 120 * Must be `array` 121 */ 122 static immutable type_ = "array"; 123 124 mixin genCtor; 125 mixin genIdentifier; 126 mixin genDumper; 127 } 128 129 /** 130 * Version symbols for published CWL document versions. 131 */ 132 class CWLVersion : SchemaBase 133 { 134 enum Symbol 135 { 136 s0 = "draft-2", 137 s1 = "draft-3.dev1", 138 s2 = "draft-3.dev2", 139 s3 = "draft-3.dev3", 140 s4 = "draft-3.dev4", 141 s5 = "draft-3.dev5", 142 s6 = "draft-3", 143 s7 = "draft-4.dev1", 144 s8 = "draft-4.dev2", 145 s9 = "draft-4.dev3", 146 s10 = "v1.0.dev4", 147 s11 = "v1.0", 148 s12 = "v1.1.0-dev1", 149 s13 = "v1.1" 150 } 151 152 Symbol value; 153 154 mixin genCtor; 155 mixin genOpEq; 156 mixin genDumper; 157 } 158 159 /** 160 * Extends primitive types with the concept of a file and directory as a builtin type. 161 * File: A File object 162 * Directory: A Directory object 163 */ 164 class CWLType : SchemaBase 165 { 166 enum Symbol 167 { 168 s0 = "null", 169 s1 = "boolean", 170 s2 = "int", 171 s3 = "long", 172 s4 = "float", 173 s5 = "double", 174 s6 = "string", 175 s7 = "File", 176 s8 = "Directory" 177 } 178 179 Symbol value; 180 181 mixin genCtor; 182 mixin genOpEq; 183 mixin genDumper; 184 } 185 186 /** 187 * Represents a file (or group of files when `secondaryFiles` is provided) that 188 * will be accessible by tools using standard POSIX file system call API such as 189 * open(2) and read(2). 190 * Files are represented as objects with `class` of `File`. File objects have 191 * a number of properties that provide metadata about the file. 192 * The `location` property of a File is a URI that uniquely identifies the 193 * file. Implementations must support the file:// URI scheme and may support 194 * other schemes such as http://. The value of `location` may also be a 195 * relative reference, in which case it must be resolved relative to the URI 196 * of the document it appears in. Alternately to `location`, implementations 197 * must also accept the `path` property on File, which must be a filesystem 198 * path available on the same host as the CWL runner (for inputs) or the 199 * runtime environment of a command line tool execution (for command line tool 200 * outputs). 201 * If no `location` or `path` is specified, a file object must specify 202 * `contents` with the UTF-8 text content of the file. This is a "file 203 * literal". File literals do not correspond to external resources, but are 204 * created on disk with `contents` with when needed for a executing a tool. 205 * Where appropriate, expressions can return file literals to define new files 206 * on a runtime. The maximum size of `contents` is 64 kilobytes. 207 * The `basename` property defines the filename on disk where the file is 208 * staged. This may differ from the resource name. If not provided, 209 * `basename` must be computed from the last path part of `location` and made 210 * available to expressions. 211 * The `secondaryFiles` property is a list of File or Directory objects that 212 * must be staged in the same directory as the primary file. It is an error 213 * for file names to be duplicated in `secondaryFiles`. 214 * The `size` property is the size in bytes of the File. It must be computed 215 * from the resource and made available to expressions. The `checksum` field 216 * contains a cryptographic hash of the file content for use it verifying file 217 * contents. Implementations may, at user option, enable or disable 218 * computation of the `checksum` field for performance or other reasons. 219 * However, the ability to compute output checksums is required to pass the 220 * CWL conformance test suite. 221 * When executing a CommandLineTool, the files and secondary files may be 222 * staged to an arbitrary directory, but must use the value of `basename` for 223 * the filename. The `path` property must be file path in the context of the 224 * tool execution runtime (local to the compute node, or within the executing 225 * container). All computed properties should be available to expressions. 226 * File literals also must be staged and `path` must be set. 227 * When collecting CommandLineTool outputs, `glob` matching returns file paths 228 * (with the `path` property) and the derived properties. This can all be 229 * modified by `outputEval`. Alternately, if the file `cwl.output.json` is 230 * present in the output, `outputBinding` is ignored. 231 * File objects in the output must provide either a `location` URI or a `path` 232 * property in the context of the tool execution runtime (local to the compute 233 * node, or within the executing container). 234 * When evaluating an ExpressionTool, file objects must be referenced via 235 * `location` (the expression tool does not have access to files on disk so 236 * `path` is meaningless) or as file literals. It is legal to return a file 237 * object with an existing `location` but a different `basename`. The 238 * `loadContents` field of ExpressionTool inputs behaves the same as on 239 * CommandLineTool inputs, however it is not meaningful on the outputs. 240 * An ExpressionTool may forward file references from input to output by using 241 * the same value for `location`. 242 */ 243 class File : SchemaBase 244 { 245 /** 246 * Must be `File` to indicate this object describes a file. 247 */ 248 static immutable class_ = "File"; 249 /** 250 * An IRI that identifies the file resource. This may be a relative 251 * reference, in which case it must be resolved using the base IRI of the 252 * document. The location may refer to a local or remote resource; the 253 * implementation must use the IRI to retrieve file content. If an 254 * implementation is unable to retrieve the file content stored at a 255 * remote resource (due to unsupported protocol, access denied, or other 256 * issue) it must signal an error. 257 * If the `location` field is not provided, the `contents` field must be 258 * provided. The implementation must assign a unique identifier for 259 * the `location` field. 260 * If the `path` field is provided but the `location` field is not, an 261 * implementation may assign the value of the `path` field to `location`, 262 * then follow the rules above. 263 */ 264 @link Either!(None, string) location_; 265 /** 266 * The local host path where the File is available when a CommandLineTool is 267 * executed. This field must be set by the implementation. The final 268 * path component must match the value of `basename`. This field 269 * must not be used in any other context. The command line tool being 270 * executed must be able to to access the file at `path` using the POSIX 271 * `open(2)` syscall. 272 * As a special case, if the `path` field is provided but the `location` 273 * field is not, an implementation may assign the value of the `path` 274 * field to `location`, and remove the `path` field. 275 * If the `path` contains [POSIX shell metacharacters](http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_02) 276 * (`|`,`&`, `;`, `<`, `>`, `(`,`)`, `$`,`` ` ``, `\`, `"`, `'`, 277 * `<space>`, `<tab>`, and `<newline>`) or characters 278 * [not allowed](http://www.iana.org/assignments/idna-tables-6.3.0/idna-tables-6.3.0.xhtml) 279 * for [Internationalized Domain Names for Applications](https://tools.ietf.org/html/rfc6452) 280 * then implementations may terminate the process with a 281 * `permanentFailure`. 282 */ 283 @link Either!(None, string) path_; 284 /** 285 * The base name of the file, that is, the name of the file without any 286 * leading directory path. The base name must not contain a slash `/`. 287 * If not provided, the implementation must set this field based on the 288 * `location` field by taking the final path component after parsing 289 * `location` as an IRI. If `basename` is provided, it is not required to 290 * match the value from `location`. 291 * When this file is made available to a CommandLineTool, it must be named 292 * with `basename`, i.e. the final component of the `path` field must match 293 * `basename`. 294 */ 295 Either!(None, string) basename_; 296 /** 297 * The name of the directory containing file, that is, the path leading up 298 * to the final slash in the path such that `dirname + '/' + basename == 299 * path`. 300 * The implementation must set this field based on the value of `path` 301 * prior to evaluating parameter references or expressions in a 302 * CommandLineTool document. This field must not be used in any other 303 * context. 304 */ 305 Either!(None, string) dirname_; 306 /** 307 * The basename root such that `nameroot + nameext == basename`, and 308 * `nameext` is empty or begins with a period and contains at most one 309 * period. For the purposess of path splitting leading periods on the 310 * basename are ignored; a basename of `.cshrc` will have a nameroot of 311 * `.cshrc`. 312 * The implementation must set this field automatically based on the value 313 * of `basename` prior to evaluating parameter references or expressions. 314 */ 315 Either!(None, string) nameroot_; 316 /** 317 * The basename extension such that `nameroot + nameext == basename`, and 318 * `nameext` is empty or begins with a period and contains at most one 319 * period. Leading periods on the basename are ignored; a basename of 320 * `.cshrc` will have an empty `nameext`. 321 * The implementation must set this field automatically based on the value 322 * of `basename` prior to evaluating parameter references or expressions. 323 */ 324 Either!(None, string) nameext_; 325 /** 326 * Optional hash code for validating file integrity. Currently must be in the form 327 * "sha1$ + hexadecimal string" using the SHA-1 algorithm. 328 */ 329 Either!(None, string) checksum_; 330 /** 331 * Optional file size 332 */ 333 Either!(None, long) size_; 334 /** 335 * A list of additional files or directories that are associated with the 336 * primary file and must be transferred alongside the primary file. 337 * Examples include indexes of the primary file, or external references 338 * which must be included when loading primary document. A file object 339 * listed in `secondaryFiles` may itself include `secondaryFiles` for 340 * which the same rules apply. 341 */ 342 @secondaryFilesDSL Either!(None, Either!(File, Directory)[]) secondaryFiles_; 343 /** 344 * The format of the file: this must be an IRI of a concept node that 345 * represents the file format, preferrably defined within an ontology. 346 * If no ontology is available, file formats may be tested by exact match. 347 * Reasoning about format compatability must be done by checking that an 348 * input file format is the same, `owl:equivalentClass` or 349 * `rdfs:subClassOf` the format required by the input parameter. 350 * `owl:equivalentClass` is transitive with `rdfs:subClassOf`, e.g. if 351 * `<B> owl:equivalentClass <C>` and `<B> owl:subclassOf <A>` then infer 352 * `<C> owl:subclassOf <A>`. 353 * File format ontologies may be provided in the "$schemas" metadata at the 354 * root of the document. If no ontologies are specified in `$schemas`, the 355 * runtime may perform exact file format matches. 356 */ 357 @link Either!(None, string) format_; 358 /** 359 * File contents literal. Maximum of 64 KiB. 360 * If neither `location` nor `path` is provided, `contents` must be 361 * non-null. The implementation must assign a unique identifier for the 362 * `location` field. When the file is staged as input to CommandLineTool, 363 * the value of `contents` must be written to a file. 364 * If `loadContents` of `inputBinding` or `outputBinding` is true and 365 * `location` is valid, the implementation must read up to the first 64 366 * KiB of text from the file and place it in the "contents" field. 367 */ 368 Either!(None, string) contents_; 369 370 mixin genCtor; 371 mixin genIdentifier; 372 mixin genDumper; 373 } 374 375 /** 376 * Represents a directory to present to a command line tool. 377 * Directories are represented as objects with `class` of `Directory`. Directory objects have 378 * a number of properties that provide metadata about the directory. 379 * The `location` property of a Directory is a URI that uniquely identifies 380 * the directory. Implementations must support the file:// URI scheme and may 381 * support other schemes such as http://. Alternately to `location`, 382 * implementations must also accept the `path` property on Directory, which 383 * must be a filesystem path available on the same host as the CWL runner (for 384 * inputs) or the runtime environment of a command line tool execution (for 385 * command line tool outputs). 386 * A Directory object may have a `listing` field. This is a list of File and 387 * Directory objects that are contained in the Directory. For each entry in 388 * `listing`, the `basename` property defines the name of the File or 389 * Subdirectory when staged to disk. If `listing` is not provided, the 390 * implementation must have some way of fetching the Directory listing at 391 * runtime based on the `location` field. 392 * If a Directory does not have `location`, it is a Directory literal. A 393 * Directory literal must provide `listing`. Directory literals must be 394 * created on disk at runtime as needed. 395 * The resources in a Directory literal do not need to have any implied 396 * relationship in their `location`. For example, a Directory listing may 397 * contain two files located on different hosts. It is the responsibility of 398 * the runtime to ensure that those files are staged to disk appropriately. 399 * Secondary files associated with files in `listing` must also be staged to 400 * the same Directory. 401 * When executing a CommandLineTool, Directories must be recursively staged 402 * first and have local values of `path` assigend. 403 * Directory objects in CommandLineTool output must provide either a 404 * `location` URI or a `path` property in the context of the tool execution 405 * runtime (local to the compute node, or within the executing container). 406 * An ExpressionTool may forward file references from input to output by using 407 * the same value for `location`. 408 * Name conflicts (the same `basename` appearing multiple times in `listing` 409 * or in any entry in `secondaryFiles` in the listing) is a fatal error. 410 */ 411 class Directory : SchemaBase 412 { 413 /** 414 * Must be `Directory` to indicate this object describes a Directory. 415 */ 416 static immutable class_ = "Directory"; 417 /** 418 * An IRI that identifies the directory resource. This may be a relative 419 * reference, in which case it must be resolved using the base IRI of the 420 * document. The location may refer to a local or remote resource. If 421 * the `listing` field is not set, the implementation must use the 422 * location IRI to retrieve directory listing. If an implementation is 423 * unable to retrieve the directory listing stored at a remote resource (due to 424 * unsupported protocol, access denied, or other issue) it must signal an 425 * error. 426 * If the `location` field is not provided, the `listing` field must be 427 * provided. The implementation must assign a unique identifier for 428 * the `location` field. 429 * If the `path` field is provided but the `location` field is not, an 430 * implementation may assign the value of the `path` field to `location`, 431 * then follow the rules above. 432 */ 433 @link Either!(None, string) location_; 434 /** 435 * The local path where the Directory is made available prior to executing a 436 * CommandLineTool. This must be set by the implementation. This field 437 * must not be used in any other context. The command line tool being 438 * executed must be able to to access the directory at `path` using the POSIX 439 * `opendir(2)` syscall. 440 * If the `path` contains [POSIX shell metacharacters](http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_02) 441 * (`|`,`&`, `;`, `<`, `>`, `(`,`)`, `$`,`` ` ``, `\`, `"`, `'`, 442 * `<space>`, `<tab>`, and `<newline>`) or characters 443 * [not allowed](http://www.iana.org/assignments/idna-tables-6.3.0/idna-tables-6.3.0.xhtml) 444 * for [Internationalized Domain Names for Applications](https://tools.ietf.org/html/rfc6452) 445 * then implementations may terminate the process with a 446 * `permanentFailure`. 447 */ 448 @link Either!(None, string) path_; 449 /** 450 * The base name of the directory, that is, the name of the file without any 451 * leading directory path. The base name must not contain a slash `/`. 452 * If not provided, the implementation must set this field based on the 453 * `location` field by taking the final path component after parsing 454 * `location` as an IRI. If `basename` is provided, it is not required to 455 * match the value from `location`. 456 * When this file is made available to a CommandLineTool, it must be named 457 * with `basename`, i.e. the final component of the `path` field must match 458 * `basename`. 459 */ 460 Either!(None, string) basename_; 461 /** 462 * List of files or subdirectories contained in this directory. The name 463 * of each file or subdirectory is determined by the `basename` field of 464 * each `File` or `Directory` object. It is an error if a `File` shares a 465 * `basename` with any other entry in `listing`. If two or more 466 * `Directory` object share the same `basename`, this must be treated as 467 * equivalent to a single subdirectory with the listings recursively 468 * merged. 469 */ 470 Either!(None, Either!(File, Directory)[]) listing_; 471 472 mixin genCtor; 473 mixin genIdentifier; 474 mixin genDumper; 475 } 476 477 /** 478 * Specify the desired behavior for loading the `listing` field of 479 * a Directory object for use by expressions. 480 * no_listing: Do not load the directory listing. 481 * shallow_listing: Only load the top level listing, do not recurse into subdirectories. 482 * deep_listing: Load the directory listing and recursively load all subdirectories as well. 483 */ 484 class LoadListingEnum : SchemaBase 485 { 486 enum Symbol 487 { 488 s0 = "no_listing", 489 s1 = "shallow_listing", 490 s2 = "deep_listing" 491 } 492 493 Symbol value; 494 495 mixin genCtor; 496 mixin genOpEq; 497 mixin genDumper; 498 } 499 500 /// 501 public import salad.primitives : Expression; 502 503 /// 504 class InputBinding : SchemaBase 505 { 506 /** 507 * Use of `loadContents` in `InputBinding` is deprecated. 508 * Preserved for v1.0 backwards compatability. Will be removed in 509 * CWL v2.0. Use `InputParameter.loadContents` instead. 510 * Only valid when `type: File` or is an array of `items: File`. 511 * Read up to the first 64 KiB of text from the file and place it in the 512 * "contents" field of the file object for use by expressions. 513 */ 514 Either!(None, bool) loadContents_; 515 516 mixin genCtor; 517 mixin genIdentifier; 518 mixin genDumper; 519 } 520 521 /// 522 class InputRecordField : SchemaBase 523 { 524 /** 525 * A documentation string for this object, or an array of strings which should be concatenated. 526 */ 527 Either!(None, string, string[]) doc_; 528 /** 529 * The name of the field 530 */ 531 @id string name_; 532 /** 533 * The field type 534 */ 535 @typeDSL Either!(CWLType, InputRecordSchema, InputEnumSchema, InputArraySchema, string, Either!(CWLType, InputRecordSchema, InputEnumSchema, InputArraySchema, string)[]) type_; 536 /** 537 * A short, human-readable label of this object. 538 */ 539 Either!(None, string) label_; 540 /** 541 * Only valid when `type: File` or is an array of `items: File`. 542 * Provides a pattern or expression specifying files or 543 * directories that should be included alongside the primary 544 * file. Secondary files may be required or optional. When not 545 * explicitly specified, secondary files specified for `inputs` 546 * are required and `outputs` are optional. An implementation 547 * must include matching Files and Directories in the 548 * `secondaryFiles` property of the primary file. These Files 549 * and Directories must be transferred and staged alongside the 550 * primary file. An implementation may fail workflow execution 551 * if a required secondary file does not exist. 552 * If the value is an expression, the value of `self` in the expression 553 * must be the primary input or output File object to which this binding 554 * applies. The `basename`, `nameroot` and `nameext` fields must be 555 * present in `self`. For `CommandLineTool` outputs the `path` field must 556 * also be present. The expression must return a filename string relative 557 * to the path to the primary File, a File or Directory object with either 558 * `path` or `location` and `basename` fields set, or an array consisting 559 * of strings or File or Directory objects. It is legal to reference an 560 * unchanged File or Directory object taken from input as a secondaryFile. 561 * The expression may return "null" in which case there is no secondaryFile 562 * from that expression. 563 * To work on non-filename-preserving storage systems, portable tool 564 * descriptions should avoid constructing new values from `location`, but 565 * should construct relative references using `basename` or `nameroot` 566 * instead. 567 * If a value in `secondaryFiles` is a string that is not an expression, 568 * it specifies that the following pattern should be applied to the path 569 * of the primary file to yield a filename relative to the primary File: 570 * 1. If string ends with `?` character, remove the last `?` and mark 571 * the resulting secondary file as optional. 572 * 2. If string begins with one or more caret `^` characters, for each 573 * caret, remove the last file extension from the path (the last 574 * period `.` and all following characters). If there are no file 575 * extensions, the path is unchanged. 576 * 3. Append the remainder of the string to the end of the file path. 577 */ 578 @secondaryFilesDSL Either!(None, SecondaryFileSchema, SecondaryFileSchema[]) secondaryFiles_; 579 /** 580 * Only valid when `type: File` or is an array of `items: File`. 581 * A value of `true` indicates that the file is read or written 582 * sequentially without seeking. An implementation may use this flag to 583 * indicate whether it is valid to stream file contents using a named 584 * pipe. Default: `false`. 585 */ 586 Either!(None, bool) streamable_; 587 /** 588 * Only valid when `type: File` or is an array of `items: File`. 589 * This must be one or more IRIs of concept nodes 590 * that represents file formats which are allowed as input to this 591 * parameter, preferrably defined within an ontology. If no ontology is 592 * available, file formats may be tested by exact match. 593 */ 594 @link Either!(None, string, string[], Expression) format_; 595 /** 596 * Only valid when `type: File` or is an array of `items: File`. 597 * Read up to the first 64 KiB of text from the file and place it in the 598 * "contents" field of the file object for use by expressions. 599 */ 600 Either!(None, bool) loadContents_; 601 /** 602 * Only valid when `type: Directory` or is an array of `items: Directory`. 603 * Specify the desired behavior for loading the `listing` field of 604 * a Directory object for use by expressions. 605 * The order of precedence for loadListing is: 606 * 1. `loadListing` on an individual parameter 607 * 2. Inherited from `LoadListingRequirement` 608 * 3. By default: `no_listing` 609 */ 610 Either!(None, LoadListingEnum) loadListing_; 611 612 mixin genCtor; 613 mixin genIdentifier; 614 mixin genDumper; 615 } 616 617 /// 618 class InputRecordSchema : SchemaBase 619 { 620 /** 621 * Defines the fields of the record. 622 */ 623 @idMap("name", "type") Either!(None, InputRecordField[]) fields_; 624 /** 625 * Must be `record` 626 */ 627 static immutable type_ = "record"; 628 /** 629 * A short, human-readable label of this object. 630 */ 631 Either!(None, string) label_; 632 /** 633 * A documentation string for this object, or an array of strings which should be concatenated. 634 */ 635 Either!(None, string, string[]) doc_; 636 /** 637 * The identifier for this type 638 */ 639 @id Either!(None, string) name_; 640 641 mixin genCtor; 642 mixin genIdentifier; 643 mixin genDumper; 644 } 645 646 /// 647 class InputEnumSchema : SchemaBase 648 { 649 /** 650 * Defines the set of valid symbols. 651 */ 652 @link string[] symbols_; 653 /** 654 * Must be `enum` 655 */ 656 static immutable type_ = "enum"; 657 /** 658 * A short, human-readable label of this object. 659 */ 660 Either!(None, string) label_; 661 /** 662 * A documentation string for this object, or an array of strings which should be concatenated. 663 */ 664 Either!(None, string, string[]) doc_; 665 /** 666 * The identifier for this type 667 */ 668 @id Either!(None, string) name_; 669 670 mixin genCtor; 671 mixin genIdentifier; 672 mixin genDumper; 673 } 674 675 /// 676 class InputArraySchema : SchemaBase 677 { 678 /** 679 * Defines the type of the array elements. 680 */ 681 Either!(CWLType, InputRecordSchema, InputEnumSchema, InputArraySchema, string, Either!(CWLType, InputRecordSchema, InputEnumSchema, InputArraySchema, string)[]) items_; 682 /** 683 * Must be `array` 684 */ 685 static immutable type_ = "array"; 686 /** 687 * A short, human-readable label of this object. 688 */ 689 Either!(None, string) label_; 690 /** 691 * A documentation string for this object, or an array of strings which should be concatenated. 692 */ 693 Either!(None, string, string[]) doc_; 694 /** 695 * The identifier for this type 696 */ 697 @id Either!(None, string) name_; 698 699 mixin genCtor; 700 mixin genIdentifier; 701 mixin genDumper; 702 } 703 704 /// 705 class OutputRecordField : SchemaBase 706 { 707 /** 708 * A documentation string for this object, or an array of strings which should be concatenated. 709 */ 710 Either!(None, string, string[]) doc_; 711 /** 712 * The name of the field 713 */ 714 @id string name_; 715 /** 716 * The field type 717 */ 718 @typeDSL Either!(CWLType, OutputRecordSchema, OutputEnumSchema, OutputArraySchema, string, Either!(CWLType, OutputRecordSchema, OutputEnumSchema, OutputArraySchema, string)[]) type_; 719 /** 720 * A short, human-readable label of this object. 721 */ 722 Either!(None, string) label_; 723 /** 724 * Only valid when `type: File` or is an array of `items: File`. 725 * Provides a pattern or expression specifying files or 726 * directories that should be included alongside the primary 727 * file. Secondary files may be required or optional. When not 728 * explicitly specified, secondary files specified for `inputs` 729 * are required and `outputs` are optional. An implementation 730 * must include matching Files and Directories in the 731 * `secondaryFiles` property of the primary file. These Files 732 * and Directories must be transferred and staged alongside the 733 * primary file. An implementation may fail workflow execution 734 * if a required secondary file does not exist. 735 * If the value is an expression, the value of `self` in the expression 736 * must be the primary input or output File object to which this binding 737 * applies. The `basename`, `nameroot` and `nameext` fields must be 738 * present in `self`. For `CommandLineTool` outputs the `path` field must 739 * also be present. The expression must return a filename string relative 740 * to the path to the primary File, a File or Directory object with either 741 * `path` or `location` and `basename` fields set, or an array consisting 742 * of strings or File or Directory objects. It is legal to reference an 743 * unchanged File or Directory object taken from input as a secondaryFile. 744 * The expression may return "null" in which case there is no secondaryFile 745 * from that expression. 746 * To work on non-filename-preserving storage systems, portable tool 747 * descriptions should avoid constructing new values from `location`, but 748 * should construct relative references using `basename` or `nameroot` 749 * instead. 750 * If a value in `secondaryFiles` is a string that is not an expression, 751 * it specifies that the following pattern should be applied to the path 752 * of the primary file to yield a filename relative to the primary File: 753 * 1. If string ends with `?` character, remove the last `?` and mark 754 * the resulting secondary file as optional. 755 * 2. If string begins with one or more caret `^` characters, for each 756 * caret, remove the last file extension from the path (the last 757 * period `.` and all following characters). If there are no file 758 * extensions, the path is unchanged. 759 * 3. Append the remainder of the string to the end of the file path. 760 */ 761 @secondaryFilesDSL Either!(None, SecondaryFileSchema, SecondaryFileSchema[]) secondaryFiles_; 762 /** 763 * Only valid when `type: File` or is an array of `items: File`. 764 * A value of `true` indicates that the file is read or written 765 * sequentially without seeking. An implementation may use this flag to 766 * indicate whether it is valid to stream file contents using a named 767 * pipe. Default: `false`. 768 */ 769 Either!(None, bool) streamable_; 770 /** 771 * Only valid when `type: File` or is an array of `items: File`. 772 * This is the file format that will be assigned to the output 773 * File object. 774 */ 775 @link Either!(None, string, Expression) format_; 776 777 mixin genCtor; 778 mixin genIdentifier; 779 mixin genDumper; 780 } 781 782 /// 783 class OutputRecordSchema : SchemaBase 784 { 785 /** 786 * Defines the fields of the record. 787 */ 788 @idMap("name", "type") Either!(None, OutputRecordField[]) fields_; 789 /** 790 * Must be `record` 791 */ 792 static immutable type_ = "record"; 793 /** 794 * A short, human-readable label of this object. 795 */ 796 Either!(None, string) label_; 797 /** 798 * A documentation string for this object, or an array of strings which should be concatenated. 799 */ 800 Either!(None, string, string[]) doc_; 801 /** 802 * The identifier for this type 803 */ 804 @id Either!(None, string) name_; 805 806 mixin genCtor; 807 mixin genIdentifier; 808 mixin genDumper; 809 } 810 811 /// 812 class OutputEnumSchema : SchemaBase 813 { 814 /** 815 * Defines the set of valid symbols. 816 */ 817 @link string[] symbols_; 818 /** 819 * Must be `enum` 820 */ 821 static immutable type_ = "enum"; 822 /** 823 * A short, human-readable label of this object. 824 */ 825 Either!(None, string) label_; 826 /** 827 * A documentation string for this object, or an array of strings which should be concatenated. 828 */ 829 Either!(None, string, string[]) doc_; 830 /** 831 * The identifier for this type 832 */ 833 @id Either!(None, string) name_; 834 835 mixin genCtor; 836 mixin genIdentifier; 837 mixin genDumper; 838 } 839 840 /// 841 class OutputArraySchema : SchemaBase 842 { 843 /** 844 * Defines the type of the array elements. 845 */ 846 Either!(CWLType, OutputRecordSchema, OutputEnumSchema, OutputArraySchema, string, Either!(CWLType, OutputRecordSchema, OutputEnumSchema, OutputArraySchema, string)[]) items_; 847 /** 848 * Must be `array` 849 */ 850 static immutable type_ = "array"; 851 /** 852 * A short, human-readable label of this object. 853 */ 854 Either!(None, string) label_; 855 /** 856 * A documentation string for this object, or an array of strings which should be concatenated. 857 */ 858 Either!(None, string, string[]) doc_; 859 /** 860 * The identifier for this type 861 */ 862 @id Either!(None, string) name_; 863 864 mixin genCtor; 865 mixin genIdentifier; 866 mixin genDumper; 867 } 868 869 /** 870 * Indicates that the workflow platform must support inline Javascript expressions. 871 * If this requirement is not present, the workflow platform must not perform expression 872 * interpolatation. 873 */ 874 class InlineJavascriptRequirement : SchemaBase 875 { 876 /** 877 * Always 'InlineJavascriptRequirement' 878 */ 879 static immutable class_ = "InlineJavascriptRequirement"; 880 /** 881 * Additional code fragments that will also be inserted 882 * before executing the expression code. Allows for function definitions that may 883 * be called from CWL expressions. 884 */ 885 Either!(None, string[]) expressionLib_; 886 887 mixin genCtor; 888 mixin genIdentifier; 889 mixin genDumper; 890 } 891 892 /** 893 * This field consists of an array of type definitions which must be used when 894 * interpreting the `inputs` and `outputs` fields. When a `type` field 895 * contain a IRI, the implementation must check if the type is defined in 896 * `schemaDefs` and use that definition. If the type is not found in 897 * `schemaDefs`, it is an error. The entries in `schemaDefs` must be 898 * processed in the order listed such that later schema definitions may refer 899 * to earlier schema definitions. 900 */ 901 class SchemaDefRequirement : SchemaBase 902 { 903 /** 904 * Always 'SchemaDefRequirement' 905 */ 906 static immutable class_ = "SchemaDefRequirement"; 907 /** 908 * The list of type definitions. 909 */ 910 Either!(CommandInputRecordSchema, CommandInputEnumSchema, CommandInputArraySchema)[] types_; 911 912 mixin genCtor; 913 mixin genIdentifier; 914 mixin genDumper; 915 } 916 917 /// 918 class SecondaryFileSchema : SchemaBase 919 { 920 /** 921 * Provides a pattern or expression specifying files or directories that 922 * should be included alongside the primary file. 923 * If the value is an expression, the value of `self` in the expression 924 * must be the primary input or output File object to which this binding 925 * applies. The `basename`, `nameroot` and `nameext` fields must be 926 * present in `self`. For `CommandLineTool` outputs the `path` field must 927 * also be present. The expression must return a filename string relative 928 * to the path to the primary File, a File or Directory object with either 929 * `path` or `location` and `basename` fields set, or an array consisting 930 * of strings or File or Directory objects. It is legal to reference an 931 * unchanged File or Directory object taken from input as a secondaryFile. 932 * The expression may return "null" in which case there is no secondaryFile 933 * from that expression. 934 * To work on non-filename-preserving storage systems, portable tool 935 * descriptions should avoid constructing new values from `location`, but 936 * should construct relative references using `basename` or `nameroot` 937 * instead. 938 * If a value in `secondaryFiles` is a string that is not an expression, 939 * it specifies that the following pattern should be applied to the path 940 * of the primary file to yield a filename relative to the primary File: 941 * 1. If string ends with `?` character, remove the last `?` and mark 942 * the resulting secondary file as optional. 943 * 2. If string begins with one or more caret `^` characters, for each 944 * caret, remove the last file extension from the path (the last 945 * period `.` and all following characters). If there are no file 946 * extensions, the path is unchanged. 947 * 3. Append the remainder of the string to the end of the file path. 948 */ 949 Either!(string, Expression) pattern_; 950 /** 951 * An implementation must not fail workflow execution if `required` is 952 * set to `false` and the expected secondary file does not exist. 953 * Default value for `required` field is `true` for secondary files on 954 * input and `false` for secondary files on output. 955 */ 956 Either!(None, bool, Expression) required_; 957 958 mixin genCtor; 959 mixin genIdentifier; 960 mixin genDumper; 961 } 962 963 /** 964 * Specify the desired behavior for loading the `listing` field of 965 * a Directory object for use by expressions. 966 */ 967 class LoadListingRequirement : SchemaBase 968 { 969 /** 970 * Always 'LoadListingRequirement' 971 */ 972 static immutable class_ = "LoadListingRequirement"; 973 /// 974 Either!(None, LoadListingEnum) loadListing_; 975 976 mixin genCtor; 977 mixin genIdentifier; 978 mixin genDumper; 979 } 980 981 /** 982 * Define an environment variable that will be set in the runtime environment 983 * by the workflow platform when executing the command line tool. May be the 984 * result of executing an expression, such as getting a parameter from input. 985 */ 986 class EnvironmentDef : SchemaBase 987 { 988 /** 989 * The environment variable name 990 */ 991 string envName_; 992 /** 993 * The environment variable value 994 */ 995 Either!(string, Expression) envValue_; 996 997 mixin genCtor; 998 mixin genIdentifier; 999 mixin genDumper; 1000 } 1001 1002 /** 1003 * When listed under `inputBinding` in the input schema, the term 1004 * "value" refers to the the corresponding value in the input object. For 1005 * binding objects listed in `CommandLineTool.arguments`, the term "value" 1006 * refers to the effective value after evaluating `valueFrom`. 1007 * The binding behavior when building the command line depends on the data 1008 * type of the value. If there is a mismatch between the type described by 1009 * the input schema and the effective value, such as resulting from an 1010 * expression evaluation, an implementation must use the data type of the 1011 * effective value. 1012 * - **string**: Add `prefix` and the string to the command line. 1013 * - **number**: Add `prefix` and decimal representation to command line. 1014 * - **boolean**: If true, add `prefix` to the command line. If false, add 1015 * nothing. 1016 * - **File**: Add `prefix` and the value of 1017 * [`File.path`](#File) to the command line. 1018 * - **Directory**: Add `prefix` and the value of 1019 * [`Directory.path`](#Directory) to the command line. 1020 * - **array**: If `itemSeparator` is specified, add `prefix` and the join 1021 * the array into a single string with `itemSeparator` separating the 1022 * items. Otherwise first add `prefix`, then recursively process 1023 * individual elements. 1024 * If the array is empty, it does not add anything to command line. 1025 * - **object**: Add `prefix` only, and recursively add object fields for 1026 * which `inputBinding` is specified. 1027 * - **null**: Add nothing. 1028 */ 1029 class CommandLineBinding : SchemaBase 1030 { 1031 /** 1032 * Use of `loadContents` in `InputBinding` is deprecated. 1033 * Preserved for v1.0 backwards compatability. Will be removed in 1034 * CWL v2.0. Use `InputParameter.loadContents` instead. 1035 * Only valid when `type: File` or is an array of `items: File`. 1036 * Read up to the first 64 KiB of text from the file and place it in the 1037 * "contents" field of the file object for use by expressions. 1038 */ 1039 Either!(None, bool) loadContents_; 1040 /** 1041 * The sorting key. Default position is 0. If the inputBinding is 1042 * associated with an input parameter, then the value of `self` in the 1043 * expression will be the value of the input parameter. Input parameter 1044 * defaults (as specified by the `InputParameter.default` field) must be 1045 * applied before evaluating the expression. Expressions must return a 1046 * single value of type int or a null. 1047 */ 1048 Either!(None, int, Expression) position_; 1049 /** 1050 * Command line prefix to add before the value. 1051 */ 1052 Either!(None, string) prefix_; 1053 /** 1054 * If true (default), then the prefix and value must be added as separate 1055 * command line arguments; if false, prefix and value must be concatenated 1056 * into a single command line argument. 1057 */ 1058 Either!(None, bool) separate_; 1059 /** 1060 * Join the array elements into a single string with the elements 1061 * separated by by `itemSeparator`. 1062 */ 1063 Either!(None, string) itemSeparator_; 1064 /** 1065 * If `valueFrom` is a constant string value, use this as the value and 1066 * apply the binding rules above. 1067 * If `valueFrom` is an expression, evaluate the expression to yield the 1068 * actual value to use to build the command line and apply the binding 1069 * rules above. If the inputBinding is associated with an input 1070 * parameter, the value of `self` in the expression will be the value of 1071 * the input parameter. Input parameter defaults (as specified by the 1072 * `InputParameter.default` field) must be applied before evaluating the 1073 * expression. 1074 * If the value of the associated input parameter is `null`, `valueFrom` is 1075 * not evaluated and nothing is added to the command line. 1076 * When a binding is part of the `CommandLineTool.arguments` field, 1077 * the `valueFrom` field is required. 1078 */ 1079 Either!(None, string, Expression) valueFrom_; 1080 /** 1081 * If `ShellCommandRequirement` is in the requirements for the current command, 1082 * this controls whether the value is quoted on the command line (default is true). 1083 * Use `shellQuote: false` to inject metacharacters for operations such as pipes. 1084 * If `shellQuote` is true or not provided, the implementation must not 1085 * permit interpretation of any shell metacharacters or directives. 1086 */ 1087 Either!(None, bool) shellQuote_; 1088 1089 mixin genCtor; 1090 mixin genIdentifier; 1091 mixin genDumper; 1092 } 1093 1094 /** 1095 * Describes how to generate an output parameter based on the files produced 1096 * by a CommandLineTool. 1097 * The output parameter value is generated by applying these operations in the 1098 * following order: 1099 * - glob 1100 * - loadContents 1101 * - outputEval 1102 * - secondaryFiles 1103 */ 1104 class CommandOutputBinding : SchemaBase 1105 { 1106 /** 1107 * Only valid when `type: File` or is an array of `items: File`. 1108 * Read up to the first 64 KiB of text from the file and place it in the 1109 * "contents" field of the file object for use by expressions. 1110 */ 1111 Either!(None, bool) loadContents_; 1112 /** 1113 * Only valid when `type: Directory` or is an array of `items: Directory`. 1114 * Specify the desired behavior for loading the `listing` field of 1115 * a Directory object for use by expressions. 1116 * The order of precedence for loadListing is: 1117 * 1. `loadListing` on an individual parameter 1118 * 2. Inherited from `LoadListingRequirement` 1119 * 3. By default: `no_listing` 1120 */ 1121 Either!(None, LoadListingEnum) loadListing_; 1122 /** 1123 * Find files or directories relative to the output directory, using POSIX 1124 * glob(3) pathname matching. If an array is provided, find files or 1125 * directories that match any pattern in the array. If an expression is 1126 * provided, the expression must return a string or an array of strings, 1127 * which will then be evaluated as one or more glob patterns. Must only 1128 * match and return files/directories which actually exist. 1129 * If the value of glob is a relative path pattern (does not 1130 * begin with a slash '/') then it is resolved relative to the 1131 * output directory. If the value of the glob is an absolute 1132 * path pattern (it does begin with a slash '/') then it must 1133 * refer to a path within the output directory. It is an error 1134 * if any glob resolves to a path outside the output directory. 1135 * Specifically this means globs that resolve to paths outside the output 1136 * directory are illegal. 1137 * A glob may match a path within the output directory which is 1138 * actually a symlink to another file. In this case, the 1139 * expected behavior is for the resulting File/Directory object to take the 1140 * `basename` (and corresponding `nameroot` and `nameext`) of the 1141 * symlink. The `location` of the File/Directory is implementation 1142 * dependent, but logically the File/Directory should have the same content 1143 * as the symlink target. Platforms may stage output files/directories to 1144 * cloud storage that lack the concept of a symlink. In 1145 * this case file content and directories may be duplicated, or (to avoid 1146 * duplication) the File/Directory `location` may refer to the symlink 1147 * target. 1148 * It is an error if a symlink in the output directory (or any 1149 * symlink in a chain of links) refers to any file or directory 1150 * that is not under an input or output directory. 1151 * Implementations may shut down a container before globbing 1152 * output, so globs and expressions must not assume access to the 1153 * container filesystem except for declared input and output. 1154 */ 1155 Either!(None, string, Expression, string[]) glob_; 1156 /** 1157 * Evaluate an expression to generate the output value. If 1158 * `glob` was specified, the value of `self` must be an array 1159 * containing file objects that were matched. If no files were 1160 * matched, `self` must be a zero length array; if a single file 1161 * was matched, the value of `self` is an array of a single 1162 * element. Additionally, if `loadContents` is `true`, the File 1163 * objects must include up to the first 64 KiB of file contents 1164 * in the `contents` field. The exit code of the process is 1165 * available in the expression as `runtime.exitCode`. 1166 */ 1167 Either!(None, Expression) outputEval_; 1168 1169 mixin genCtor; 1170 mixin genIdentifier; 1171 mixin genDumper; 1172 } 1173 1174 /// 1175 class CommandLineBindable : SchemaBase 1176 { 1177 /** 1178 * Describes how to turn this object into command line arguments. 1179 */ 1180 Either!(None, CommandLineBinding) inputBinding_; 1181 1182 mixin genCtor; 1183 mixin genIdentifier; 1184 mixin genDumper; 1185 } 1186 1187 /// 1188 class CommandInputRecordField : SchemaBase 1189 { 1190 /** 1191 * A documentation string for this object, or an array of strings which should be concatenated. 1192 */ 1193 Either!(None, string, string[]) doc_; 1194 /** 1195 * The name of the field 1196 */ 1197 @id string name_; 1198 /** 1199 * The field type 1200 */ 1201 @typeDSL Either!(CWLType, CommandInputRecordSchema, CommandInputEnumSchema, CommandInputArraySchema, string, Either!(CWLType, CommandInputRecordSchema, CommandInputEnumSchema, CommandInputArraySchema, string)[]) type_; 1202 /** 1203 * A short, human-readable label of this object. 1204 */ 1205 Either!(None, string) label_; 1206 /** 1207 * Only valid when `type: File` or is an array of `items: File`. 1208 * Provides a pattern or expression specifying files or 1209 * directories that should be included alongside the primary 1210 * file. Secondary files may be required or optional. When not 1211 * explicitly specified, secondary files specified for `inputs` 1212 * are required and `outputs` are optional. An implementation 1213 * must include matching Files and Directories in the 1214 * `secondaryFiles` property of the primary file. These Files 1215 * and Directories must be transferred and staged alongside the 1216 * primary file. An implementation may fail workflow execution 1217 * if a required secondary file does not exist. 1218 * If the value is an expression, the value of `self` in the expression 1219 * must be the primary input or output File object to which this binding 1220 * applies. The `basename`, `nameroot` and `nameext` fields must be 1221 * present in `self`. For `CommandLineTool` outputs the `path` field must 1222 * also be present. The expression must return a filename string relative 1223 * to the path to the primary File, a File or Directory object with either 1224 * `path` or `location` and `basename` fields set, or an array consisting 1225 * of strings or File or Directory objects. It is legal to reference an 1226 * unchanged File or Directory object taken from input as a secondaryFile. 1227 * The expression may return "null" in which case there is no secondaryFile 1228 * from that expression. 1229 * To work on non-filename-preserving storage systems, portable tool 1230 * descriptions should avoid constructing new values from `location`, but 1231 * should construct relative references using `basename` or `nameroot` 1232 * instead. 1233 * If a value in `secondaryFiles` is a string that is not an expression, 1234 * it specifies that the following pattern should be applied to the path 1235 * of the primary file to yield a filename relative to the primary File: 1236 * 1. If string ends with `?` character, remove the last `?` and mark 1237 * the resulting secondary file as optional. 1238 * 2. If string begins with one or more caret `^` characters, for each 1239 * caret, remove the last file extension from the path (the last 1240 * period `.` and all following characters). If there are no file 1241 * extensions, the path is unchanged. 1242 * 3. Append the remainder of the string to the end of the file path. 1243 */ 1244 @secondaryFilesDSL Either!(None, SecondaryFileSchema, SecondaryFileSchema[]) secondaryFiles_; 1245 /** 1246 * Only valid when `type: File` or is an array of `items: File`. 1247 * A value of `true` indicates that the file is read or written 1248 * sequentially without seeking. An implementation may use this flag to 1249 * indicate whether it is valid to stream file contents using a named 1250 * pipe. Default: `false`. 1251 */ 1252 Either!(None, bool) streamable_; 1253 /** 1254 * Only valid when `type: File` or is an array of `items: File`. 1255 * This must be one or more IRIs of concept nodes 1256 * that represents file formats which are allowed as input to this 1257 * parameter, preferrably defined within an ontology. If no ontology is 1258 * available, file formats may be tested by exact match. 1259 */ 1260 @link Either!(None, string, string[], Expression) format_; 1261 /** 1262 * Only valid when `type: File` or is an array of `items: File`. 1263 * Read up to the first 64 KiB of text from the file and place it in the 1264 * "contents" field of the file object for use by expressions. 1265 */ 1266 Either!(None, bool) loadContents_; 1267 /** 1268 * Only valid when `type: Directory` or is an array of `items: Directory`. 1269 * Specify the desired behavior for loading the `listing` field of 1270 * a Directory object for use by expressions. 1271 * The order of precedence for loadListing is: 1272 * 1. `loadListing` on an individual parameter 1273 * 2. Inherited from `LoadListingRequirement` 1274 * 3. By default: `no_listing` 1275 */ 1276 Either!(None, LoadListingEnum) loadListing_; 1277 /** 1278 * Describes how to turn this object into command line arguments. 1279 */ 1280 Either!(None, CommandLineBinding) inputBinding_; 1281 1282 mixin genCtor; 1283 mixin genIdentifier; 1284 mixin genDumper; 1285 } 1286 1287 /// 1288 class CommandInputRecordSchema : SchemaBase 1289 { 1290 /** 1291 * Defines the fields of the record. 1292 */ 1293 @idMap("name", "type") Either!(None, CommandInputRecordField[]) fields_; 1294 /** 1295 * Must be `record` 1296 */ 1297 static immutable type_ = "record"; 1298 /** 1299 * A short, human-readable label of this object. 1300 */ 1301 Either!(None, string) label_; 1302 /** 1303 * A documentation string for this object, or an array of strings which should be concatenated. 1304 */ 1305 Either!(None, string, string[]) doc_; 1306 /** 1307 * The identifier for this type 1308 */ 1309 @id Either!(None, string) name_; 1310 /** 1311 * Describes how to turn this object into command line arguments. 1312 */ 1313 Either!(None, CommandLineBinding) inputBinding_; 1314 1315 mixin genCtor; 1316 mixin genIdentifier; 1317 mixin genDumper; 1318 } 1319 1320 /// 1321 class CommandInputEnumSchema : SchemaBase 1322 { 1323 /** 1324 * Defines the set of valid symbols. 1325 */ 1326 @link string[] symbols_; 1327 /** 1328 * Must be `enum` 1329 */ 1330 static immutable type_ = "enum"; 1331 /** 1332 * A short, human-readable label of this object. 1333 */ 1334 Either!(None, string) label_; 1335 /** 1336 * A documentation string for this object, or an array of strings which should be concatenated. 1337 */ 1338 Either!(None, string, string[]) doc_; 1339 /** 1340 * The identifier for this type 1341 */ 1342 @id Either!(None, string) name_; 1343 /** 1344 * Describes how to turn this object into command line arguments. 1345 */ 1346 Either!(None, CommandLineBinding) inputBinding_; 1347 1348 mixin genCtor; 1349 mixin genIdentifier; 1350 mixin genDumper; 1351 } 1352 1353 /// 1354 class CommandInputArraySchema : SchemaBase 1355 { 1356 /** 1357 * Defines the type of the array elements. 1358 */ 1359 Either!(CWLType, CommandInputRecordSchema, CommandInputEnumSchema, CommandInputArraySchema, string, Either!(CWLType, CommandInputRecordSchema, CommandInputEnumSchema, CommandInputArraySchema, string)[]) items_; 1360 /** 1361 * Must be `array` 1362 */ 1363 static immutable type_ = "array"; 1364 /** 1365 * A short, human-readable label of this object. 1366 */ 1367 Either!(None, string) label_; 1368 /** 1369 * A documentation string for this object, or an array of strings which should be concatenated. 1370 */ 1371 Either!(None, string, string[]) doc_; 1372 /** 1373 * The identifier for this type 1374 */ 1375 @id Either!(None, string) name_; 1376 /** 1377 * Describes how to turn this object into command line arguments. 1378 */ 1379 Either!(None, CommandLineBinding) inputBinding_; 1380 1381 mixin genCtor; 1382 mixin genIdentifier; 1383 mixin genDumper; 1384 } 1385 1386 /// 1387 class CommandOutputRecordField : SchemaBase 1388 { 1389 /** 1390 * A documentation string for this object, or an array of strings which should be concatenated. 1391 */ 1392 Either!(None, string, string[]) doc_; 1393 /** 1394 * The name of the field 1395 */ 1396 @id string name_; 1397 /** 1398 * The field type 1399 */ 1400 @typeDSL Either!(CWLType, CommandOutputRecordSchema, CommandOutputEnumSchema, CommandOutputArraySchema, string, Either!(CWLType, CommandOutputRecordSchema, CommandOutputEnumSchema, CommandOutputArraySchema, string)[]) type_; 1401 /** 1402 * A short, human-readable label of this object. 1403 */ 1404 Either!(None, string) label_; 1405 /** 1406 * Only valid when `type: File` or is an array of `items: File`. 1407 * Provides a pattern or expression specifying files or 1408 * directories that should be included alongside the primary 1409 * file. Secondary files may be required or optional. When not 1410 * explicitly specified, secondary files specified for `inputs` 1411 * are required and `outputs` are optional. An implementation 1412 * must include matching Files and Directories in the 1413 * `secondaryFiles` property of the primary file. These Files 1414 * and Directories must be transferred and staged alongside the 1415 * primary file. An implementation may fail workflow execution 1416 * if a required secondary file does not exist. 1417 * If the value is an expression, the value of `self` in the expression 1418 * must be the primary input or output File object to which this binding 1419 * applies. The `basename`, `nameroot` and `nameext` fields must be 1420 * present in `self`. For `CommandLineTool` outputs the `path` field must 1421 * also be present. The expression must return a filename string relative 1422 * to the path to the primary File, a File or Directory object with either 1423 * `path` or `location` and `basename` fields set, or an array consisting 1424 * of strings or File or Directory objects. It is legal to reference an 1425 * unchanged File or Directory object taken from input as a secondaryFile. 1426 * The expression may return "null" in which case there is no secondaryFile 1427 * from that expression. 1428 * To work on non-filename-preserving storage systems, portable tool 1429 * descriptions should avoid constructing new values from `location`, but 1430 * should construct relative references using `basename` or `nameroot` 1431 * instead. 1432 * If a value in `secondaryFiles` is a string that is not an expression, 1433 * it specifies that the following pattern should be applied to the path 1434 * of the primary file to yield a filename relative to the primary File: 1435 * 1. If string ends with `?` character, remove the last `?` and mark 1436 * the resulting secondary file as optional. 1437 * 2. If string begins with one or more caret `^` characters, for each 1438 * caret, remove the last file extension from the path (the last 1439 * period `.` and all following characters). If there are no file 1440 * extensions, the path is unchanged. 1441 * 3. Append the remainder of the string to the end of the file path. 1442 */ 1443 @secondaryFilesDSL Either!(None, SecondaryFileSchema, SecondaryFileSchema[]) secondaryFiles_; 1444 /** 1445 * Only valid when `type: File` or is an array of `items: File`. 1446 * A value of `true` indicates that the file is read or written 1447 * sequentially without seeking. An implementation may use this flag to 1448 * indicate whether it is valid to stream file contents using a named 1449 * pipe. Default: `false`. 1450 */ 1451 Either!(None, bool) streamable_; 1452 /** 1453 * Only valid when `type: File` or is an array of `items: File`. 1454 * This is the file format that will be assigned to the output 1455 * File object. 1456 */ 1457 @link Either!(None, string, Expression) format_; 1458 /** 1459 * Describes how to generate this output object based on the files 1460 * produced by a CommandLineTool 1461 */ 1462 Either!(None, CommandOutputBinding) outputBinding_; 1463 1464 mixin genCtor; 1465 mixin genIdentifier; 1466 mixin genDumper; 1467 } 1468 1469 /// 1470 class CommandOutputRecordSchema : SchemaBase 1471 { 1472 /** 1473 * Defines the fields of the record. 1474 */ 1475 @idMap("name", "type") Either!(None, CommandOutputRecordField[]) fields_; 1476 /** 1477 * Must be `record` 1478 */ 1479 static immutable type_ = "record"; 1480 /** 1481 * A short, human-readable label of this object. 1482 */ 1483 Either!(None, string) label_; 1484 /** 1485 * A documentation string for this object, or an array of strings which should be concatenated. 1486 */ 1487 Either!(None, string, string[]) doc_; 1488 /** 1489 * The identifier for this type 1490 */ 1491 @id Either!(None, string) name_; 1492 1493 mixin genCtor; 1494 mixin genIdentifier; 1495 mixin genDumper; 1496 } 1497 1498 /// 1499 class CommandOutputEnumSchema : SchemaBase 1500 { 1501 /** 1502 * Defines the set of valid symbols. 1503 */ 1504 @link string[] symbols_; 1505 /** 1506 * Must be `enum` 1507 */ 1508 static immutable type_ = "enum"; 1509 /** 1510 * A short, human-readable label of this object. 1511 */ 1512 Either!(None, string) label_; 1513 /** 1514 * A documentation string for this object, or an array of strings which should be concatenated. 1515 */ 1516 Either!(None, string, string[]) doc_; 1517 /** 1518 * The identifier for this type 1519 */ 1520 @id Either!(None, string) name_; 1521 1522 mixin genCtor; 1523 mixin genIdentifier; 1524 mixin genDumper; 1525 } 1526 1527 /// 1528 class CommandOutputArraySchema : SchemaBase 1529 { 1530 /** 1531 * Defines the type of the array elements. 1532 */ 1533 Either!(CWLType, CommandOutputRecordSchema, CommandOutputEnumSchema, CommandOutputArraySchema, string, Either!(CWLType, CommandOutputRecordSchema, CommandOutputEnumSchema, CommandOutputArraySchema, string)[]) items_; 1534 /** 1535 * Must be `array` 1536 */ 1537 static immutable type_ = "array"; 1538 /** 1539 * A short, human-readable label of this object. 1540 */ 1541 Either!(None, string) label_; 1542 /** 1543 * A documentation string for this object, or an array of strings which should be concatenated. 1544 */ 1545 Either!(None, string, string[]) doc_; 1546 /** 1547 * The identifier for this type 1548 */ 1549 @id Either!(None, string) name_; 1550 1551 mixin genCtor; 1552 mixin genIdentifier; 1553 mixin genDumper; 1554 } 1555 1556 /** 1557 * An input parameter for a CommandLineTool. 1558 */ 1559 class CommandInputParameter : SchemaBase 1560 { 1561 /** 1562 * A short, human-readable label of this object. 1563 */ 1564 Either!(None, string) label_; 1565 /** 1566 * Only valid when `type: File` or is an array of `items: File`. 1567 * Provides a pattern or expression specifying files or 1568 * directories that should be included alongside the primary 1569 * file. Secondary files may be required or optional. When not 1570 * explicitly specified, secondary files specified for `inputs` 1571 * are required and `outputs` are optional. An implementation 1572 * must include matching Files and Directories in the 1573 * `secondaryFiles` property of the primary file. These Files 1574 * and Directories must be transferred and staged alongside the 1575 * primary file. An implementation may fail workflow execution 1576 * if a required secondary file does not exist. 1577 * If the value is an expression, the value of `self` in the expression 1578 * must be the primary input or output File object to which this binding 1579 * applies. The `basename`, `nameroot` and `nameext` fields must be 1580 * present in `self`. For `CommandLineTool` outputs the `path` field must 1581 * also be present. The expression must return a filename string relative 1582 * to the path to the primary File, a File or Directory object with either 1583 * `path` or `location` and `basename` fields set, or an array consisting 1584 * of strings or File or Directory objects. It is legal to reference an 1585 * unchanged File or Directory object taken from input as a secondaryFile. 1586 * The expression may return "null" in which case there is no secondaryFile 1587 * from that expression. 1588 * To work on non-filename-preserving storage systems, portable tool 1589 * descriptions should avoid constructing new values from `location`, but 1590 * should construct relative references using `basename` or `nameroot` 1591 * instead. 1592 * If a value in `secondaryFiles` is a string that is not an expression, 1593 * it specifies that the following pattern should be applied to the path 1594 * of the primary file to yield a filename relative to the primary File: 1595 * 1. If string ends with `?` character, remove the last `?` and mark 1596 * the resulting secondary file as optional. 1597 * 2. If string begins with one or more caret `^` characters, for each 1598 * caret, remove the last file extension from the path (the last 1599 * period `.` and all following characters). If there are no file 1600 * extensions, the path is unchanged. 1601 * 3. Append the remainder of the string to the end of the file path. 1602 */ 1603 @secondaryFilesDSL Either!(None, SecondaryFileSchema, SecondaryFileSchema[]) secondaryFiles_; 1604 /** 1605 * Only valid when `type: File` or is an array of `items: File`. 1606 * A value of `true` indicates that the file is read or written 1607 * sequentially without seeking. An implementation may use this flag to 1608 * indicate whether it is valid to stream file contents using a named 1609 * pipe. Default: `false`. 1610 */ 1611 Either!(None, bool) streamable_; 1612 /** 1613 * A documentation string for this object, or an array of strings which should be concatenated. 1614 */ 1615 Either!(None, string, string[]) doc_; 1616 /** 1617 * The unique identifier for this object. 1618 */ 1619 @id Either!(None, string) id_; 1620 /** 1621 * Only valid when `type: File` or is an array of `items: File`. 1622 * This must be one or more IRIs of concept nodes 1623 * that represents file formats which are allowed as input to this 1624 * parameter, preferrably defined within an ontology. If no ontology is 1625 * available, file formats may be tested by exact match. 1626 */ 1627 @link Either!(None, string, string[], Expression) format_; 1628 /** 1629 * Only valid when `type: File` or is an array of `items: File`. 1630 * Read up to the first 64 KiB of text from the file and place it in the 1631 * "contents" field of the file object for use by expressions. 1632 */ 1633 Either!(None, bool) loadContents_; 1634 /** 1635 * Only valid when `type: Directory` or is an array of `items: Directory`. 1636 * Specify the desired behavior for loading the `listing` field of 1637 * a Directory object for use by expressions. 1638 * The order of precedence for loadListing is: 1639 * 1. `loadListing` on an individual parameter 1640 * 2. Inherited from `LoadListingRequirement` 1641 * 3. By default: `no_listing` 1642 */ 1643 Either!(None, LoadListingEnum) loadListing_; 1644 /** 1645 * The default value to use for this parameter if the parameter is missing 1646 * from the input object, or if the value of the parameter in the input 1647 * object is `null`. Default values are applied before evaluating expressions 1648 * (e.g. dependent `valueFrom` fields). 1649 */ 1650 Either!(None, File, Directory, Any) default_; 1651 /** 1652 * Specify valid types of data that may be assigned to this parameter. 1653 */ 1654 @typeDSL Either!(CWLType, stdin, CommandInputRecordSchema, CommandInputEnumSchema, CommandInputArraySchema, string, Either!(CWLType, CommandInputRecordSchema, CommandInputEnumSchema, CommandInputArraySchema, string)[]) type_; 1655 /** 1656 * Describes how to turns the input parameters of a process into 1657 * command line arguments. 1658 */ 1659 Either!(None, CommandLineBinding) inputBinding_; 1660 1661 mixin genCtor; 1662 mixin genIdentifier; 1663 mixin genDumper; 1664 } 1665 1666 /** 1667 * An output parameter for a CommandLineTool. 1668 */ 1669 class CommandOutputParameter : SchemaBase 1670 { 1671 /** 1672 * A short, human-readable label of this object. 1673 */ 1674 Either!(None, string) label_; 1675 /** 1676 * Only valid when `type: File` or is an array of `items: File`. 1677 * Provides a pattern or expression specifying files or 1678 * directories that should be included alongside the primary 1679 * file. Secondary files may be required or optional. When not 1680 * explicitly specified, secondary files specified for `inputs` 1681 * are required and `outputs` are optional. An implementation 1682 * must include matching Files and Directories in the 1683 * `secondaryFiles` property of the primary file. These Files 1684 * and Directories must be transferred and staged alongside the 1685 * primary file. An implementation may fail workflow execution 1686 * if a required secondary file does not exist. 1687 * If the value is an expression, the value of `self` in the expression 1688 * must be the primary input or output File object to which this binding 1689 * applies. The `basename`, `nameroot` and `nameext` fields must be 1690 * present in `self`. For `CommandLineTool` outputs the `path` field must 1691 * also be present. The expression must return a filename string relative 1692 * to the path to the primary File, a File or Directory object with either 1693 * `path` or `location` and `basename` fields set, or an array consisting 1694 * of strings or File or Directory objects. It is legal to reference an 1695 * unchanged File or Directory object taken from input as a secondaryFile. 1696 * The expression may return "null" in which case there is no secondaryFile 1697 * from that expression. 1698 * To work on non-filename-preserving storage systems, portable tool 1699 * descriptions should avoid constructing new values from `location`, but 1700 * should construct relative references using `basename` or `nameroot` 1701 * instead. 1702 * If a value in `secondaryFiles` is a string that is not an expression, 1703 * it specifies that the following pattern should be applied to the path 1704 * of the primary file to yield a filename relative to the primary File: 1705 * 1. If string ends with `?` character, remove the last `?` and mark 1706 * the resulting secondary file as optional. 1707 * 2. If string begins with one or more caret `^` characters, for each 1708 * caret, remove the last file extension from the path (the last 1709 * period `.` and all following characters). If there are no file 1710 * extensions, the path is unchanged. 1711 * 3. Append the remainder of the string to the end of the file path. 1712 */ 1713 @secondaryFilesDSL Either!(None, SecondaryFileSchema, SecondaryFileSchema[]) secondaryFiles_; 1714 /** 1715 * Only valid when `type: File` or is an array of `items: File`. 1716 * A value of `true` indicates that the file is read or written 1717 * sequentially without seeking. An implementation may use this flag to 1718 * indicate whether it is valid to stream file contents using a named 1719 * pipe. Default: `false`. 1720 */ 1721 Either!(None, bool) streamable_; 1722 /** 1723 * A documentation string for this object, or an array of strings which should be concatenated. 1724 */ 1725 Either!(None, string, string[]) doc_; 1726 /** 1727 * The unique identifier for this object. 1728 */ 1729 @id Either!(None, string) id_; 1730 /** 1731 * Only valid when `type: File` or is an array of `items: File`. 1732 * This is the file format that will be assigned to the output 1733 * File object. 1734 */ 1735 @link Either!(None, string, Expression) format_; 1736 /** 1737 * Specify valid types of data that may be assigned to this parameter. 1738 */ 1739 @typeDSL Either!(CWLType, stdout, stderr, CommandOutputRecordSchema, CommandOutputEnumSchema, CommandOutputArraySchema, string, Either!(CWLType, CommandOutputRecordSchema, CommandOutputEnumSchema, CommandOutputArraySchema, string)[]) type_; 1740 /** 1741 * Describes how to generate this output object based on the files produced by a CommandLineTool 1742 */ 1743 Either!(None, CommandOutputBinding) outputBinding_; 1744 1745 mixin genCtor; 1746 mixin genIdentifier; 1747 mixin genDumper; 1748 } 1749 1750 /** 1751 * Only valid as a `type` for a `CommandLineTool` input with no 1752 * `inputBinding` set. `stdin` must not be specified at the `CommandLineTool` 1753 * level. 1754 * The following 1755 * ``` 1756 * inputs: 1757 * an_input_name: 1758 * type: stdin 1759 * ``` 1760 * is equivalent to 1761 * ``` 1762 * inputs: 1763 * an_input_name: 1764 * type: File 1765 * streamable: true 1766 * stdin: ${inputs.an_input_name.path} 1767 * ``` 1768 */ 1769 class stdin : SchemaBase 1770 { 1771 enum Symbol 1772 { 1773 s0 = "stdin" 1774 } 1775 1776 Symbol value; 1777 1778 mixin genCtor; 1779 mixin genOpEq; 1780 mixin genDumper; 1781 } 1782 1783 /** 1784 * Only valid as a `type` for a `CommandLineTool` output with no 1785 * `outputBinding` set. 1786 * The following 1787 * ``` 1788 * outputs: 1789 * an_output_name: 1790 * type: stdout 1791 * stdout: a_stdout_file 1792 * ``` 1793 * is equivalent to 1794 * ``` 1795 * outputs: 1796 * an_output_name: 1797 * type: File 1798 * streamable: true 1799 * outputBinding: 1800 * glob: a_stdout_file 1801 * stdout: a_stdout_file 1802 * ``` 1803 * If there is no `stdout` name provided, a random filename will be created. 1804 * For example, the following 1805 * ``` 1806 * outputs: 1807 * an_output_name: 1808 * type: stdout 1809 * ``` 1810 * is equivalent to 1811 * ``` 1812 * outputs: 1813 * an_output_name: 1814 * type: File 1815 * streamable: true 1816 * outputBinding: 1817 * glob: random_stdout_filenameABCDEFG 1818 * stdout: random_stdout_filenameABCDEFG 1819 * ``` 1820 */ 1821 class stdout : SchemaBase 1822 { 1823 enum Symbol 1824 { 1825 s0 = "stdout" 1826 } 1827 1828 Symbol value; 1829 1830 mixin genCtor; 1831 mixin genOpEq; 1832 mixin genDumper; 1833 } 1834 1835 /** 1836 * Only valid as a `type` for a `CommandLineTool` output with no 1837 * `outputBinding` set. 1838 * The following 1839 * ``` 1840 * outputs: 1841 * an_output_name: 1842 * type: stderr 1843 * stderr: a_stderr_file 1844 * ``` 1845 * is equivalent to 1846 * ``` 1847 * outputs: 1848 * an_output_name: 1849 * type: File 1850 * streamable: true 1851 * outputBinding: 1852 * glob: a_stderr_file 1853 * stderr: a_stderr_file 1854 * ``` 1855 * If there is no `stderr` name provided, a random filename will be created. 1856 * For example, the following 1857 * ``` 1858 * outputs: 1859 * an_output_name: 1860 * type: stderr 1861 * ``` 1862 * is equivalent to 1863 * ``` 1864 * outputs: 1865 * an_output_name: 1866 * type: File 1867 * streamable: true 1868 * outputBinding: 1869 * glob: random_stderr_filenameABCDEFG 1870 * stderr: random_stderr_filenameABCDEFG 1871 * ``` 1872 */ 1873 class stderr : SchemaBase 1874 { 1875 enum Symbol 1876 { 1877 s0 = "stderr" 1878 } 1879 1880 Symbol value; 1881 1882 mixin genCtor; 1883 mixin genOpEq; 1884 mixin genDumper; 1885 } 1886 1887 /** 1888 * This defines the schema of the CWL Command Line Tool Description document. 1889 */ 1890 @documentRoot class CommandLineTool : SchemaBase 1891 { 1892 /** 1893 * The unique identifier for this object. 1894 */ 1895 @id Either!(None, string) id_; 1896 /** 1897 * A short, human-readable label of this object. 1898 */ 1899 Either!(None, string) label_; 1900 /** 1901 * A documentation string for this object, or an array of strings which should be concatenated. 1902 */ 1903 Either!(None, string, string[]) doc_; 1904 /** 1905 * Defines the input parameters of the process. The process is ready to 1906 * run when all required input parameters are associated with concrete 1907 * values. Input parameters include a schema for each parameter which is 1908 * used to validate the input object. It may also be used to build a user 1909 * interface for constructing the input object. 1910 * When accepting an input object, all input parameters must have a value. 1911 * If an input parameter is missing from the input object, it must be 1912 * assigned a value of `null` (or the value of `default` for that 1913 * parameter, if provided) for the purposes of validation and evaluation 1914 * of expressions. 1915 */ 1916 @idMap("id", "type") CommandInputParameter[] inputs_; 1917 /** 1918 * Defines the parameters representing the output of the process. May be 1919 * used to generate and/or validate the output object. 1920 */ 1921 @idMap("id", "type") CommandOutputParameter[] outputs_; 1922 /** 1923 * Declares requirements that apply to either the runtime environment or the 1924 * workflow engine that must be met in order to execute this process. If 1925 * an implementation cannot satisfy all requirements, or a requirement is 1926 * listed which is not recognized by the implementation, it is a fatal 1927 * error and the implementation must not attempt to run the process, 1928 * unless overridden at user option. 1929 */ 1930 @idMap("class") Either!(None, Either!(InlineJavascriptRequirement, SchemaDefRequirement, LoadListingRequirement, DockerRequirement, SoftwareRequirement, InitialWorkDirRequirement, EnvVarRequirement, ShellCommandRequirement, ResourceRequirement, WorkReuse, NetworkAccess, InplaceUpdateRequirement, ToolTimeLimit, SubworkflowFeatureRequirement, ScatterFeatureRequirement, MultipleInputFeatureRequirement, StepInputExpressionRequirement)[]) requirements_; 1931 /** 1932 * Declares hints applying to either the runtime environment or the 1933 * workflow engine that may be helpful in executing this process. It is 1934 * not an error if an implementation cannot satisfy all hints, however 1935 * the implementation may report a warning. 1936 */ 1937 @idMap("class") Either!(None, Either!(InlineJavascriptRequirement, SchemaDefRequirement, LoadListingRequirement, DockerRequirement, SoftwareRequirement, InitialWorkDirRequirement, EnvVarRequirement, ShellCommandRequirement, ResourceRequirement, WorkReuse, NetworkAccess, InplaceUpdateRequirement, ToolTimeLimit, SubworkflowFeatureRequirement, ScatterFeatureRequirement, MultipleInputFeatureRequirement, StepInputExpressionRequirement, Any)[]) hints_; 1938 /** 1939 * CWL document version. Always required at the document root. Not 1940 * required for a Process embedded inside another Process. 1941 */ 1942 Either!(None, CWLVersion) cwlVersion_; 1943 /// 1944 static immutable class_ = "CommandLineTool"; 1945 /** 1946 * Specifies the program to execute. If an array, the first element of 1947 * the array is the command to execute, and subsequent elements are 1948 * mandatory command line arguments. The elements in `baseCommand` must 1949 * appear before any command line bindings from `inputBinding` or 1950 * `arguments`. 1951 * If `baseCommand` is not provided or is an empty array, the first 1952 * element of the command line produced after processing `inputBinding` or 1953 * `arguments` must be used as the program to execute. 1954 * If the program includes a path separator character it must 1955 * be an absolute path, otherwise it is an error. If the program does not 1956 * include a path separator, search the `$PATH` variable in the runtime 1957 * environment of the workflow runner find the absolute path of the 1958 * executable. 1959 */ 1960 Either!(None, string, string[]) baseCommand_; 1961 /** 1962 * Command line bindings which are not directly associated with input 1963 * parameters. If the value is a string, it is used as a string literal 1964 * argument. If it is an Expression, the result of the evaluation is used 1965 * as an argument. 1966 */ 1967 Either!(None, Either!(string, Expression, CommandLineBinding)[]) arguments_; 1968 /** 1969 * A path to a file whose contents must be piped into the command's 1970 * standard input stream. 1971 */ 1972 Either!(None, string, Expression) stdin_; 1973 /** 1974 * Capture the command's standard error stream to a file written to 1975 * the designated output directory. 1976 * If `stderr` is a string, it specifies the file name to use. 1977 * If `stderr` is an expression, the expression is evaluated and must 1978 * return a string with the file name to use to capture stderr. If the 1979 * return value is not a string, or the resulting path contains illegal 1980 * characters (such as the path separator `/`) it is an error. 1981 */ 1982 Either!(None, string, Expression) stderr_; 1983 /** 1984 * Capture the command's standard output stream to a file written to 1985 * the designated output directory. 1986 * If `stdout` is a string, it specifies the file name to use. 1987 * If `stdout` is an expression, the expression is evaluated and must 1988 * return a string with the file name to use to capture stdout. If the 1989 * return value is not a string, or the resulting path contains illegal 1990 * characters (such as the path separator `/`) it is an error. 1991 */ 1992 Either!(None, string, Expression) stdout_; 1993 /** 1994 * Exit codes that indicate the process completed successfully. 1995 */ 1996 Either!(None, int[]) successCodes_; 1997 /** 1998 * Exit codes that indicate the process failed due to a possibly 1999 * temporary condition, where executing the process with the same 2000 * runtime environment and inputs may produce different results. 2001 */ 2002 Either!(None, int[]) temporaryFailCodes_; 2003 /** 2004 * Exit codes that indicate the process failed due to a permanent logic error, where executing the process with the same runtime environment and same inputs is expected to always fail. 2005 */ 2006 Either!(None, int[]) permanentFailCodes_; 2007 2008 mixin genCtor; 2009 mixin genIdentifier; 2010 mixin genDumper; 2011 } 2012 2013 /** 2014 * Indicates that a workflow component should be run in a 2015 * [Docker](http://docker.com) or Docker-compatible (such as 2016 * [Singularity](https://www.sylabs.io/) and [udocker](https://github.com/indigo-dc/udocker)) container environment and 2017 * specifies how to fetch or build the image. 2018 * If a CommandLineTool lists `DockerRequirement` under 2019 * `hints` (or `requirements`), it may (or must) be run in the specified Docker 2020 * container. 2021 * The platform must first acquire or install the correct Docker image as 2022 * specified by `dockerPull`, `dockerImport`, `dockerLoad` or `dockerFile`. 2023 * The platform must execute the tool in the container using `docker run` with 2024 * the appropriate Docker image and tool command line. 2025 * The workflow platform may provide input files and the designated output 2026 * directory through the use of volume bind mounts. The platform should rewrite 2027 * file paths in the input object to correspond to the Docker bind mounted 2028 * locations. That is, the platform should rewrite values in the parameter context 2029 * such as `runtime.outdir`, `runtime.tmpdir` and others to be valid paths 2030 * within the container. The platform must ensure that `runtime.outdir` and 2031 * `runtime.tmpdir` are distinct directories. 2032 * When running a tool contained in Docker, the workflow platform must not 2033 * assume anything about the contents of the Docker container, such as the 2034 * presence or absence of specific software, except to assume that the 2035 * generated command line represents a valid command within the runtime 2036 * environment of the container. 2037 * A container image may specify an 2038 * [ENTRYPOINT](https://docs.docker.com/engine/reference/builder/#entrypoint) 2039 * and/or 2040 * [CMD](https://docs.docker.com/engine/reference/builder/#cmd). 2041 * Command line arguments will be appended after all elements of 2042 * ENTRYPOINT, and will override all elements specified using CMD (in 2043 * other words, CMD is only used when the CommandLineTool definition 2044 * produces an empty command line). 2045 * Use of implicit ENTRYPOINT or CMD are discouraged due to reproducibility 2046 * concerns of the implicit hidden execution point (For further discussion, see 2047 * [https://doi.org/10.12688/f1000research.15140.1](https://doi.org/10.12688/f1000research.15140.1)). Portable 2048 * CommandLineTool wrappers in which use of a container is optional must not rely on ENTRYPOINT or CMD. 2049 * CommandLineTools which do rely on ENTRYPOINT or CMD must list `DockerRequirement` in the 2050 * `requirements` section. 2051 * ## Interaction with other requirements 2052 * If [EnvVarRequirement](#EnvVarRequirement) is specified alongside a 2053 * DockerRequirement, the environment variables must be provided to Docker 2054 * using `--env` or `--env-file` and interact with the container's preexisting 2055 * environment as defined by Docker. 2056 */ 2057 class DockerRequirement : SchemaBase 2058 { 2059 /** 2060 * Always 'DockerRequirement' 2061 */ 2062 static immutable class_ = "DockerRequirement"; 2063 /** 2064 * Specify a Docker image to retrieve using `docker pull`. Can contain the 2065 * immutable digest to ensure an exact container is used: 2066 * `dockerPull: ubuntu@sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2` 2067 */ 2068 Either!(None, string) dockerPull_; 2069 /** 2070 * Specify a HTTP URL from which to download a Docker image using `docker load`. 2071 */ 2072 Either!(None, string) dockerLoad_; 2073 /** 2074 * Supply the contents of a Dockerfile which will be built using `docker build`. 2075 */ 2076 Either!(None, string) dockerFile_; 2077 /** 2078 * Provide HTTP URL to download and gunzip a Docker images using `docker import. 2079 */ 2080 Either!(None, string) dockerImport_; 2081 /** 2082 * The image id that will be used for `docker run`. May be a 2083 * human-readable image name or the image identifier hash. May be skipped 2084 * if `dockerPull` is specified, in which case the `dockerPull` image id 2085 * must be used. 2086 */ 2087 Either!(None, string) dockerImageId_; 2088 /** 2089 * Set the designated output directory to a specific location inside the 2090 * Docker container. 2091 */ 2092 Either!(None, string) dockerOutputDirectory_; 2093 2094 mixin genCtor; 2095 mixin genIdentifier; 2096 mixin genDumper; 2097 } 2098 2099 /** 2100 * A list of software packages that should be configured in the environment of 2101 * the defined process. 2102 */ 2103 class SoftwareRequirement : SchemaBase 2104 { 2105 /** 2106 * Always 'SoftwareRequirement' 2107 */ 2108 static immutable class_ = "SoftwareRequirement"; 2109 /** 2110 * The list of software to be configured. 2111 */ 2112 @idMap("package", "specs") SoftwarePackage[] packages_; 2113 2114 mixin genCtor; 2115 mixin genIdentifier; 2116 mixin genDumper; 2117 } 2118 2119 /// 2120 class SoftwarePackage : SchemaBase 2121 { 2122 /** 2123 * The name of the software to be made available. If the name is 2124 * common, inconsistent, or otherwise ambiguous it should be combined with 2125 * one or more identifiers in the `specs` field. 2126 */ 2127 string package_; 2128 /** 2129 * The (optional) versions of the software that are known to be 2130 * compatible. 2131 */ 2132 Either!(None, string[]) version_; 2133 /** 2134 * One or more [IRI](https://en.wikipedia.org/wiki/Internationalized_Resource_Identifier)s 2135 * identifying resources for installing or enabling the software named in 2136 * the `package` field. Implementations may provide resolvers which map 2137 * these software identifer IRIs to some configuration action; or they can 2138 * use only the name from the `package` field on a best effort basis. 2139 * For example, the IRI https://packages.debian.org/bowtie could 2140 * be resolved with `apt-get install bowtie`. The IRI 2141 * https://anaconda.org/bioconda/bowtie could be resolved with `conda 2142 * install -c bioconda bowtie`. 2143 * IRIs can also be system independent and used to map to a specific 2144 * software installation or selection mechanism. 2145 * Using [RRID](https://www.identifiers.org/rrid/) as an example: 2146 * https://identifiers.org/rrid/RRID:SCR_005476 2147 * could be fulfilled using the above mentioned Debian or bioconda 2148 * package, a local installation managed by [Environement Modules](http://modules.sourceforge.net/), 2149 * or any other mechanism the platform chooses. IRIs can also be from 2150 * identifer sources that are discipline specific yet still system 2151 * independent. As an example, the equivalent [ELIXIR Tools and Data 2152 * Service Registry](https://bio.tools) IRI to the previous RRID example is 2153 * https://bio.tools/tool/bowtie2/version/2.2.8. 2154 * If supported by a given registry, implementations are encouraged to 2155 * query these system independent sofware identifier IRIs directly for 2156 * links to packaging systems. 2157 * A site specific IRI can be listed as well. For example, an academic 2158 * computing cluster using Environement Modules could list the IRI 2159 * `https://hpc.example.edu/modules/bowtie-tbb/1.22` to indicate that 2160 * `module load bowtie-tbb/1.1.2` should be executed to make available 2161 * `bowtie` version 1.1.2 compiled with the TBB library prior to running 2162 * the accompanying Workflow or CommandLineTool. Note that the example IRI 2163 * is specific to a particular institution and computing environment as 2164 * the Environment Modules system does not have a common namespace or 2165 * standardized naming convention. 2166 * This last example is the least portable and should only be used if 2167 * mechanisms based off of the `package` field or more generic IRIs are 2168 * unavailable or unsuitable. While harmless to other sites, site specific 2169 * software IRIs should be left out of shared CWL descriptions to avoid 2170 * clutter. 2171 */ 2172 @link Either!(None, string[]) specs_; 2173 2174 mixin genCtor; 2175 mixin genIdentifier; 2176 mixin genDumper; 2177 } 2178 2179 /** 2180 * Define a file or subdirectory that must be placed in the designated output 2181 * directory prior to executing the command line tool. May be the result of 2182 * executing an expression, such as building a configuration file from a 2183 * template. 2184 */ 2185 class Dirent : SchemaBase 2186 { 2187 /** 2188 * The name of the file or subdirectory to create in the output directory. 2189 * If `entry` is a File or Directory, the `entryname` field overrides the value 2190 * of `basename` of the File or Directory object. Optional. 2191 */ 2192 Either!(None, string, Expression) entryname_; 2193 /** 2194 * If the value is a string literal or an expression which evaluates to a 2195 * string, a new file must be created with the string as the file contents. 2196 * If the value is an expression that evaluates to a `File` object, this 2197 * indicates the referenced file should be added to the designated output 2198 * directory prior to executing the tool. 2199 * If the value is an expression that evaluates to a `Dirent` object, this 2200 * indicates that the File or Directory in `entry` should be added to the 2201 * designated output directory with the name in `entryname`. 2202 * If `writable` is false, the file may be made available using a bind 2203 * mount or file system link to avoid unnecessary copying of the input 2204 * file. 2205 */ 2206 Either!(string, Expression) entry_; 2207 /** 2208 * If true, the file or directory must be writable by the tool. Changes 2209 * to the file or directory must be isolated and not visible by any other 2210 * CommandLineTool process. This may be implemented by making a copy of 2211 * the original file or directory. Default false (files and directories 2212 * read-only by default). 2213 * A directory marked as `writable: true` implies that all files and 2214 * subdirectories are recursively writable as well. 2215 */ 2216 Either!(None, bool) writable_; 2217 2218 mixin genCtor; 2219 mixin genIdentifier; 2220 mixin genDumper; 2221 } 2222 2223 /** 2224 * Define a list of files and subdirectories that must be created by the workflow platform in the designated output directory prior to executing the command line tool. 2225 */ 2226 class InitialWorkDirRequirement : SchemaBase 2227 { 2228 /** 2229 * InitialWorkDirRequirement 2230 */ 2231 static immutable class_ = "InitialWorkDirRequirement"; 2232 /** 2233 * The list of files or subdirectories that must be placed in the 2234 * designated output directory prior to executing the command line tool. 2235 * May be an expression. If so, the expression return value must validate as 2236 * `{type: array, items: ["null", File, File[], Directory, Directory[], Dirent]}`. 2237 * Files or Directories which are listed in the input parameters and 2238 * appear in the `InitialWorkDirRequirement` listing must have their 2239 * `path` set to their staged location in the designated output directory. 2240 * If the same File or Directory appears more than once in the 2241 * `InitialWorkDirRequirement` listing, the implementation must choose 2242 * exactly one value for `path`; how this value is chosen is undefined. 2243 */ 2244 Either!(Either!(None, File, Either!(File, Directory)[], Directory, Dirent, Expression)[], Expression) listing_; 2245 2246 mixin genCtor; 2247 mixin genIdentifier; 2248 mixin genDumper; 2249 } 2250 2251 /** 2252 * Define a list of environment variables which will be set in the 2253 * execution environment of the tool. See `EnvironmentDef` for details. 2254 */ 2255 class EnvVarRequirement : SchemaBase 2256 { 2257 /** 2258 * Always 'EnvVarRequirement' 2259 */ 2260 static immutable class_ = "EnvVarRequirement"; 2261 /** 2262 * The list of environment variables. 2263 */ 2264 @idMap("envName", "envValue") EnvironmentDef[] envDef_; 2265 2266 mixin genCtor; 2267 mixin genIdentifier; 2268 mixin genDumper; 2269 } 2270 2271 /** 2272 * Modify the behavior of CommandLineTool to generate a single string 2273 * containing a shell command line. Each item in the argument list must be 2274 * joined into a string separated by single spaces and quoted to prevent 2275 * intepretation by the shell, unless `CommandLineBinding` for that argument 2276 * contains `shellQuote: false`. If `shellQuote: false` is specified, the 2277 * argument is joined into the command string without quoting, which allows 2278 * the use of shell metacharacters such as `|` for pipes. 2279 */ 2280 class ShellCommandRequirement : SchemaBase 2281 { 2282 /** 2283 * Always 'ShellCommandRequirement' 2284 */ 2285 static immutable class_ = "ShellCommandRequirement"; 2286 2287 mixin genCtor; 2288 mixin genIdentifier; 2289 mixin genDumper; 2290 } 2291 2292 /** 2293 * Specify basic hardware resource requirements. 2294 * "min" is the minimum amount of a resource that must be reserved to schedule 2295 * a job. If "min" cannot be satisfied, the job should not be run. 2296 * "max" is the maximum amount of a resource that the job shall be permitted 2297 * to use. If a node has sufficient resources, multiple jobs may be scheduled 2298 * on a single node provided each job's "max" resource requirements are 2299 * met. If a job attempts to exceed its "max" resource allocation, an 2300 * implementation may deny additional resources, which may result in job 2301 * failure. 2302 * If "min" is specified but "max" is not, then "max" == "min" 2303 * If "max" is specified by "min" is not, then "min" == "max". 2304 * It is an error if max < min. 2305 * It is an error if the value of any of these fields is negative. 2306 * If neither "min" nor "max" is specified for a resource, use the default values below. 2307 */ 2308 class ResourceRequirement : SchemaBase 2309 { 2310 /** 2311 * Always 'ResourceRequirement' 2312 */ 2313 static immutable class_ = "ResourceRequirement"; 2314 /** 2315 * Minimum reserved number of CPU cores (default is 1) 2316 */ 2317 Either!(None, long, Expression) coresMin_; 2318 /** 2319 * Maximum reserved number of CPU cores 2320 */ 2321 Either!(None, int, Expression) coresMax_; 2322 /** 2323 * Minimum reserved RAM in mebibytes (2**20) (default is 256) 2324 */ 2325 Either!(None, long, Expression) ramMin_; 2326 /** 2327 * Maximum reserved RAM in mebibytes (2**20) 2328 */ 2329 Either!(None, long, Expression) ramMax_; 2330 /** 2331 * Minimum reserved filesystem based storage for the designated temporary directory, in mebibytes (2**20) (default is 1024) 2332 */ 2333 Either!(None, long, Expression) tmpdirMin_; 2334 /** 2335 * Maximum reserved filesystem based storage for the designated temporary directory, in mebibytes (2**20) 2336 */ 2337 Either!(None, long, Expression) tmpdirMax_; 2338 /** 2339 * Minimum reserved filesystem based storage for the designated output directory, in mebibytes (2**20) (default is 1024) 2340 */ 2341 Either!(None, long, Expression) outdirMin_; 2342 /** 2343 * Maximum reserved filesystem based storage for the designated output directory, in mebibytes (2**20) 2344 */ 2345 Either!(None, long, Expression) outdirMax_; 2346 2347 mixin genCtor; 2348 mixin genIdentifier; 2349 mixin genDumper; 2350 } 2351 2352 /** 2353 * For implementations that support reusing output from past work (on 2354 * the assumption that same code and same input produce same 2355 * results), control whether to enable or disable the reuse behavior 2356 * for a particular tool or step (to accomodate situations where that 2357 * assumption is incorrect). A reused step is not executed but 2358 * instead returns the same output as the original execution. 2359 * If `enableReuse` is not specified, correct tools should assume it 2360 * is enabled by default. 2361 */ 2362 class WorkReuse : SchemaBase 2363 { 2364 /** 2365 * Always 'WorkReuse' 2366 */ 2367 static immutable class_ = "WorkReuse"; 2368 /// 2369 Either!(bool, Expression) enableReuse_; 2370 2371 mixin genCtor; 2372 mixin genIdentifier; 2373 mixin genDumper; 2374 } 2375 2376 /** 2377 * Indicate whether a process requires outgoing IPv4/IPv6 network 2378 * access. Choice of IPv4 or IPv6 is implementation and site 2379 * specific, correct tools must support both. 2380 * If `networkAccess` is false or not specified, tools must not 2381 * assume network access, except for localhost (the loopback device). 2382 * If `networkAccess` is true, the tool must be able to make outgoing 2383 * connections to network resources. Resources may be on a private 2384 * subnet or the public Internet. However, implementations and sites 2385 * may apply their own security policies to restrict what is 2386 * accessible by the tool. 2387 * Enabling network access does not imply a publically routable IP 2388 * address or the ability to accept inbound connections. 2389 */ 2390 class NetworkAccess : SchemaBase 2391 { 2392 /** 2393 * Always 'NetworkAccess' 2394 */ 2395 static immutable class_ = "NetworkAccess"; 2396 /// 2397 Either!(bool, Expression) networkAccess_; 2398 2399 mixin genCtor; 2400 mixin genIdentifier; 2401 mixin genDumper; 2402 } 2403 2404 /** 2405 * If `inplaceUpdate` is true, then an implementation supporting this 2406 * feature may permit tools to directly update files with `writable: 2407 * true` in InitialWorkDirRequirement. That is, as an optimization, 2408 * files may be destructively modified in place as opposed to copied 2409 * and updated. 2410 * An implementation must ensure that only one workflow step may 2411 * access a writable file at a time. It is an error if a file which 2412 * is writable by one workflow step file is accessed (for reading or 2413 * writing) by any other workflow step running independently. 2414 * However, a file which has been updated in a previous completed 2415 * step may be used as input to multiple steps, provided it is 2416 * read-only in every step. 2417 * Workflow steps which modify a file must produce the modified file 2418 * as output. Downstream steps which futher process the file must 2419 * use the output of previous steps, and not refer to a common input 2420 * (this is necessary for both ordering and correctness). 2421 * Workflow authors should provide this in the `hints` section. The 2422 * intent of this feature is that workflows produce the same results 2423 * whether or not InplaceUpdateRequirement is supported by the 2424 * implementation, and this feature is primarily available as an 2425 * optimization for particular environments. 2426 * Users and implementers should be aware that workflows that 2427 * destructively modify inputs may not be repeatable or reproducible. 2428 * In particular, enabling this feature implies that WorkReuse should 2429 * not be enabled. 2430 */ 2431 class InplaceUpdateRequirement : SchemaBase 2432 { 2433 /** 2434 * Always 'InplaceUpdateRequirement' 2435 */ 2436 static immutable class_ = "InplaceUpdateRequirement"; 2437 /// 2438 bool inplaceUpdate_; 2439 2440 mixin genCtor; 2441 mixin genIdentifier; 2442 mixin genDumper; 2443 } 2444 2445 /** 2446 * Set an upper limit on the execution time of a CommandLineTool. 2447 * A CommandLineTool whose execution duration exceeds the time 2448 * limit may be preemptively terminated and considered failed. 2449 * May also be used by batch systems to make scheduling decisions. 2450 * The execution duration excludes external operations, such as 2451 * staging of files, pulling a docker image etc, and only counts 2452 * wall-time for the execution of the command line itself. 2453 */ 2454 class ToolTimeLimit : SchemaBase 2455 { 2456 /** 2457 * Always 'ToolTimeLimit' 2458 */ 2459 static immutable class_ = "ToolTimeLimit"; 2460 /** 2461 * The time limit, in seconds. A time limit of zero means no 2462 * time limit. Negative time limits are an error. 2463 */ 2464 Either!(long, Expression) timelimit_; 2465 2466 mixin genCtor; 2467 mixin genIdentifier; 2468 mixin genDumper; 2469 } 2470 2471 /// 2472 class ExpressionToolOutputParameter : SchemaBase 2473 { 2474 /** 2475 * A short, human-readable label of this object. 2476 */ 2477 Either!(None, string) label_; 2478 /** 2479 * Only valid when `type: File` or is an array of `items: File`. 2480 * Provides a pattern or expression specifying files or 2481 * directories that should be included alongside the primary 2482 * file. Secondary files may be required or optional. When not 2483 * explicitly specified, secondary files specified for `inputs` 2484 * are required and `outputs` are optional. An implementation 2485 * must include matching Files and Directories in the 2486 * `secondaryFiles` property of the primary file. These Files 2487 * and Directories must be transferred and staged alongside the 2488 * primary file. An implementation may fail workflow execution 2489 * if a required secondary file does not exist. 2490 * If the value is an expression, the value of `self` in the expression 2491 * must be the primary input or output File object to which this binding 2492 * applies. The `basename`, `nameroot` and `nameext` fields must be 2493 * present in `self`. For `CommandLineTool` outputs the `path` field must 2494 * also be present. The expression must return a filename string relative 2495 * to the path to the primary File, a File or Directory object with either 2496 * `path` or `location` and `basename` fields set, or an array consisting 2497 * of strings or File or Directory objects. It is legal to reference an 2498 * unchanged File or Directory object taken from input as a secondaryFile. 2499 * The expression may return "null" in which case there is no secondaryFile 2500 * from that expression. 2501 * To work on non-filename-preserving storage systems, portable tool 2502 * descriptions should avoid constructing new values from `location`, but 2503 * should construct relative references using `basename` or `nameroot` 2504 * instead. 2505 * If a value in `secondaryFiles` is a string that is not an expression, 2506 * it specifies that the following pattern should be applied to the path 2507 * of the primary file to yield a filename relative to the primary File: 2508 * 1. If string ends with `?` character, remove the last `?` and mark 2509 * the resulting secondary file as optional. 2510 * 2. If string begins with one or more caret `^` characters, for each 2511 * caret, remove the last file extension from the path (the last 2512 * period `.` and all following characters). If there are no file 2513 * extensions, the path is unchanged. 2514 * 3. Append the remainder of the string to the end of the file path. 2515 */ 2516 @secondaryFilesDSL Either!(None, SecondaryFileSchema, SecondaryFileSchema[]) secondaryFiles_; 2517 /** 2518 * Only valid when `type: File` or is an array of `items: File`. 2519 * A value of `true` indicates that the file is read or written 2520 * sequentially without seeking. An implementation may use this flag to 2521 * indicate whether it is valid to stream file contents using a named 2522 * pipe. Default: `false`. 2523 */ 2524 Either!(None, bool) streamable_; 2525 /** 2526 * A documentation string for this object, or an array of strings which should be concatenated. 2527 */ 2528 Either!(None, string, string[]) doc_; 2529 /** 2530 * The unique identifier for this object. 2531 */ 2532 @id Either!(None, string) id_; 2533 /** 2534 * Only valid when `type: File` or is an array of `items: File`. 2535 * This is the file format that will be assigned to the output 2536 * File object. 2537 */ 2538 @link Either!(None, string, Expression) format_; 2539 /** 2540 * Specify valid types of data that may be assigned to this parameter. 2541 */ 2542 @typeDSL Either!(CWLType, OutputRecordSchema, OutputEnumSchema, OutputArraySchema, string, Either!(CWLType, OutputRecordSchema, OutputEnumSchema, OutputArraySchema, string)[]) type_; 2543 2544 mixin genCtor; 2545 mixin genIdentifier; 2546 mixin genDumper; 2547 } 2548 2549 /// 2550 class WorkflowInputParameter : SchemaBase 2551 { 2552 /** 2553 * A short, human-readable label of this object. 2554 */ 2555 Either!(None, string) label_; 2556 /** 2557 * Only valid when `type: File` or is an array of `items: File`. 2558 * Provides a pattern or expression specifying files or 2559 * directories that should be included alongside the primary 2560 * file. Secondary files may be required or optional. When not 2561 * explicitly specified, secondary files specified for `inputs` 2562 * are required and `outputs` are optional. An implementation 2563 * must include matching Files and Directories in the 2564 * `secondaryFiles` property of the primary file. These Files 2565 * and Directories must be transferred and staged alongside the 2566 * primary file. An implementation may fail workflow execution 2567 * if a required secondary file does not exist. 2568 * If the value is an expression, the value of `self` in the expression 2569 * must be the primary input or output File object to which this binding 2570 * applies. The `basename`, `nameroot` and `nameext` fields must be 2571 * present in `self`. For `CommandLineTool` outputs the `path` field must 2572 * also be present. The expression must return a filename string relative 2573 * to the path to the primary File, a File or Directory object with either 2574 * `path` or `location` and `basename` fields set, or an array consisting 2575 * of strings or File or Directory objects. It is legal to reference an 2576 * unchanged File or Directory object taken from input as a secondaryFile. 2577 * The expression may return "null" in which case there is no secondaryFile 2578 * from that expression. 2579 * To work on non-filename-preserving storage systems, portable tool 2580 * descriptions should avoid constructing new values from `location`, but 2581 * should construct relative references using `basename` or `nameroot` 2582 * instead. 2583 * If a value in `secondaryFiles` is a string that is not an expression, 2584 * it specifies that the following pattern should be applied to the path 2585 * of the primary file to yield a filename relative to the primary File: 2586 * 1. If string ends with `?` character, remove the last `?` and mark 2587 * the resulting secondary file as optional. 2588 * 2. If string begins with one or more caret `^` characters, for each 2589 * caret, remove the last file extension from the path (the last 2590 * period `.` and all following characters). If there are no file 2591 * extensions, the path is unchanged. 2592 * 3. Append the remainder of the string to the end of the file path. 2593 */ 2594 @secondaryFilesDSL Either!(None, SecondaryFileSchema, SecondaryFileSchema[]) secondaryFiles_; 2595 /** 2596 * Only valid when `type: File` or is an array of `items: File`. 2597 * A value of `true` indicates that the file is read or written 2598 * sequentially without seeking. An implementation may use this flag to 2599 * indicate whether it is valid to stream file contents using a named 2600 * pipe. Default: `false`. 2601 */ 2602 Either!(None, bool) streamable_; 2603 /** 2604 * A documentation string for this object, or an array of strings which should be concatenated. 2605 */ 2606 Either!(None, string, string[]) doc_; 2607 /** 2608 * The unique identifier for this object. 2609 */ 2610 @id Either!(None, string) id_; 2611 /** 2612 * Only valid when `type: File` or is an array of `items: File`. 2613 * This must be one or more IRIs of concept nodes 2614 * that represents file formats which are allowed as input to this 2615 * parameter, preferrably defined within an ontology. If no ontology is 2616 * available, file formats may be tested by exact match. 2617 */ 2618 @link Either!(None, string, string[], Expression) format_; 2619 /** 2620 * Only valid when `type: File` or is an array of `items: File`. 2621 * Read up to the first 64 KiB of text from the file and place it in the 2622 * "contents" field of the file object for use by expressions. 2623 */ 2624 Either!(None, bool) loadContents_; 2625 /** 2626 * Only valid when `type: Directory` or is an array of `items: Directory`. 2627 * Specify the desired behavior for loading the `listing` field of 2628 * a Directory object for use by expressions. 2629 * The order of precedence for loadListing is: 2630 * 1. `loadListing` on an individual parameter 2631 * 2. Inherited from `LoadListingRequirement` 2632 * 3. By default: `no_listing` 2633 */ 2634 Either!(None, LoadListingEnum) loadListing_; 2635 /** 2636 * The default value to use for this parameter if the parameter is missing 2637 * from the input object, or if the value of the parameter in the input 2638 * object is `null`. Default values are applied before evaluating expressions 2639 * (e.g. dependent `valueFrom` fields). 2640 */ 2641 Either!(None, File, Directory, Any) default_; 2642 /** 2643 * Specify valid types of data that may be assigned to this parameter. 2644 */ 2645 @typeDSL Either!(CWLType, InputRecordSchema, InputEnumSchema, InputArraySchema, string, Either!(CWLType, InputRecordSchema, InputEnumSchema, InputArraySchema, string)[]) type_; 2646 /** 2647 * Deprecated. Preserved for v1.0 backwards compatability. Will be removed in 2648 * CWL v2.0. Use `WorkflowInputParameter.loadContents` instead. 2649 */ 2650 Either!(None, InputBinding) inputBinding_; 2651 2652 mixin genCtor; 2653 mixin genIdentifier; 2654 mixin genDumper; 2655 } 2656 2657 /** 2658 * An ExpressionTool is a type of Process object that can be run by itself 2659 * or as a Workflow step. It executes a pure Javascript expression that has 2660 * access to the same input parameters as a workflow. It is meant to be used 2661 * sparingly as a way to isolate complex Javascript expressions that need to 2662 * operate on input data and produce some result; perhaps just a 2663 * rearrangement of the inputs. No Docker software container is required 2664 * or allowed. 2665 */ 2666 @documentRoot class ExpressionTool : SchemaBase 2667 { 2668 /** 2669 * The unique identifier for this object. 2670 */ 2671 @id Either!(None, string) id_; 2672 /** 2673 * A short, human-readable label of this object. 2674 */ 2675 Either!(None, string) label_; 2676 /** 2677 * A documentation string for this object, or an array of strings which should be concatenated. 2678 */ 2679 Either!(None, string, string[]) doc_; 2680 /** 2681 * Defines the input parameters of the process. The process is ready to 2682 * run when all required input parameters are associated with concrete 2683 * values. Input parameters include a schema for each parameter which is 2684 * used to validate the input object. It may also be used to build a user 2685 * interface for constructing the input object. 2686 * When accepting an input object, all input parameters must have a value. 2687 * If an input parameter is missing from the input object, it must be 2688 * assigned a value of `null` (or the value of `default` for that 2689 * parameter, if provided) for the purposes of validation and evaluation 2690 * of expressions. 2691 */ 2692 @idMap("id", "type") WorkflowInputParameter[] inputs_; 2693 /** 2694 * Defines the parameters representing the output of the process. May be 2695 * used to generate and/or validate the output object. 2696 */ 2697 @idMap("id", "type") ExpressionToolOutputParameter[] outputs_; 2698 /** 2699 * Declares requirements that apply to either the runtime environment or the 2700 * workflow engine that must be met in order to execute this process. If 2701 * an implementation cannot satisfy all requirements, or a requirement is 2702 * listed which is not recognized by the implementation, it is a fatal 2703 * error and the implementation must not attempt to run the process, 2704 * unless overridden at user option. 2705 */ 2706 @idMap("class") Either!(None, Either!(InlineJavascriptRequirement, SchemaDefRequirement, LoadListingRequirement, DockerRequirement, SoftwareRequirement, InitialWorkDirRequirement, EnvVarRequirement, ShellCommandRequirement, ResourceRequirement, WorkReuse, NetworkAccess, InplaceUpdateRequirement, ToolTimeLimit, SubworkflowFeatureRequirement, ScatterFeatureRequirement, MultipleInputFeatureRequirement, StepInputExpressionRequirement)[]) requirements_; 2707 /** 2708 * Declares hints applying to either the runtime environment or the 2709 * workflow engine that may be helpful in executing this process. It is 2710 * not an error if an implementation cannot satisfy all hints, however 2711 * the implementation may report a warning. 2712 */ 2713 @idMap("class") Either!(None, Either!(InlineJavascriptRequirement, SchemaDefRequirement, LoadListingRequirement, DockerRequirement, SoftwareRequirement, InitialWorkDirRequirement, EnvVarRequirement, ShellCommandRequirement, ResourceRequirement, WorkReuse, NetworkAccess, InplaceUpdateRequirement, ToolTimeLimit, SubworkflowFeatureRequirement, ScatterFeatureRequirement, MultipleInputFeatureRequirement, StepInputExpressionRequirement, Any)[]) hints_; 2714 /** 2715 * CWL document version. Always required at the document root. Not 2716 * required for a Process embedded inside another Process. 2717 */ 2718 Either!(None, CWLVersion) cwlVersion_; 2719 /// 2720 static immutable class_ = "ExpressionTool"; 2721 /** 2722 * The expression to execute. The expression must return a JSON object which 2723 * matches the output parameters of the ExpressionTool. 2724 */ 2725 Expression expression_; 2726 2727 mixin genCtor; 2728 mixin genIdentifier; 2729 mixin genDumper; 2730 } 2731 2732 /** 2733 * The input link merge method, described in [WorkflowStepInput](#WorkflowStepInput). 2734 */ 2735 class LinkMergeMethod : SchemaBase 2736 { 2737 enum Symbol 2738 { 2739 s0 = "merge_nested", 2740 s1 = "merge_flattened" 2741 } 2742 2743 Symbol value; 2744 2745 mixin genCtor; 2746 mixin genOpEq; 2747 mixin genDumper; 2748 } 2749 2750 /** 2751 * Describe an output parameter of a workflow. The parameter must be 2752 * connected to one or more parameters defined in the workflow that 2753 * will provide the value of the output parameter. It is legal to 2754 * connect a WorkflowInputParameter to a WorkflowOutputParameter. 2755 */ 2756 class WorkflowOutputParameter : SchemaBase 2757 { 2758 /** 2759 * A short, human-readable label of this object. 2760 */ 2761 Either!(None, string) label_; 2762 /** 2763 * Only valid when `type: File` or is an array of `items: File`. 2764 * Provides a pattern or expression specifying files or 2765 * directories that should be included alongside the primary 2766 * file. Secondary files may be required or optional. When not 2767 * explicitly specified, secondary files specified for `inputs` 2768 * are required and `outputs` are optional. An implementation 2769 * must include matching Files and Directories in the 2770 * `secondaryFiles` property of the primary file. These Files 2771 * and Directories must be transferred and staged alongside the 2772 * primary file. An implementation may fail workflow execution 2773 * if a required secondary file does not exist. 2774 * If the value is an expression, the value of `self` in the expression 2775 * must be the primary input or output File object to which this binding 2776 * applies. The `basename`, `nameroot` and `nameext` fields must be 2777 * present in `self`. For `CommandLineTool` outputs the `path` field must 2778 * also be present. The expression must return a filename string relative 2779 * to the path to the primary File, a File or Directory object with either 2780 * `path` or `location` and `basename` fields set, or an array consisting 2781 * of strings or File or Directory objects. It is legal to reference an 2782 * unchanged File or Directory object taken from input as a secondaryFile. 2783 * The expression may return "null" in which case there is no secondaryFile 2784 * from that expression. 2785 * To work on non-filename-preserving storage systems, portable tool 2786 * descriptions should avoid constructing new values from `location`, but 2787 * should construct relative references using `basename` or `nameroot` 2788 * instead. 2789 * If a value in `secondaryFiles` is a string that is not an expression, 2790 * it specifies that the following pattern should be applied to the path 2791 * of the primary file to yield a filename relative to the primary File: 2792 * 1. If string ends with `?` character, remove the last `?` and mark 2793 * the resulting secondary file as optional. 2794 * 2. If string begins with one or more caret `^` characters, for each 2795 * caret, remove the last file extension from the path (the last 2796 * period `.` and all following characters). If there are no file 2797 * extensions, the path is unchanged. 2798 * 3. Append the remainder of the string to the end of the file path. 2799 */ 2800 @secondaryFilesDSL Either!(None, SecondaryFileSchema, SecondaryFileSchema[]) secondaryFiles_; 2801 /** 2802 * Only valid when `type: File` or is an array of `items: File`. 2803 * A value of `true` indicates that the file is read or written 2804 * sequentially without seeking. An implementation may use this flag to 2805 * indicate whether it is valid to stream file contents using a named 2806 * pipe. Default: `false`. 2807 */ 2808 Either!(None, bool) streamable_; 2809 /** 2810 * A documentation string for this object, or an array of strings which should be concatenated. 2811 */ 2812 Either!(None, string, string[]) doc_; 2813 /** 2814 * The unique identifier for this object. 2815 */ 2816 @id Either!(None, string) id_; 2817 /** 2818 * Only valid when `type: File` or is an array of `items: File`. 2819 * This is the file format that will be assigned to the output 2820 * File object. 2821 */ 2822 @link Either!(None, string, Expression) format_; 2823 /** 2824 * Specifies one or more workflow parameters that supply the value of to 2825 * the output parameter. 2826 */ 2827 @link Either!(None, string, string[]) outputSource_; 2828 /** 2829 * The method to use to merge multiple sources into a single array. 2830 * If not specified, the default method is "merge_nested". 2831 */ 2832 Either!(None, LinkMergeMethod) linkMerge_; 2833 /** 2834 * Specify valid types of data that may be assigned to this parameter. 2835 */ 2836 @typeDSL Either!(CWLType, OutputRecordSchema, OutputEnumSchema, OutputArraySchema, string, Either!(CWLType, OutputRecordSchema, OutputEnumSchema, OutputArraySchema, string)[]) type_; 2837 2838 mixin genCtor; 2839 mixin genIdentifier; 2840 mixin genDumper; 2841 } 2842 2843 /** 2844 * The input of a workflow step connects an upstream parameter (from the 2845 * workflow inputs, or the outputs of other workflows steps) with the input 2846 * parameters of the process specified by the `run` field. Only input parameters 2847 * declared by the target process will be passed through at runtime to the process 2848 * though additonal parameters may be specified (for use within `valueFrom` 2849 * expressions for instance) - unconnected or unused parameters do not represent an 2850 * error condition. 2851 * ## Input object 2852 * A WorkflowStepInput object must contain an `id` field in the form 2853 * `#fieldname` or `#prefix/fieldname`. When the `id` field contains a slash 2854 * `/` the field name consists of the characters following the final slash 2855 * (the prefix portion may contain one or more slashes to indicate scope). 2856 * This defines a field of the workflow step input object with the value of 2857 * the `source` parameter(s). 2858 * ## Merging 2859 * To merge multiple inbound data links, 2860 * [MultipleInputFeatureRequirement](#MultipleInputFeatureRequirement) must be specified 2861 * in the workflow or workflow step requirements. 2862 * If the sink parameter is an array, or named in a [workflow 2863 * scatter](#WorkflowStep) operation, there may be multiple inbound data links 2864 * listed in the `source` field. The values from the input links are merged 2865 * depending on the method specified in the `linkMerge` field. If not 2866 * specified, the default method is "merge_nested". 2867 * * **merge_nested** 2868 * The input must be an array consisting of exactly one entry for each 2869 * input link. If "merge_nested" is specified with a single link, the value 2870 * from the link must be wrapped in a single-item list. 2871 * * **merge_flattened** 2872 * 1. The source and sink parameters must be compatible types, or the source 2873 * type must be compatible with single element from the "items" type of 2874 * the destination array parameter. 2875 * 2. Source parameters which are arrays are concatenated. 2876 * Source parameters which are single element types are appended as 2877 * single elements. 2878 */ 2879 class WorkflowStepInput : SchemaBase 2880 { 2881 /** 2882 * The unique identifier for this object. 2883 */ 2884 @id Either!(None, string) id_; 2885 /** 2886 * Specifies one or more workflow parameters that will provide input to 2887 * the underlying step parameter. 2888 */ 2889 @link Either!(None, string, string[]) source_; 2890 /** 2891 * The method to use to merge multiple inbound links into a single array. 2892 * If not specified, the default method is "merge_nested". 2893 */ 2894 Either!(None, LinkMergeMethod) linkMerge_; 2895 /** 2896 * Only valid when `type: File` or is an array of `items: File`. 2897 * Read up to the first 64 KiB of text from the file and place it in the 2898 * "contents" field of the file object for use by expressions. 2899 */ 2900 Either!(None, bool) loadContents_; 2901 /** 2902 * Only valid when `type: Directory` or is an array of `items: Directory`. 2903 * Specify the desired behavior for loading the `listing` field of 2904 * a Directory object for use by expressions. 2905 * The order of precedence for loadListing is: 2906 * 1. `loadListing` on an individual parameter 2907 * 2. Inherited from `LoadListingRequirement` 2908 * 3. By default: `no_listing` 2909 */ 2910 Either!(None, LoadListingEnum) loadListing_; 2911 /** 2912 * A short, human-readable label of this object. 2913 */ 2914 Either!(None, string) label_; 2915 /** 2916 * The default value for this parameter to use if either there is no 2917 * `source` field, or the value produced by the `source` is `null`. The 2918 * default must be applied prior to scattering or evaluating `valueFrom`. 2919 */ 2920 Either!(None, File, Directory, Any) default_; 2921 /** 2922 * To use valueFrom, [StepInputExpressionRequirement](#StepInputExpressionRequirement) must 2923 * be specified in the workflow or workflow step requirements. 2924 * If `valueFrom` is a constant string value, use this as the value for 2925 * this input parameter. 2926 * If `valueFrom` is a parameter reference or expression, it must be 2927 * evaluated to yield the actual value to be assiged to the input field. 2928 * The `self` value in the parameter reference or expression must be 2929 * 1. `null` if there is no `source` field 2930 * 2. the value of the parameter(s) specified in the `source` field when this 2931 * workflow input parameter **is not** specified in this workflow step's `scatter` field. 2932 * 3. an element of the parameter specified in the `source` field when this workflow input 2933 * parameter **is** specified in this workflow step's `scatter` field. 2934 * The value of `inputs` in the parameter reference or expression must be 2935 * the input object to the workflow step after assigning the `source` 2936 * values, applying `default`, and then scattering. The order of 2937 * evaluating `valueFrom` among step input parameters is undefined and the 2938 * result of evaluating `valueFrom` on a parameter must not be visible to 2939 * evaluation of `valueFrom` on other parameters. 2940 */ 2941 Either!(None, string, Expression) valueFrom_; 2942 2943 mixin genCtor; 2944 mixin genIdentifier; 2945 mixin genDumper; 2946 } 2947 2948 /** 2949 * Associate an output parameter of the underlying process with a workflow 2950 * parameter. The workflow parameter (given in the `id` field) be may be used 2951 * as a `source` to connect with input parameters of other workflow steps, or 2952 * with an output parameter of the process. 2953 * A unique identifier for this workflow output parameter. This is 2954 * the identifier to use in the `source` field of `WorkflowStepInput` 2955 * to connect the output value to downstream parameters. 2956 */ 2957 class WorkflowStepOutput : SchemaBase 2958 { 2959 /** 2960 * The unique identifier for this object. 2961 */ 2962 @id Either!(None, string) id_; 2963 2964 mixin genCtor; 2965 mixin genIdentifier; 2966 mixin genDumper; 2967 } 2968 2969 /** 2970 * The scatter method, as described in [workflow step scatter](#WorkflowStep). 2971 */ 2972 class ScatterMethod : SchemaBase 2973 { 2974 enum Symbol 2975 { 2976 s0 = "dotproduct", 2977 s1 = "nested_crossproduct", 2978 s2 = "flat_crossproduct" 2979 } 2980 2981 Symbol value; 2982 2983 mixin genCtor; 2984 mixin genOpEq; 2985 mixin genDumper; 2986 } 2987 2988 /** 2989 * A workflow step is an executable element of a workflow. It specifies the 2990 * underlying process implementation (such as `CommandLineTool` or another 2991 * `Workflow`) in the `run` field and connects the input and output parameters 2992 * of the underlying process to workflow parameters. 2993 * # Scatter/gather 2994 * To use scatter/gather, 2995 * [ScatterFeatureRequirement](#ScatterFeatureRequirement) must be specified 2996 * in the workflow or workflow step requirements. 2997 * A "scatter" operation specifies that the associated workflow step or 2998 * subworkflow should execute separately over a list of input elements. Each 2999 * job making up a scatter operation is independent and may be executed 3000 * concurrently. 3001 * The `scatter` field specifies one or more input parameters which will be 3002 * scattered. An input parameter may be listed more than once. The declared 3003 * type of each input parameter is implicitly becomes an array of items of the 3004 * input parameter type. If a parameter is listed more than once, it becomes 3005 * a nested array. As a result, upstream parameters which are connected to 3006 * scattered parameters must be arrays. 3007 * All output parameter types are also implicitly wrapped in arrays. Each job 3008 * in the scatter results in an entry in the output array. 3009 * If any scattered parameter runtime value is an empty array, all outputs are 3010 * set to empty arrays and no work is done for the step, according to 3011 * applicable scattering rules. 3012 * If `scatter` declares more than one input parameter, `scatterMethod` 3013 * describes how to decompose the input into a discrete set of jobs. 3014 * * **dotproduct** specifies that each of the input arrays are aligned and one 3015 * element taken from each array to construct each job. It is an error 3016 * if all input arrays are not the same length. 3017 * * **nested_crossproduct** specifies the Cartesian product of the inputs, 3018 * producing a job for every combination of the scattered inputs. The 3019 * output must be nested arrays for each level of scattering, in the 3020 * order that the input arrays are listed in the `scatter` field. 3021 * * **flat_crossproduct** specifies the Cartesian product of the inputs, 3022 * producing a job for every combination of the scattered inputs. The 3023 * output arrays must be flattened to a single level, but otherwise listed in the 3024 * order that the input arrays are listed in the `scatter` field. 3025 * # Subworkflows 3026 * To specify a nested workflow as part of a workflow step, 3027 * [SubworkflowFeatureRequirement](#SubworkflowFeatureRequirement) must be 3028 * specified in the workflow or workflow step requirements. 3029 * It is a fatal error if a workflow directly or indirectly invokes itself as 3030 * a subworkflow (recursive workflows are not allowed). 3031 */ 3032 class WorkflowStep : SchemaBase 3033 { 3034 /** 3035 * The unique identifier for this object. 3036 */ 3037 @id Either!(None, string) id_; 3038 /** 3039 * A short, human-readable label of this object. 3040 */ 3041 Either!(None, string) label_; 3042 /** 3043 * A documentation string for this object, or an array of strings which should be concatenated. 3044 */ 3045 Either!(None, string, string[]) doc_; 3046 /** 3047 * Defines the input parameters of the workflow step. The process is ready to 3048 * run when all required input parameters are associated with concrete 3049 * values. Input parameters include a schema for each parameter which is 3050 * used to validate the input object. It may also be used build a user 3051 * interface for constructing the input object. 3052 */ 3053 @idMap("id", "source") WorkflowStepInput[] in_; 3054 /** 3055 * Defines the parameters representing the output of the process. May be 3056 * used to generate and/or validate the output object. 3057 */ 3058 @link Either!(Either!(string, WorkflowStepOutput)[]) out_; 3059 /** 3060 * Declares requirements that apply to either the runtime environment or the 3061 * workflow engine that must be met in order to execute this workflow step. If 3062 * an implementation cannot satisfy all requirements, or a requirement is 3063 * listed which is not recognized by the implementation, it is a fatal 3064 * error and the implementation must not attempt to run the process, 3065 * unless overridden at user option. 3066 */ 3067 @idMap("class") Either!(None, Either!(InlineJavascriptRequirement, SchemaDefRequirement, LoadListingRequirement, DockerRequirement, SoftwareRequirement, InitialWorkDirRequirement, EnvVarRequirement, ShellCommandRequirement, ResourceRequirement, WorkReuse, NetworkAccess, InplaceUpdateRequirement, ToolTimeLimit, SubworkflowFeatureRequirement, ScatterFeatureRequirement, MultipleInputFeatureRequirement, StepInputExpressionRequirement)[]) requirements_; 3068 /** 3069 * Declares hints applying to either the runtime environment or the 3070 * workflow engine that may be helpful in executing this workflow step. It is 3071 * not an error if an implementation cannot satisfy all hints, however 3072 * the implementation may report a warning. 3073 */ 3074 @idMap("class") Either!(None, Any[]) hints_; 3075 /** 3076 * Specifies the process to run. 3077 */ 3078 @link Either!(string, CommandLineTool, ExpressionTool, Workflow) run_; 3079 /// 3080 @link Either!(None, string, string[]) scatter_; 3081 /** 3082 * Required if `scatter` is an array of more than one element. 3083 */ 3084 Either!(None, ScatterMethod) scatterMethod_; 3085 3086 mixin genCtor; 3087 mixin genIdentifier; 3088 mixin genDumper; 3089 } 3090 3091 /** 3092 * A workflow describes a set of **steps** and the **dependencies** between 3093 * those steps. When a step produces output that will be consumed by a 3094 * second step, the first step is a dependency of the second step. 3095 * When there is a dependency, the workflow engine must execute the preceding 3096 * step and wait for it to successfully produce output before executing the 3097 * dependent step. If two steps are defined in the workflow graph that 3098 * are not directly or indirectly dependent, these steps are **independent**, 3099 * and may execute in any order or execute concurrently. A workflow is 3100 * complete when all steps have been executed. 3101 * Dependencies between parameters are expressed using the `source` field on 3102 * [workflow step input parameters](#WorkflowStepInput) and [workflow output 3103 * parameters](#WorkflowOutputParameter). 3104 * The `source` field expresses the dependency of one parameter on another 3105 * such that when a value is associated with the parameter specified by 3106 * `source`, that value is propagated to the destination parameter. When all 3107 * data links inbound to a given step are fufilled, the step is ready to 3108 * execute. 3109 * ## Workflow success and failure 3110 * A completed step must result in one of `success`, `temporaryFailure` or 3111 * `permanentFailure` states. An implementation may choose to retry a step 3112 * execution which resulted in `temporaryFailure`. An implementation may 3113 * choose to either continue running other steps of a workflow, or terminate 3114 * immediately upon `permanentFailure`. 3115 * * If any step of a workflow execution results in `permanentFailure`, then 3116 * the workflow status is `permanentFailure`. 3117 * * If one or more steps result in `temporaryFailure` and all other steps 3118 * complete `success` or are not executed, then the workflow status is 3119 * `temporaryFailure`. 3120 * * If all workflow steps are executed and complete with `success`, then the 3121 * workflow status is `success`. 3122 * # Extensions 3123 * [ScatterFeatureRequirement](#ScatterFeatureRequirement) and 3124 * [SubworkflowFeatureRequirement](#SubworkflowFeatureRequirement) are 3125 * available as standard [extensions](#Extensions_and_Metadata) to core 3126 * workflow semantics. 3127 */ 3128 @documentRoot class Workflow : SchemaBase 3129 { 3130 /** 3131 * The unique identifier for this object. 3132 */ 3133 @id Either!(None, string) id_; 3134 /** 3135 * A short, human-readable label of this object. 3136 */ 3137 Either!(None, string) label_; 3138 /** 3139 * A documentation string for this object, or an array of strings which should be concatenated. 3140 */ 3141 Either!(None, string, string[]) doc_; 3142 /** 3143 * Defines the input parameters of the process. The process is ready to 3144 * run when all required input parameters are associated with concrete 3145 * values. Input parameters include a schema for each parameter which is 3146 * used to validate the input object. It may also be used to build a user 3147 * interface for constructing the input object. 3148 * When accepting an input object, all input parameters must have a value. 3149 * If an input parameter is missing from the input object, it must be 3150 * assigned a value of `null` (or the value of `default` for that 3151 * parameter, if provided) for the purposes of validation and evaluation 3152 * of expressions. 3153 */ 3154 @idMap("id", "type") WorkflowInputParameter[] inputs_; 3155 /** 3156 * Defines the parameters representing the output of the process. May be 3157 * used to generate and/or validate the output object. 3158 */ 3159 @idMap("id", "type") WorkflowOutputParameter[] outputs_; 3160 /** 3161 * Declares requirements that apply to either the runtime environment or the 3162 * workflow engine that must be met in order to execute this process. If 3163 * an implementation cannot satisfy all requirements, or a requirement is 3164 * listed which is not recognized by the implementation, it is a fatal 3165 * error and the implementation must not attempt to run the process, 3166 * unless overridden at user option. 3167 */ 3168 @idMap("class") Either!(None, Either!(InlineJavascriptRequirement, SchemaDefRequirement, LoadListingRequirement, DockerRequirement, SoftwareRequirement, InitialWorkDirRequirement, EnvVarRequirement, ShellCommandRequirement, ResourceRequirement, WorkReuse, NetworkAccess, InplaceUpdateRequirement, ToolTimeLimit, SubworkflowFeatureRequirement, ScatterFeatureRequirement, MultipleInputFeatureRequirement, StepInputExpressionRequirement)[]) requirements_; 3169 /** 3170 * Declares hints applying to either the runtime environment or the 3171 * workflow engine that may be helpful in executing this process. It is 3172 * not an error if an implementation cannot satisfy all hints, however 3173 * the implementation may report a warning. 3174 */ 3175 @idMap("class") Either!(None, Either!(InlineJavascriptRequirement, SchemaDefRequirement, LoadListingRequirement, DockerRequirement, SoftwareRequirement, InitialWorkDirRequirement, EnvVarRequirement, ShellCommandRequirement, ResourceRequirement, WorkReuse, NetworkAccess, InplaceUpdateRequirement, ToolTimeLimit, SubworkflowFeatureRequirement, ScatterFeatureRequirement, MultipleInputFeatureRequirement, StepInputExpressionRequirement, Any)[]) hints_; 3176 /** 3177 * CWL document version. Always required at the document root. Not 3178 * required for a Process embedded inside another Process. 3179 */ 3180 Either!(None, CWLVersion) cwlVersion_; 3181 /// 3182 static immutable class_ = "Workflow"; 3183 /** 3184 * The individual steps that make up the workflow. Each step is executed when all of its 3185 * input data links are fufilled. An implementation may choose to execute 3186 * the steps in a different order than listed and/or execute steps 3187 * concurrently, provided that dependencies between steps are met. 3188 */ 3189 @idMap("id") Either!(WorkflowStep[]) steps_; 3190 3191 mixin genCtor; 3192 mixin genIdentifier; 3193 mixin genDumper; 3194 } 3195 3196 /** 3197 * Indicates that the workflow platform must support nested workflows in 3198 * the `run` field of [WorkflowStep](#WorkflowStep). 3199 */ 3200 class SubworkflowFeatureRequirement : SchemaBase 3201 { 3202 /** 3203 * Always 'SubworkflowFeatureRequirement' 3204 */ 3205 static immutable class_ = "SubworkflowFeatureRequirement"; 3206 3207 mixin genCtor; 3208 mixin genIdentifier; 3209 mixin genDumper; 3210 } 3211 3212 /** 3213 * Indicates that the workflow platform must support the `scatter` and 3214 * `scatterMethod` fields of [WorkflowStep](#WorkflowStep). 3215 */ 3216 class ScatterFeatureRequirement : SchemaBase 3217 { 3218 /** 3219 * Always 'ScatterFeatureRequirement' 3220 */ 3221 static immutable class_ = "ScatterFeatureRequirement"; 3222 3223 mixin genCtor; 3224 mixin genIdentifier; 3225 mixin genDumper; 3226 } 3227 3228 /** 3229 * Indicates that the workflow platform must support multiple inbound data links 3230 * listed in the `source` field of [WorkflowStepInput](#WorkflowStepInput). 3231 */ 3232 class MultipleInputFeatureRequirement : SchemaBase 3233 { 3234 /** 3235 * Always 'MultipleInputFeatureRequirement' 3236 */ 3237 static immutable class_ = "MultipleInputFeatureRequirement"; 3238 3239 mixin genCtor; 3240 mixin genIdentifier; 3241 mixin genDumper; 3242 } 3243 3244 /** 3245 * Indicate that the workflow platform must support the `valueFrom` field 3246 * of [WorkflowStepInput](#WorkflowStepInput). 3247 */ 3248 class StepInputExpressionRequirement : SchemaBase 3249 { 3250 /** 3251 * Always 'StepInputExpressionRequirement' 3252 */ 3253 static immutable class_ = "StepInputExpressionRequirement"; 3254 3255 mixin genCtor; 3256 mixin genIdentifier; 3257 mixin genDumper; 3258 } 3259 3260 /// 3261 alias DocumentRootType = Either!(CommandLineTool, ExpressionTool, Workflow); 3262 3263 /// 3264 alias importFromURI = import_!DocumentRootType; 3265 3266 @("Test for generated parser") 3267 unittest 3268 { 3269 import std : dirEntries, SpanMode; 3270 3271 auto resourceDir = "resources/cwl-v1.1"; 3272 foreach (file; dirEntries(resourceDir, SpanMode.depth)) 3273 { 3274 import std : assertNotThrown, baseName, format, startsWith; 3275 import salad.resolver : absoluteURI; 3276 3277 if (!file.baseName.startsWith("valid")) 3278 { 3279 continue; 3280 } 3281 importFromURI(file.absoluteURI).assertNotThrown(format!"Failed to load %s"(file)); 3282 } 3283 }