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

common-workflow-language / cwljava / #394

31 Oct 2025 04:10PM UTC coverage: 57.972% (-1.6%) from 59.538%
#394

push

github

mr-c
rename package to a namespace that we control

7575 of 12994 new or added lines in 261 files covered. (58.3%)

7752 of 13372 relevant lines covered (57.97%)

0.58 hits per line

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

57.89
/src/main/java/org/commonwl/cwlsdk/cwl1_1/WorkflowImpl.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_1;
16

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

23
/**
24
* Auto-generated class implementation for <I>https://w3id.org/cwl/cwl#Workflow</I><BR> <BLOCKQUOTE>
25
 A workflow describes a set of **steps** and the **dependencies** between
26
 those steps.  When a step produces output that will be consumed by a
27
 second step, the first step is a dependency of the second step.
28
 
29
 When there is a dependency, the workflow engine must execute the preceding
30
 step and wait for it to successfully produce output before executing the
31
 dependent step.  If two steps are defined in the workflow graph that
32
 are not directly or indirectly dependent, these steps are **independent**,
33
 and may execute in any order or execute concurrently.  A workflow is
34
 complete when all steps have been executed.
35
 
36
 Dependencies between parameters are expressed using the `source` field on
37
 [workflow step input parameters](#WorkflowStepInput) and [workflow output
38
 parameters](#WorkflowOutputParameter).
39
 
40
 The `source` field expresses the dependency of one parameter on another
41
 such that when a value is associated with the parameter specified by
42
 `source`, that value is propagated to the destination parameter.  When all
43
 data links inbound to a given step are fufilled, the step is ready to
44
 execute.
45
 
46
 ## Workflow success and failure
47
 
48
 A completed step must result in one of `success`, `temporaryFailure` or
49
 `permanentFailure` states.  An implementation may choose to retry a step
50
 execution which resulted in `temporaryFailure`.  An implementation may
51
 choose to either continue running other steps of a workflow, or terminate
52
 immediately upon `permanentFailure`.
53
 
54
 * If any step of a workflow execution results in `permanentFailure`, then
55
 the workflow status is `permanentFailure`.
56
 
57
 * If one or more steps result in `temporaryFailure` and all other steps
58
 complete `success` or are not executed, then the workflow status is
59
 `temporaryFailure`.
60
 
61
 * If all workflow steps are executed and complete with `success`, then the
62
 workflow status is `success`.
63
 
64
 # Extensions
65
 
66
 [ScatterFeatureRequirement](#ScatterFeatureRequirement) and
67
 [SubworkflowFeatureRequirement](#SubworkflowFeatureRequirement) are
68
 available as standard [extensions](#Extensions_and_Metadata) to core
69
 workflow semantics.
70
  </BLOCKQUOTE>
71
 */
72
public class WorkflowImpl extends SaveableImpl implements Workflow {
73
  private LoadingOptions loadingOptions_ = new LoadingOptionsBuilder().build();
1✔
74
  private java.util.Map<String, Object> extensionFields_ =
1✔
75
      new java.util.HashMap<String, Object>();
76
  public LoadingOptions getLoadingOptions() {
NEW
77
    return this.loadingOptions_;
×
78
  }
79
  public java.util.Map<String, Object> getExtensionFields() {
NEW
80
    return this.extensionFields_;
×
81
  }
82

83
  private java.util.Optional<String> id;
84

85
  /**
86
   * Getter for property <I>https://w3id.org/cwl/cwl#Identified/id</I><BR>
87
   * <BLOCKQUOTE>
88
   * The unique identifier for this object.   * </BLOCKQUOTE>
89
   */
90

91
  public java.util.Optional<String> getId() {
92
    return this.id;
1✔
93
  }
94

95
  private Workflow_class class_;
96

97
  /**
98
   * Getter for property <I>https://w3id.org/cwl/cwl#Workflow/class</I><BR>
99

100
   */
101

102
  public Workflow_class getClass_() {
NEW
103
    return this.class_;
×
104
  }
105

106
  private java.util.Optional<String> label;
107

108
  /**
109
   * Getter for property <I>https://w3id.org/cwl/cwl#Labeled/label</I><BR>
110
   * <BLOCKQUOTE>
111
   * A short, human-readable label of this object.   * </BLOCKQUOTE>
112
   */
113

114
  public java.util.Optional<String> getLabel() {
NEW
115
    return this.label;
×
116
  }
117

118
  private Object doc;
119

120
  /**
121
   * Getter for property <I>https://w3id.org/cwl/salad#Documented/doc</I><BR>
122
   * <BLOCKQUOTE>
123
   * A documentation string for this object, or an array of strings which should be concatenated.   * </BLOCKQUOTE>
124
   */
125

126
  public Object getDoc() {
NEW
127
    return this.doc;
×
128
  }
129

130
  private java.util.List<Object> inputs;
131

132
  /**
133
   * Getter for property <I>https://w3id.org/cwl/cwl#inputs</I><BR>
134
   * <BLOCKQUOTE>
135
   * Defines the input parameters of the process.  The process is ready to
136
   * run when all required input parameters are associated with concrete
137
   * values.  Input parameters include a schema for each parameter which is
138
   * used to validate the input object.  It may also be used to build a user
139
   * interface for constructing the input object.
140
   * 
141
   * When accepting an input object, all input parameters must have a value.
142
   * If an input parameter is missing from the input object, it must be
143
   * assigned a value of `null` (or the value of `default` for that
144
   * parameter, if provided) for the purposes of validation and evaluation
145
   * of expressions.
146
   *    * </BLOCKQUOTE>
147
   */
148

149
  public java.util.List<Object> getInputs() {
150
    return this.inputs;
1✔
151
  }
152

153
  private java.util.List<Object> outputs;
154

155
  /**
156
   * Getter for property <I>https://w3id.org/cwl/cwl#outputs</I><BR>
157
   * <BLOCKQUOTE>
158
   * Defines the parameters representing the output of the process.  May be
159
   * used to generate and/or validate the output object.
160
   *    * </BLOCKQUOTE>
161
   */
162

163
  public java.util.List<Object> getOutputs() {
NEW
164
    return this.outputs;
×
165
  }
166

167
  private java.util.Optional<java.util.List<Object>> requirements;
168

169
  /**
170
   * Getter for property <I>https://w3id.org/cwl/cwl#requirements</I><BR>
171
   * <BLOCKQUOTE>
172
   * Declares requirements that apply to either the runtime environment or the
173
   * workflow engine that must be met in order to execute this process.  If
174
   * an implementation cannot satisfy all requirements, or a requirement is
175
   * listed which is not recognized by the implementation, it is a fatal
176
   * error and the implementation must not attempt to run the process,
177
   * unless overridden at user option.
178
   *    * </BLOCKQUOTE>
179
   */
180

181
  public java.util.Optional<java.util.List<Object>> getRequirements() {
NEW
182
    return this.requirements;
×
183
  }
184

185
  private java.util.Optional<java.util.List<Object>> hints;
186

187
  /**
188
   * Getter for property <I>https://w3id.org/cwl/cwl#hints</I><BR>
189
   * <BLOCKQUOTE>
190
   * Declares hints applying to either the runtime environment or the
191
   * workflow engine that may be helpful in executing this process.  It is
192
   * not an error if an implementation cannot satisfy all hints, however
193
   * the implementation may report a warning.
194
   *    * </BLOCKQUOTE>
195
   */
196

197
  public java.util.Optional<java.util.List<Object>> getHints() {
NEW
198
    return this.hints;
×
199
  }
200

201
  private java.util.Optional<CWLVersion> cwlVersion;
202

203
  /**
204
   * Getter for property <I>https://w3id.org/cwl/cwl#cwlVersion</I><BR>
205
   * <BLOCKQUOTE>
206
   * CWL document version. Always required at the document root. Not
207
   * required for a Process embedded inside another Process.
208
   *    * </BLOCKQUOTE>
209
   */
210

211
  public java.util.Optional<CWLVersion> getCwlVersion() {
212
    return this.cwlVersion;
1✔
213
  }
214

215
  private java.util.List<Object> steps;
216

217
  /**
218
   * Getter for property <I>https://w3id.org/cwl/cwl#Workflow/steps</I><BR>
219
   * <BLOCKQUOTE>
220
   * The individual steps that make up the workflow.  Each step is executed when all of its
221
   * input data links are fufilled.  An implementation may choose to execute
222
   * the steps in a different order than listed and/or execute steps
223
   * concurrently, provided that dependencies between steps are met.
224
   *    * </BLOCKQUOTE>
225
   */
226

227
  public java.util.List<Object> getSteps() {
228
    return this.steps;
1✔
229
  }
230

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

263
    if (__doc.containsKey("id")) {
1✔
264
      try {
265
        id =
1✔
266
            LoaderInstances
267
                .uri_optional_StringInstance_True_False_None_None
268
                .loadField(__doc.get("id"), __baseUri, __loadingOptions);
1✔
NEW
269
      } catch (ValidationException e) {
×
NEW
270
        id = null; // won't be used but prevents compiler from complaining.
×
NEW
271
        final String __message = "the `id` field is not valid because:";
×
NEW
272
        __errors.add(new ValidationException(__message, e));
×
273
      }
1✔
274

275
    } else {
276
      id = null;
1✔
277
    }
278

279
    Boolean __original_is_null = id == null;
1✔
280
    if (id == null) {
1✔
281
      if (__docRoot != null) {
1✔
282
        id = java.util.Optional.of(__docRoot);
1✔
283
      } else {
284
        id = java.util.Optional.of("_:" + java.util.UUID.randomUUID().toString());
1✔
285
      }
286
    }
287
    if (__original_is_null) {
1✔
288
        __baseUri = __baseUri_;
1✔
289
    } else {
290
        __baseUri = (String) id.orElse(null);
1✔
291
    }
292
    Workflow_class class_;
293
    try {
294
      class_ =
1✔
295
          LoaderInstances
296
              .uri_Workflow_class_False_True_None_None
297
              .loadField(__doc.get("class"), __baseUri, __loadingOptions);
1✔
NEW
298
    } catch (ValidationException e) {
×
NEW
299
      class_ = null; // won't be used but prevents compiler from complaining.
×
NEW
300
      final String __message = "the `class` field is not valid because:";
×
NEW
301
      __errors.add(new ValidationException(__message, e));
×
302
    }
1✔
303
    java.util.Optional<String> label;
304

305
    if (__doc.containsKey("label")) {
1✔
306
      try {
NEW
307
        label =
×
308
            LoaderInstances
309
                .optional_StringInstance
NEW
310
                .loadField(__doc.get("label"), __baseUri, __loadingOptions);
×
NEW
311
      } catch (ValidationException e) {
×
NEW
312
        label = null; // won't be used but prevents compiler from complaining.
×
NEW
313
        final String __message = "the `label` field is not valid because:";
×
NEW
314
        __errors.add(new ValidationException(__message, e));
×
NEW
315
      }
×
316

317
    } else {
318
      label = null;
1✔
319
    }
320
    Object doc;
321

322
    if (__doc.containsKey("doc")) {
1✔
323
      try {
324
        doc =
1✔
325
            LoaderInstances
326
                .union_of_NullInstance_or_StringInstance_or_array_of_StringInstance
327
                .loadField(__doc.get("doc"), __baseUri, __loadingOptions);
1✔
NEW
328
      } catch (ValidationException e) {
×
NEW
329
        doc = null; // won't be used but prevents compiler from complaining.
×
NEW
330
        final String __message = "the `doc` field is not valid because:";
×
NEW
331
        __errors.add(new ValidationException(__message, e));
×
332
      }
1✔
333

334
    } else {
335
      doc = null;
1✔
336
    }
337
    java.util.List<Object> inputs;
338
    try {
339
      inputs =
1✔
340
          LoaderInstances
341
              .idmap_inputs_array_of_WorkflowInputParameter
342
              .loadField(__doc.get("inputs"), __baseUri, __loadingOptions);
1✔
NEW
343
    } catch (ValidationException e) {
×
NEW
344
      inputs = null; // won't be used but prevents compiler from complaining.
×
NEW
345
      final String __message = "the `inputs` field is not valid because:";
×
NEW
346
      __errors.add(new ValidationException(__message, e));
×
347
    }
1✔
348
    java.util.List<Object> outputs;
349
    try {
350
      outputs =
1✔
351
          LoaderInstances
352
              .idmap_outputs_array_of_WorkflowOutputParameter
353
              .loadField(__doc.get("outputs"), __baseUri, __loadingOptions);
1✔
NEW
354
    } catch (ValidationException e) {
×
NEW
355
      outputs = null; // won't be used but prevents compiler from complaining.
×
NEW
356
      final String __message = "the `outputs` field is not valid because:";
×
NEW
357
      __errors.add(new ValidationException(__message, e));
×
358
    }
1✔
359
    java.util.Optional<java.util.List<Object>> requirements;
360

361
    if (__doc.containsKey("requirements")) {
1✔
362
      try {
363
        requirements =
1✔
364
            LoaderInstances
365
                .idmap_requirements_optional_array_of_union_of_InlineJavascriptRequirement_or_SchemaDefRequirement_or_LoadListingRequirement_or_DockerRequirement_or_SoftwareRequirement_or_InitialWorkDirRequirement_or_EnvVarRequirement_or_ShellCommandRequirement_or_ResourceRequirement_or_WorkReuse_or_NetworkAccess_or_InplaceUpdateRequirement_or_ToolTimeLimit_or_SubworkflowFeatureRequirement_or_ScatterFeatureRequirement_or_MultipleInputFeatureRequirement_or_StepInputExpressionRequirement
366
                .loadField(__doc.get("requirements"), __baseUri, __loadingOptions);
1✔
NEW
367
      } catch (ValidationException e) {
×
NEW
368
        requirements = null; // won't be used but prevents compiler from complaining.
×
NEW
369
        final String __message = "the `requirements` field is not valid because:";
×
NEW
370
        __errors.add(new ValidationException(__message, e));
×
371
      }
1✔
372

373
    } else {
374
      requirements = null;
1✔
375
    }
376
    java.util.Optional<java.util.List<Object>> hints;
377

378
    if (__doc.containsKey("hints")) {
1✔
379
      try {
380
        hints =
1✔
381
            LoaderInstances
382
                .idmap_hints_optional_array_of_union_of_InlineJavascriptRequirement_or_SchemaDefRequirement_or_LoadListingRequirement_or_DockerRequirement_or_SoftwareRequirement_or_InitialWorkDirRequirement_or_EnvVarRequirement_or_ShellCommandRequirement_or_ResourceRequirement_or_WorkReuse_or_NetworkAccess_or_InplaceUpdateRequirement_or_ToolTimeLimit_or_SubworkflowFeatureRequirement_or_ScatterFeatureRequirement_or_MultipleInputFeatureRequirement_or_StepInputExpressionRequirement_or_AnyInstance
383
                .loadField(__doc.get("hints"), __baseUri, __loadingOptions);
1✔
NEW
384
      } catch (ValidationException e) {
×
NEW
385
        hints = null; // won't be used but prevents compiler from complaining.
×
NEW
386
        final String __message = "the `hints` field is not valid because:";
×
NEW
387
        __errors.add(new ValidationException(__message, e));
×
388
      }
1✔
389

390
    } else {
391
      hints = null;
1✔
392
    }
393
    java.util.Optional<CWLVersion> cwlVersion;
394

395
    if (__doc.containsKey("cwlVersion")) {
1✔
396
      try {
397
        cwlVersion =
1✔
398
            LoaderInstances
399
                .uri_optional_CWLVersion_False_True_None_None
400
                .loadField(__doc.get("cwlVersion"), __baseUri, __loadingOptions);
1✔
NEW
401
      } catch (ValidationException e) {
×
NEW
402
        cwlVersion = null; // won't be used but prevents compiler from complaining.
×
NEW
403
        final String __message = "the `cwlVersion` field is not valid because:";
×
NEW
404
        __errors.add(new ValidationException(__message, e));
×
405
      }
1✔
406

407
    } else {
408
      cwlVersion = null;
1✔
409
    }
410
    java.util.List<Object> steps;
411
    try {
412
      steps =
1✔
413
          LoaderInstances
414
              .idmap_steps_array_of_WorkflowStep
415
              .loadField(__doc.get("steps"), __baseUri, __loadingOptions);
1✔
NEW
416
    } catch (ValidationException e) {
×
NEW
417
      steps = null; // won't be used but prevents compiler from complaining.
×
NEW
418
      final String __message = "the `steps` field is not valid because:";
×
NEW
419
      __errors.add(new ValidationException(__message, e));
×
420
    }
1✔
421
    if (!__errors.isEmpty()) {
1✔
NEW
422
      throw new ValidationException("Trying 'RecordField'", __errors);
×
423
    }
424
    this.id = (java.util.Optional<String>) id;
1✔
425
    this.label = (java.util.Optional<String>) label;
1✔
426
    this.doc = (Object) doc;
1✔
427
    this.inputs = (java.util.List<Object>) inputs;
1✔
428
    this.outputs = (java.util.List<Object>) outputs;
1✔
429
    this.requirements = (java.util.Optional<java.util.List<Object>>) requirements;
1✔
430
    this.hints = (java.util.Optional<java.util.List<Object>>) hints;
1✔
431
    this.cwlVersion = (java.util.Optional<CWLVersion>) cwlVersion;
1✔
432
    this.class_ = (Workflow_class) class_;
1✔
433
    this.steps = (java.util.List<Object>) steps;
1✔
434
    for (String field:__doc.keySet()) {
1✔
435
      if (!attrs.contains(field)) {
1✔
NEW
436
        if (field.contains(":")) {
×
NEW
437
          String expanded_field = __loadingOptions.expandUrl(field, "", false, false, null);
×
NEW
438
          extensionFields_.put(expanded_field, __doc.get(field));
×
439
        }
440
      }
441
    }
1✔
442
  }
1✔
443
  private java.util.List<String> attrs = java.util.Arrays.asList("id", "label", "doc", "inputs", "outputs", "requirements", "hints", "cwlVersion", "class", "steps");
1✔
444
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc