• 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

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

17
import org.w3id.cwl.cwl1_1.utils.LoaderInstances;
18
import org.w3id.cwl.cwl1_1.utils.LoadingOptions;
19
import org.w3id.cwl.cwl1_1.utils.LoadingOptionsBuilder;
20
import org.w3id.cwl.cwl1_1.utils.SaveableImpl;
21
import org.w3id.cwl.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 java.util.Map<String, Object> getExtensionFields() {
NEW
77
    return this.extensionFields_;
×
78
  }
79

80
  private java.util.Optional<String> id;
81

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

88
  public java.util.Optional<String> getId() {
89
    return this.id;
1✔
90
  }
91

92
  private Workflow_class class_;
93

94
  /**
95
   * Getter for property <I>https://w3id.org/cwl/cwl#Workflow/class</I><BR>
96

97
   */
98

99
  public Workflow_class getClass_() {
100
    return this.class_;
×
101
  }
102

103
  private java.util.Optional<String> label;
104

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

111
  public java.util.Optional<String> getLabel() {
112
    return this.label;
×
113
  }
114

115
  private Object doc;
116

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

123
  public Object getDoc() {
124
    return this.doc;
×
125
  }
126

127
  private java.util.List<Object> inputs;
128

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

146
  public java.util.List<Object> getInputs() {
147
    return this.inputs;
1✔
148
  }
149

150
  private java.util.List<Object> outputs;
151

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

160
  public java.util.List<Object> getOutputs() {
161
    return this.outputs;
×
162
  }
163

164
  private java.util.Optional<java.util.List<Object>> requirements;
165

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

178
  public java.util.Optional<java.util.List<Object>> getRequirements() {
179
    return this.requirements;
×
180
  }
181

182
  private java.util.Optional<java.util.List<Object>> hints;
183

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

194
  public java.util.Optional<java.util.List<Object>> getHints() {
195
    return this.hints;
×
196
  }
197

198
  private java.util.Optional<CWLVersion> cwlVersion;
199

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

208
  public java.util.Optional<CWLVersion> getCwlVersion() {
209
    return this.cwlVersion;
1✔
210
  }
211

212
  private java.util.List<Object> steps;
213

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

224
  public java.util.List<Object> getSteps() {
225
    return this.steps;
1✔
226
  }
227

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

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

272
    } else {
273
      id = null;
1✔
274
    }
275

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

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

314
    } else {
315
      label = null;
1✔
316
    }
317
    Object doc;
318

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

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

358
    if (__doc.containsKey("requirements")) {
1✔
359
      try {
360
        requirements =
1✔
361
            LoaderInstances
362
                .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
363
                .loadField(__doc.get("requirements"), __baseUri, __loadingOptions);
1✔
364
      } catch (ValidationException e) {
×
365
        requirements = null; // won't be used but prevents compiler from complaining.
×
366
        final String __message = "the `requirements` field is not valid because:";
×
367
        __errors.add(new ValidationException(__message, e));
×
368
      }
1✔
369

370
    } else {
371
      requirements = null;
1✔
372
    }
373
    java.util.Optional<java.util.List<Object>> hints;
374

375
    if (__doc.containsKey("hints")) {
1✔
376
      try {
377
        hints =
1✔
378
            LoaderInstances
379
                .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
380
                .loadField(__doc.get("hints"), __baseUri, __loadingOptions);
1✔
381
      } catch (ValidationException e) {
×
382
        hints = null; // won't be used but prevents compiler from complaining.
×
383
        final String __message = "the `hints` field is not valid because:";
×
384
        __errors.add(new ValidationException(__message, e));
×
385
      }
1✔
386

387
    } else {
388
      hints = null;
1✔
389
    }
390
    java.util.Optional<CWLVersion> cwlVersion;
391

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

404
    } else {
405
      cwlVersion = null;
1✔
406
    }
407
    java.util.List<Object> steps;
408
    try {
409
      steps =
1✔
410
          LoaderInstances
411
              .idmap_steps_array_of_WorkflowStep
412
              .loadField(__doc.get("steps"), __baseUri, __loadingOptions);
1✔
413
    } catch (ValidationException e) {
×
414
      steps = null; // won't be used but prevents compiler from complaining.
×
415
      final String __message = "the `steps` field is not valid because:";
×
416
      __errors.add(new ValidationException(__message, e));
×
417
    }
1✔
418
    if (!__errors.isEmpty()) {
1✔
419
      throw new ValidationException("Trying 'RecordField'", __errors);
×
420
    }
421
    this.id = (java.util.Optional<String>) id;
1✔
422
    this.label = (java.util.Optional<String>) label;
1✔
423
    this.doc = (Object) doc;
1✔
424
    this.inputs = (java.util.List<Object>) inputs;
1✔
425
    this.outputs = (java.util.List<Object>) outputs;
1✔
426
    this.requirements = (java.util.Optional<java.util.List<Object>>) requirements;
1✔
427
    this.hints = (java.util.Optional<java.util.List<Object>>) hints;
1✔
428
    this.cwlVersion = (java.util.Optional<CWLVersion>) cwlVersion;
1✔
429
    this.class_ = (Workflow_class) class_;
1✔
430
    this.steps = (java.util.List<Object>) steps;
1✔
431
  }
1✔
432
}
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