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

common-workflow-language / cwljava / #339

29 Jan 2025 01:23PM UTC coverage: 59.538% (-0.6%) from 60.167%
#339

Pull #193

github

web-flow
Merge 94c260498 into 0978523bc
Pull Request #193: Add accessor for the extension field.

0 of 129 new or added lines in 129 files covered. (0.0%)

7347 of 12340 relevant lines covered (59.54%)

0.6 hits per line

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

62.5
/src/main/java/org/w3id/cwl/cwl1_2/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.w3id.cwl.cwl1_2;
16

17
import org.w3id.cwl.cwl1_2.utils.LoaderInstances;
18
import org.w3id.cwl.cwl1_2.utils.LoadingOptions;
19
import org.w3id.cwl.cwl1_2.utils.LoadingOptionsBuilder;
20
import org.w3id.cwl.cwl1_2.utils.SaveableImpl;
21
import org.w3id.cwl.cwl1_2.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`
37
 field on [workflow step input parameters](#WorkflowStepInput) and
38
 `outputSource` field on [workflow output
39
 parameters](#WorkflowOutputParameter).
40
 
41
 The `source` field on each workflow step input parameter expresses
42
 the data links that contribute to the value of the step input
43
 parameter (the "sink").  A workflow step can only begin execution
44
 when every data link connected to a step has been fulfilled.
45
 
46
 The `outputSource` field on each workflow step input parameter
47
 expresses the data links that contribute to the value of the
48
 workflow output parameter (the "sink").  Workflow execution cannot
49
 complete successfully until every data link connected to an output
50
 parameter has been fulfilled.
51
 
52
 ## Workflow success and failure
53
 
54
 A completed step must result in one of `success`, `temporaryFailure` or
55
 `permanentFailure` states.  An implementation may choose to retry a step
56
 execution which resulted in `temporaryFailure`.  An implementation may
57
 choose to either continue running other steps of a workflow, or terminate
58
 immediately upon `permanentFailure`.
59
 
60
 * If any step of a workflow execution results in `permanentFailure`, then
61
 the workflow status is `permanentFailure`.
62
 
63
 * If one or more steps result in `temporaryFailure` and all other steps
64
 complete `success` or are not executed, then the workflow status is
65
 `temporaryFailure`.
66
 
67
 * If all workflow steps are executed and complete with `success`, then the
68
 workflow status is `success`.
69
 
70
 # Extensions
71
 
72
 [ScatterFeatureRequirement](#ScatterFeatureRequirement) and
73
 [SubworkflowFeatureRequirement](#SubworkflowFeatureRequirement) are
74
 available as standard [extensions](#Extensions_and_Metadata) to core
75
 workflow semantics.
76
  </BLOCKQUOTE>
77
 */
78
public class WorkflowImpl extends SaveableImpl implements Workflow {
79
  private LoadingOptions loadingOptions_ = new LoadingOptionsBuilder().build();
1✔
80
  private java.util.Map<String, Object> extensionFields_ =
1✔
81
      new java.util.HashMap<String, Object>();
82
  public java.util.Map<String, Object> getExtensionFields() {
NEW
83
    return this.extensionFields_;
×
84
  }
85

86
  private java.util.Optional<String> id;
87

88
  /**
89
   * Getter for property <I>https://w3id.org/cwl/cwl#Process/id</I><BR>
90
   * <BLOCKQUOTE>
91
   * The unique identifier for this object.
92
   * 
93
   * Only useful for `$graph` at `Process` level. Should not be exposed
94
   * to users in graphical or terminal user interfaces.
95
   *    * </BLOCKQUOTE>
96
   */
97

98
  public java.util.Optional<String> getId() {
99
    return this.id;
1✔
100
  }
101

102
  private Workflow_class class_;
103

104
  /**
105
   * Getter for property <I>https://w3id.org/cwl/cwl#Workflow/class</I><BR>
106

107
   */
108

109
  public Workflow_class getClass_() {
110
    return this.class_;
×
111
  }
112

113
  private java.util.Optional<String> label;
114

115
  /**
116
   * Getter for property <I>https://w3id.org/cwl/cwl#Labeled/label</I><BR>
117
   * <BLOCKQUOTE>
118
   * A short, human-readable label of this object.   * </BLOCKQUOTE>
119
   */
120

121
  public java.util.Optional<String> getLabel() {
122
    return this.label;
×
123
  }
124

125
  private Object doc;
126

127
  /**
128
   * Getter for property <I>https://w3id.org/cwl/salad#Documented/doc</I><BR>
129
   * <BLOCKQUOTE>
130
   * A documentation string for this object, or an array of strings which should be concatenated.   * </BLOCKQUOTE>
131
   */
132

133
  public Object getDoc() {
134
    return this.doc;
×
135
  }
136

137
  private java.util.List<Object> inputs;
138

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

156
  public java.util.List<Object> getInputs() {
157
    return this.inputs;
1✔
158
  }
159

160
  private java.util.List<Object> outputs;
161

162
  /**
163
   * Getter for property <I>https://w3id.org/cwl/cwl#outputs</I><BR>
164
   * <BLOCKQUOTE>
165
   * Defines the parameters representing the output of the process.  May be
166
   * used to generate and/or validate the output object.
167
   *    * </BLOCKQUOTE>
168
   */
169

170
  public java.util.List<Object> getOutputs() {
171
    return this.outputs;
×
172
  }
173

174
  private java.util.Optional<java.util.List<Object>> requirements;
175

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

188
  public java.util.Optional<java.util.List<Object>> getRequirements() {
189
    return this.requirements;
×
190
  }
191

192
  private java.util.Optional<java.util.List<Object>> hints;
193

194
  /**
195
   * Getter for property <I>https://w3id.org/cwl/cwl#hints</I><BR>
196
   * <BLOCKQUOTE>
197
   * Declares hints applying to either the runtime environment or the
198
   * workflow engine that may be helpful in executing this process.  It is
199
   * not an error if an implementation cannot satisfy all hints, however
200
   * the implementation may report a warning.
201
   *    * </BLOCKQUOTE>
202
   */
203

204
  public java.util.Optional<java.util.List<Object>> getHints() {
205
    return this.hints;
×
206
  }
207

208
  private java.util.Optional<CWLVersion> cwlVersion;
209

210
  /**
211
   * Getter for property <I>https://w3id.org/cwl/cwl#cwlVersion</I><BR>
212
   * <BLOCKQUOTE>
213
   * CWL document version. Always required at the document root. Not
214
   * required for a Process embedded inside another Process.
215
   *    * </BLOCKQUOTE>
216
   */
217

218
  public java.util.Optional<CWLVersion> getCwlVersion() {
219
    return this.cwlVersion;
1✔
220
  }
221

222
  private java.util.Optional<java.util.List<String>> intent;
223

224
  /**
225
   * Getter for property <I>https://w3id.org/cwl/cwl#Process/intent</I><BR>
226
   * <BLOCKQUOTE>
227
   * An identifier for the type of computational operation, of this Process.
228
   * Especially useful for [`Operation`](Workflow.html#Operation), but can also be used for
229
   * [`CommandLineTool`](CommandLineTool.html#CommandLineTool),
230
   * [`Workflow`](Workflow.html#Workflow), or [ExpressionTool](Workflow.html#ExpressionTool).
231
   * 
232
   * If provided, then this must be an IRI of a concept node that
233
   * represents the type of operation, preferably defined within an ontology.
234
   * 
235
   * For example, in the domain of bioinformatics, one can use an IRI from
236
   * the EDAM Ontology's [Operation concept nodes](http://edamontology.org/operation_0004),
237
   * like [Alignment](http://edamontology.org/operation_2928),
238
   * or [Clustering](http://edamontology.org/operation_3432); or a more
239
   * specific Operation concept like
240
   * [Split read mapping](http://edamontology.org/operation_3199).
241
   *    * </BLOCKQUOTE>
242
   */
243

244
  public java.util.Optional<java.util.List<String>> getIntent() {
245
    return this.intent;
×
246
  }
247

248
  private java.util.List<Object> steps;
249

250
  /**
251
   * Getter for property <I>https://w3id.org/cwl/cwl#Workflow/steps</I><BR>
252
   * <BLOCKQUOTE>
253
   * The individual steps that make up the workflow.  Each step is executed when all of its
254
   * input data links are fulfilled.  An implementation may choose to execute
255
   * the steps in a different order than listed and/or execute steps
256
   * concurrently, provided that dependencies between steps are met.
257
   *    * </BLOCKQUOTE>
258
   */
259

260
  public java.util.List<Object> getSteps() {
261
    return this.steps;
1✔
262
  }
263

264
  /**
265
   * Used by {@link org.w3id.cwl.cwl1_2.utils.RootLoader} to construct instances of WorkflowImpl.
266
   *
267
   * @param __doc_            Document fragment to load this record object from (presumably a
268
                              {@link java.util.Map}).
269
   * @param __baseUri_        Base URI to generate child document IDs against.
270
   * @param __loadingOptions  Context for loading URIs and populating objects.
271
   * @param __docRoot_        ID at this position in the document (if available) (maybe?)
272
   * @throws ValidationException If the document fragment is not a {@link java.util.Map}
273
   *                             or validation of fields fails.
274
   */
275
  public WorkflowImpl(
276
      final Object __doc_,
277
      final String __baseUri_,
278
      LoadingOptions __loadingOptions,
279
      final String __docRoot_) {
280
    super(__doc_, __baseUri_, __loadingOptions, __docRoot_);
1✔
281
    // Prefix plumbing variables with '__' to reduce likelihood of collision with
282
    // generated names.
283
    String __baseUri = __baseUri_;
1✔
284
    String __docRoot = __docRoot_;
1✔
285
    if (!(__doc_ instanceof java.util.Map)) {
1✔
286
      throw new ValidationException("WorkflowImpl called on non-map");
×
287
    }
288
    final java.util.Map<String, Object> __doc = (java.util.Map<String, Object>) __doc_;
1✔
289
    final java.util.List<ValidationException> __errors =
1✔
290
        new java.util.ArrayList<ValidationException>();
291
    if (__loadingOptions != null) {
1✔
292
      this.loadingOptions_ = __loadingOptions;
1✔
293
    }
294
    java.util.Optional<String> id;
295

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

308
    } else {
309
      id = null;
1✔
310
    }
311

312
    Boolean __original_is_null = id == null;
1✔
313
    if (id == null) {
1✔
314
      if (__docRoot != null) {
1✔
315
        id = java.util.Optional.of(__docRoot);
1✔
316
      } else {
317
        id = java.util.Optional.of("_:" + java.util.UUID.randomUUID().toString());
1✔
318
      }
319
    }
320
    if (__original_is_null) {
1✔
321
        __baseUri = __baseUri_;
1✔
322
    } else {
323
        __baseUri = (String) id.orElse(null);
1✔
324
    }
325
    Workflow_class class_;
326
    try {
327
      class_ =
1✔
328
          LoaderInstances
329
              .uri_Workflow_class_False_True_None_None
330
              .loadField(__doc.get("class"), __baseUri, __loadingOptions);
1✔
331
    } catch (ValidationException e) {
1✔
332
      class_ = null; // won't be used but prevents compiler from complaining.
1✔
333
      final String __message = "the `class` field is not valid because:";
1✔
334
      __errors.add(new ValidationException(__message, e));
1✔
335
    }
1✔
336
    java.util.Optional<String> label;
337

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

350
    } else {
351
      label = null;
1✔
352
    }
353
    Object doc;
354

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

367
    } else {
368
      doc = null;
1✔
369
    }
370
    java.util.List<Object> inputs;
371
    try {
372
      inputs =
1✔
373
          LoaderInstances
374
              .idmap_inputs_array_of_WorkflowInputParameter
375
              .loadField(__doc.get("inputs"), __baseUri, __loadingOptions);
1✔
376
    } catch (ValidationException e) {
×
377
      inputs = null; // won't be used but prevents compiler from complaining.
×
378
      final String __message = "the `inputs` field is not valid because:";
×
379
      __errors.add(new ValidationException(__message, e));
×
380
    }
1✔
381
    java.util.List<Object> outputs;
382
    try {
383
      outputs =
1✔
384
          LoaderInstances
385
              .idmap_outputs_array_of_WorkflowOutputParameter
386
              .loadField(__doc.get("outputs"), __baseUri, __loadingOptions);
1✔
387
    } catch (ValidationException e) {
×
388
      outputs = null; // won't be used but prevents compiler from complaining.
×
389
      final String __message = "the `outputs` field is not valid because:";
×
390
      __errors.add(new ValidationException(__message, e));
×
391
    }
1✔
392
    java.util.Optional<java.util.List<Object>> requirements;
393

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

406
    } else {
407
      requirements = null;
1✔
408
    }
409
    java.util.Optional<java.util.List<Object>> hints;
410

411
    if (__doc.containsKey("hints")) {
1✔
412
      try {
413
        hints =
1✔
414
            LoaderInstances
415
                .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
416
                .loadField(__doc.get("hints"), __baseUri, __loadingOptions);
1✔
417
      } catch (ValidationException e) {
×
418
        hints = null; // won't be used but prevents compiler from complaining.
×
419
        final String __message = "the `hints` field is not valid because:";
×
420
        __errors.add(new ValidationException(__message, e));
×
421
      }
1✔
422

423
    } else {
424
      hints = null;
1✔
425
    }
426
    java.util.Optional<CWLVersion> cwlVersion;
427

428
    if (__doc.containsKey("cwlVersion")) {
1✔
429
      try {
430
        cwlVersion =
1✔
431
            LoaderInstances
432
                .uri_optional_CWLVersion_False_True_None_None
433
                .loadField(__doc.get("cwlVersion"), __baseUri, __loadingOptions);
1✔
434
      } catch (ValidationException e) {
×
435
        cwlVersion = null; // won't be used but prevents compiler from complaining.
×
436
        final String __message = "the `cwlVersion` field is not valid because:";
×
437
        __errors.add(new ValidationException(__message, e));
×
438
      }
1✔
439

440
    } else {
441
      cwlVersion = null;
1✔
442
    }
443
    java.util.Optional<java.util.List<String>> intent;
444

445
    if (__doc.containsKey("intent")) {
1✔
446
      try {
447
        intent =
×
448
            LoaderInstances
449
                .uri_optional_array_of_StringInstance_True_False_None_None
450
                .loadField(__doc.get("intent"), __baseUri, __loadingOptions);
×
451
      } catch (ValidationException e) {
×
452
        intent = null; // won't be used but prevents compiler from complaining.
×
453
        final String __message = "the `intent` field is not valid because:";
×
454
        __errors.add(new ValidationException(__message, e));
×
455
      }
×
456

457
    } else {
458
      intent = null;
1✔
459
    }
460
    java.util.List<Object> steps;
461
    try {
462
      steps =
1✔
463
          LoaderInstances
464
              .idmap_steps_array_of_WorkflowStep
465
              .loadField(__doc.get("steps"), __baseUri, __loadingOptions);
1✔
466
    } catch (ValidationException e) {
1✔
467
      steps = null; // won't be used but prevents compiler from complaining.
1✔
468
      final String __message = "the `steps` field is not valid because:";
1✔
469
      __errors.add(new ValidationException(__message, e));
1✔
470
    }
1✔
471
    if (!__errors.isEmpty()) {
1✔
472
      throw new ValidationException("Trying 'RecordField'", __errors);
1✔
473
    }
474
    this.id = (java.util.Optional<String>) id;
1✔
475
    this.label = (java.util.Optional<String>) label;
1✔
476
    this.doc = (Object) doc;
1✔
477
    this.inputs = (java.util.List<Object>) inputs;
1✔
478
    this.outputs = (java.util.List<Object>) outputs;
1✔
479
    this.requirements = (java.util.Optional<java.util.List<Object>>) requirements;
1✔
480
    this.hints = (java.util.Optional<java.util.List<Object>>) hints;
1✔
481
    this.cwlVersion = (java.util.Optional<CWLVersion>) cwlVersion;
1✔
482
    this.intent = (java.util.Optional<java.util.List<String>>) intent;
1✔
483
    this.class_ = (Workflow_class) class_;
1✔
484
    this.steps = (java.util.List<Object>) steps;
1✔
485
  }
1✔
486
}
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

© 2026 Coveralls, Inc