• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

common-workflow-language / cwljava / #421

16 Dec 2025 08:00PM UTC coverage: 57.962% (-0.01%) from 57.972%
#421

Pull #218

github

web-flow
Merge 0d5009150 into 4d3285bc2
Pull Request #218: "id" is a required field in for `Parameter`s and `WorkflowStep`s

23 of 43 new or added lines in 12 files covered. (53.49%)

10 existing lines in 10 files now uncovered.

7735 of 13345 relevant lines covered (57.96%)

0.58 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

46.32
/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowOutputParameterImpl.java
1
// Copyright Common Workflow Language project contributors
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
//      http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14

15
package org.commonwl.cwlsdk.cwl1_2;
16

17
import org.commonwl.cwlsdk.cwl1_2.utils.LoaderInstances;
18
import org.commonwl.cwlsdk.cwl1_2.utils.LoadingOptions;
19
import org.commonwl.cwlsdk.cwl1_2.utils.LoadingOptionsBuilder;
20
import org.commonwl.cwlsdk.cwl1_2.utils.SaveableImpl;
21
import org.commonwl.cwlsdk.cwl1_2.utils.ValidationException;
22

23
/**
24
* Auto-generated class implementation for <I>https://w3id.org/cwl/cwl#WorkflowOutputParameter</I><BR> <BLOCKQUOTE>
25
 Describe an output parameter of a workflow.  The parameter must be
26
 connected to one or more parameters defined in the workflow that
27
 will provide the value of the output parameter. It is legal to
28
 connect a WorkflowInputParameter to a WorkflowOutputParameter.
29
 
30
 See [WorkflowStepInput](#WorkflowStepInput) for discussion of
31
 `linkMerge` and `pickValue`.
32
  </BLOCKQUOTE>
33
 */
34
public class WorkflowOutputParameterImpl extends SaveableImpl implements WorkflowOutputParameter {
35
  private LoadingOptions loadingOptions_ = new LoadingOptionsBuilder().build();
1✔
36
  private java.util.Map<String, Object> extensionFields_ =
1✔
37
      new java.util.HashMap<String, Object>();
38
  public LoadingOptions getLoadingOptions() {
39
    return this.loadingOptions_;
×
40
  }
41
  public java.util.Map<String, Object> getExtensionFields() {
42
    return this.extensionFields_;
×
43
  }
44

45
  private String id;
46

47
  /**
48
   * Getter for property <I>https://w3id.org/cwl/cwl#Parameter/id</I><BR>
49
   * <BLOCKQUOTE>
50
   * The unique identifier for this Parameter.   * </BLOCKQUOTE>
51
   */
52

53
  public String getId() {
54
    return this.id;
×
55
  }
56

57
  private java.util.Optional<String> label;
58

59
  /**
60
   * Getter for property <I>https://w3id.org/cwl/cwl#Labeled/label</I><BR>
61
   * <BLOCKQUOTE>
62
   * A short, human-readable label of this object.   * </BLOCKQUOTE>
63
   */
64

65
  public java.util.Optional<String> getLabel() {
66
    return this.label;
×
67
  }
68

69
  private Object secondaryFiles;
70

71
  /**
72
   * Getter for property <I>https://w3id.org/cwl/cwl#secondaryFiles</I><BR>
73
   * <BLOCKQUOTE>
74
   * Only valid when `type: File` or is an array of `items: File`.
75
   * 
76
   * Provides a pattern or expression specifying files or
77
   * directories that should be included alongside the primary
78
   * file.  Secondary files may be required or optional.  When not
79
   * explicitly specified, secondary files specified for `inputs`
80
   * are required and `outputs` are optional.  An implementation
81
   * must include matching Files and Directories in the
82
   * `secondaryFiles` property of the primary file.  These Files
83
   * and Directories must be transferred and staged alongside the
84
   * primary file.  An implementation may fail workflow execution
85
   * if a required secondary file does not exist.
86
   * 
87
   * If the value is an expression, the value of `self` in the expression
88
   * must be the primary input or output File object to which this binding
89
   * applies.  The `basename`, `nameroot` and `nameext` fields must be
90
   * present in `self`.  For `CommandLineTool` outputs the `path` field must
91
   * also be present.  The expression must return a filename string relative
92
   * to the path to the primary File, a File or Directory object with either
93
   * `path` or `location` and `basename` fields set, or an array consisting
94
   * of strings or File or Directory objects.  It is legal to reference an
95
   * unchanged File or Directory object taken from input as a secondaryFile.
96
   * The expression may return &quot;null&quot; in which case there is no secondaryFile
97
   * from that expression.
98
   * 
99
   * To work on non-filename-preserving storage systems, portable tool
100
   * descriptions should avoid constructing new values from `location`, but
101
   * should construct relative references using `basename` or `nameroot`
102
   * instead.
103
   * 
104
   * If a value in `secondaryFiles` is a string that is not an expression,
105
   * it specifies that the following pattern should be applied to the path
106
   * of the primary file to yield a filename relative to the primary File:
107
   * 
108
   *   1. If string ends with `?` character, remove the last `?` and mark
109
   *     the resulting secondary file as optional.
110
   *   2. If string begins with one or more caret `^` characters, for each
111
   *     caret, remove the last file extension from the path (the last
112
   *     period `.` and all following characters).  If there are no file
113
   *     extensions, the path is unchanged.
114
   *   3. Append the remainder of the string to the end of the file path.
115
   *    * </BLOCKQUOTE>
116
   */
117

118
  public Object getSecondaryFiles() {
119
    return this.secondaryFiles;
×
120
  }
121

122
  private java.util.Optional<Boolean> streamable;
123

124
  /**
125
   * Getter for property <I>https://w3id.org/cwl/cwl#FieldBase/streamable</I><BR>
126
   * <BLOCKQUOTE>
127
   * Only valid when `type: File` or is an array of `items: File`.
128
   * 
129
   * A value of `true` indicates that the file is read or written
130
   * sequentially without seeking.  An implementation may use this flag to
131
   * indicate whether it is valid to stream file contents using a named
132
   * pipe.  Default: `false`.
133
   *    * </BLOCKQUOTE>
134
   */
135

136
  public java.util.Optional<Boolean> getStreamable() {
137
    return this.streamable;
×
138
  }
139

140
  private Object doc;
141

142
  /**
143
   * Getter for property <I>https://w3id.org/cwl/salad#Documented/doc</I><BR>
144
   * <BLOCKQUOTE>
145
   * A documentation string for this object, or an array of strings which should be concatenated.   * </BLOCKQUOTE>
146
   */
147

148
  public Object getDoc() {
149
    return this.doc;
×
150
  }
151

152
  private Object format;
153

154
  /**
155
   * Getter for property <I>https://w3id.org/cwl/cwl#format</I><BR>
156
   * <BLOCKQUOTE>
157
   * Only valid when `type: File` or is an array of `items: File`.
158
   * 
159
   * This is the file format that will be assigned to the output
160
   * File object.
161
   *    * </BLOCKQUOTE>
162
   */
163

164
  public Object getFormat() {
165
    return this.format;
×
166
  }
167

168
  private Object outputSource;
169

170
  /**
171
   * Getter for property <I>https://w3id.org/cwl/cwl#outputSource</I><BR>
172
   * <BLOCKQUOTE>
173
   * Specifies one or more names of an output from a workflow step (in the form
174
   * `step_name/output_name` with a `/` separator`), or a workflow input name,
175
   * that supply their value(s) to the output parameter.
176
   * the output parameter.  It is valid to reference workflow level inputs
177
   * here.
178
   *    * </BLOCKQUOTE>
179
   */
180

181
  public Object getOutputSource() {
182
    return this.outputSource;
×
183
  }
184

185
  private java.util.Optional<LinkMergeMethod> linkMerge;
186

187
  /**
188
   * Getter for property <I>https://w3id.org/cwl/cwl#WorkflowOutputParameter/linkMerge</I><BR>
189
   * <BLOCKQUOTE>
190
   * The method to use to merge multiple sources into a single array.
191
   * If not specified, the default method is &quot;merge_nested&quot;.
192
   *    * </BLOCKQUOTE>
193
   */
194

195
  public java.util.Optional<LinkMergeMethod> getLinkMerge() {
196
    return this.linkMerge;
×
197
  }
198

199
  private java.util.Optional<PickValueMethod> pickValue;
200

201
  /**
202
   * Getter for property <I>https://w3id.org/cwl/cwl#WorkflowOutputParameter/pickValue</I><BR>
203
   * <BLOCKQUOTE>
204
   * The method to use to choose non-null elements among multiple sources.
205
   *    * </BLOCKQUOTE>
206
   */
207

208
  public java.util.Optional<PickValueMethod> getPickValue() {
209
    return this.pickValue;
×
210
  }
211

212
  private Object type;
213

214
  /**
215
   * Getter for property <I>https://w3id.org/cwl/salad#type</I><BR>
216
   * <BLOCKQUOTE>
217
   * Specify valid types of data that may be assigned to this parameter.
218
   *    * </BLOCKQUOTE>
219
   */
220

221
  public Object getType() {
222
    return this.type;
×
223
  }
224

225
  /**
226
   * Used by {@link org.commonwl.cwlsdk.cwl1_2.utils.RootLoader} to construct instances of WorkflowOutputParameterImpl.
227
   *
228
   * @param __doc_            Document fragment to load this record object from (presumably a
229
                              {@link java.util.Map}).
230
   * @param __baseUri_        Base URI to generate child document IDs against.
231
   * @param __loadingOptions  Context for loading URIs and populating objects.
232
   * @param __docRoot_        ID at this position in the document (if available) (maybe?)
233
   * @throws ValidationException If the document fragment is not a {@link java.util.Map}
234
   *                             or validation of fields fails.
235
   */
236
  public WorkflowOutputParameterImpl(
237
      final Object __doc_,
238
      final String __baseUri_,
239
      LoadingOptions __loadingOptions,
240
      final String __docRoot_) {
241
    super(__doc_, __baseUri_, __loadingOptions, __docRoot_);
1✔
242
    // Prefix plumbing variables with '__' to reduce likelihood of collision with
243
    // generated names.
244
    String __baseUri = __baseUri_;
1✔
245
    String __docRoot = __docRoot_;
1✔
246
    if (!(__doc_ instanceof java.util.Map)) {
1✔
247
      throw new ValidationException("WorkflowOutputParameterImpl called on non-map");
×
248
    }
249
    final java.util.Map<String, Object> __doc = (java.util.Map<String, Object>) __doc_;
1✔
250
    final java.util.List<ValidationException> __errors =
1✔
251
        new java.util.ArrayList<ValidationException>();
252
    if (__loadingOptions != null) {
1✔
253
      this.loadingOptions_ = __loadingOptions;
1✔
254
    }
255
    String id;
256

257
    if (__doc.containsKey("id")) {
1✔
258
      try {
259
        id =
1✔
260
            LoaderInstances
261
                .uri_StringInstance_True_False_None_None
262
                .loadField(__doc.get("id"), __baseUri, __loadingOptions);
1✔
263
      } catch (ValidationException e) {
×
264
        id = null; // won't be used but prevents compiler from complaining.
×
265
        final String __message = "the `id` field is not valid because:";
×
266
        __errors.add(new ValidationException(__message, e));
×
267
      }
1✔
268

269
    } else {
270
      id = null;
×
271
    }
272

273
    if (id == null) {
1✔
UNCOV
274
      if (__docRoot != null) {
×
NEW
275
        id = __docRoot;
×
276
      } else {
NEW
277
        throw new ValidationException("Missing id");
×
278
      }
279
    }
280
    __baseUri = (String) id;
1✔
281
    java.util.Optional<String> label;
282

283
    if (__doc.containsKey("label")) {
1✔
284
      try {
285
        label =
×
286
            LoaderInstances
287
                .optional_StringInstance
288
                .loadField(__doc.get("label"), __baseUri, __loadingOptions);
×
289
      } catch (ValidationException e) {
×
290
        label = null; // won't be used but prevents compiler from complaining.
×
291
        final String __message = "the `label` field is not valid because:";
×
292
        __errors.add(new ValidationException(__message, e));
×
293
      }
×
294

295
    } else {
296
      label = null;
1✔
297
    }
298
    Object secondaryFiles;
299

300
    if (__doc.containsKey("secondaryFiles")) {
1✔
301
      try {
302
        secondaryFiles =
×
303
            LoaderInstances
304
                .secondaryfilesdsl_union_of_NullInstance_or_SecondaryFileSchema_or_array_of_SecondaryFileSchema
305
                .loadField(__doc.get("secondaryFiles"), __baseUri, __loadingOptions);
×
306
      } catch (ValidationException e) {
×
307
        secondaryFiles = null; // won't be used but prevents compiler from complaining.
×
308
        final String __message = "the `secondaryFiles` field is not valid because:";
×
309
        __errors.add(new ValidationException(__message, e));
×
310
      }
×
311

312
    } else {
313
      secondaryFiles = null;
1✔
314
    }
315
    java.util.Optional<Boolean> streamable;
316

317
    if (__doc.containsKey("streamable")) {
1✔
318
      try {
319
        streamable =
×
320
            LoaderInstances
321
                .optional_BooleanInstance
322
                .loadField(__doc.get("streamable"), __baseUri, __loadingOptions);
×
323
      } catch (ValidationException e) {
×
324
        streamable = null; // won't be used but prevents compiler from complaining.
×
325
        final String __message = "the `streamable` field is not valid because:";
×
326
        __errors.add(new ValidationException(__message, e));
×
327
      }
×
328

329
    } else {
330
      streamable = null;
1✔
331
    }
332
    Object doc;
333

334
    if (__doc.containsKey("doc")) {
1✔
335
      try {
336
        doc =
1✔
337
            LoaderInstances
338
                .union_of_NullInstance_or_StringInstance_or_array_of_StringInstance
339
                .loadField(__doc.get("doc"), __baseUri, __loadingOptions);
1✔
340
      } catch (ValidationException e) {
×
341
        doc = null; // won't be used but prevents compiler from complaining.
×
342
        final String __message = "the `doc` field is not valid because:";
×
343
        __errors.add(new ValidationException(__message, e));
×
344
      }
1✔
345

346
    } else {
347
      doc = null;
1✔
348
    }
349
    Object format;
350

351
    if (__doc.containsKey("format")) {
1✔
352
      try {
353
        format =
×
354
            LoaderInstances
355
                .uri_union_of_NullInstance_or_StringInstance_or_ExpressionLoader_True_False_None_True
356
                .loadField(__doc.get("format"), __baseUri, __loadingOptions);
×
357
      } catch (ValidationException e) {
×
358
        format = null; // won't be used but prevents compiler from complaining.
×
359
        final String __message = "the `format` field is not valid because:";
×
360
        __errors.add(new ValidationException(__message, e));
×
361
      }
×
362

363
    } else {
364
      format = null;
1✔
365
    }
366
    Object outputSource;
367

368
    if (__doc.containsKey("outputSource")) {
1✔
369
      try {
370
        outputSource =
1✔
371
            LoaderInstances
372
                .uri_union_of_NullInstance_or_StringInstance_or_array_of_StringInstance_False_False_1_None
373
                .loadField(__doc.get("outputSource"), __baseUri, __loadingOptions);
1✔
374
      } catch (ValidationException e) {
×
375
        outputSource = null; // won't be used but prevents compiler from complaining.
×
376
        final String __message = "the `outputSource` field is not valid because:";
×
377
        __errors.add(new ValidationException(__message, e));
×
378
      }
1✔
379

380
    } else {
381
      outputSource = null;
1✔
382
    }
383
    java.util.Optional<LinkMergeMethod> linkMerge;
384

385
    if (__doc.containsKey("linkMerge")) {
1✔
386
      try {
387
        linkMerge =
1✔
388
            LoaderInstances
389
                .optional_LinkMergeMethod
390
                .loadField(__doc.get("linkMerge"), __baseUri, __loadingOptions);
1✔
391
      } catch (ValidationException e) {
×
392
        linkMerge = null; // won't be used but prevents compiler from complaining.
×
393
        final String __message = "the `linkMerge` field is not valid because:";
×
394
        __errors.add(new ValidationException(__message, e));
×
395
      }
1✔
396

397
    } else {
398
      linkMerge = null;
1✔
399
    }
400
    java.util.Optional<PickValueMethod> pickValue;
401

402
    if (__doc.containsKey("pickValue")) {
1✔
403
      try {
404
        pickValue =
1✔
405
            LoaderInstances
406
                .optional_PickValueMethod
407
                .loadField(__doc.get("pickValue"), __baseUri, __loadingOptions);
1✔
408
      } catch (ValidationException e) {
×
409
        pickValue = null; // won't be used but prevents compiler from complaining.
×
410
        final String __message = "the `pickValue` field is not valid because:";
×
411
        __errors.add(new ValidationException(__message, e));
×
412
      }
1✔
413

414
    } else {
415
      pickValue = null;
1✔
416
    }
417
    Object type;
418
    try {
419
      type =
1✔
420
          LoaderInstances
421
              .typedsl_union_of_CWLType_or_OutputRecordSchema_or_OutputEnumSchema_or_OutputArraySchema_or_StringInstance_or_array_of_union_of_CWLType_or_OutputRecordSchema_or_OutputEnumSchema_or_OutputArraySchema_or_StringInstance_2
422
              .loadField(__doc.get("type"), __baseUri, __loadingOptions);
1✔
423
    } catch (ValidationException e) {
×
424
      type = null; // won't be used but prevents compiler from complaining.
×
425
      final String __message = "the `type` field is not valid because:";
×
426
      __errors.add(new ValidationException(__message, e));
×
427
    }
1✔
428
    if (!__errors.isEmpty()) {
1✔
429
      throw new ValidationException("Trying 'RecordField'", __errors);
×
430
    }
431
    this.label = (java.util.Optional<String>) label;
1✔
432
    this.secondaryFiles = (Object) secondaryFiles;
1✔
433
    this.streamable = (java.util.Optional<Boolean>) streamable;
1✔
434
    this.doc = (Object) doc;
1✔
435
    this.id = (String) id;
1✔
436
    this.format = (Object) format;
1✔
437
    this.outputSource = (Object) outputSource;
1✔
438
    this.linkMerge = (java.util.Optional<LinkMergeMethod>) linkMerge;
1✔
439
    this.pickValue = (java.util.Optional<PickValueMethod>) pickValue;
1✔
440
    this.type = (Object) type;
1✔
441
    for (String field:__doc.keySet()) {
1✔
442
      if (!attrs.contains(field)) {
1✔
443
        if (field.contains(":")) {
×
444
          String expanded_field = __loadingOptions.expandUrl(field, "", false, false, null);
×
445
          extensionFields_.put(expanded_field, __doc.get(field));
×
446
        }
447
      }
448
    }
1✔
449
  }
1✔
450
  private java.util.List<String> attrs = java.util.Arrays.asList("label", "secondaryFiles", "streamable", "doc", "id", "format", "outputSource", "linkMerge", "pickValue", "type");
1✔
451
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc