• 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

58.97
/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStepOutputImpl.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#WorkflowStepOutput</I><BR> <BLOCKQUOTE>
25
 Associate an output parameter of the underlying process with a workflow
26
 parameter.  The workflow parameter (given in the `id` field) be may be used
27
 as a `source` to connect with input parameters of other workflow steps, or
28
 with an output parameter of the process.
29
 
30
 A unique identifier for this workflow output parameter.  This is
31
 the identifier to use in the `source` field of `WorkflowStepInput`
32
 to connect the output value to downstream parameters.
33
  </BLOCKQUOTE>
34
 */
35
public class WorkflowStepOutputImpl extends SaveableImpl implements WorkflowStepOutput {
36
  private LoadingOptions loadingOptions_ = new LoadingOptionsBuilder().build();
1✔
37
  private java.util.Map<String, Object> extensionFields_ =
1✔
38
      new java.util.HashMap<String, Object>();
39
  public LoadingOptions getLoadingOptions() {
40
    return this.loadingOptions_;
×
41
  }
42
  public java.util.Map<String, Object> getExtensionFields() {
43
    return this.extensionFields_;
×
44
  }
45

46
  private String id;
47

48
  /**
49
   * Getter for property <I>https://w3id.org/cwl/cwl#WorkflowStepOutput/id</I><BR>
50
   * <BLOCKQUOTE>
51
   * The unique identifier of the workflow parameter to export.   * </BLOCKQUOTE>
52
   */
53

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

58
  /**
59
   * Used by {@link org.commonwl.cwlsdk.cwl1_2.utils.RootLoader} to construct instances of WorkflowStepOutputImpl.
60
   *
61
   * @param __doc_            Document fragment to load this record object from (presumably a
62
                              {@link java.util.Map}).
63
   * @param __baseUri_        Base URI to generate child document IDs against.
64
   * @param __loadingOptions  Context for loading URIs and populating objects.
65
   * @param __docRoot_        ID at this position in the document (if available) (maybe?)
66
   * @throws ValidationException If the document fragment is not a {@link java.util.Map}
67
   *                             or validation of fields fails.
68
   */
69
  public WorkflowStepOutputImpl(
70
      final Object __doc_,
71
      final String __baseUri_,
72
      LoadingOptions __loadingOptions,
73
      final String __docRoot_) {
74
    super(__doc_, __baseUri_, __loadingOptions, __docRoot_);
1✔
75
    // Prefix plumbing variables with '__' to reduce likelihood of collision with
76
    // generated names.
77
    String __baseUri = __baseUri_;
1✔
78
    String __docRoot = __docRoot_;
1✔
79
    if (!(__doc_ instanceof java.util.Map)) {
1✔
80
      throw new ValidationException("WorkflowStepOutputImpl called on non-map");
×
81
    }
82
    final java.util.Map<String, Object> __doc = (java.util.Map<String, Object>) __doc_;
1✔
83
    final java.util.List<ValidationException> __errors =
1✔
84
        new java.util.ArrayList<ValidationException>();
85
    if (__loadingOptions != null) {
1✔
86
      this.loadingOptions_ = __loadingOptions;
1✔
87
    }
88
    String id;
89

90
    if (__doc.containsKey("id")) {
1✔
91
      try {
92
        id =
1✔
93
            LoaderInstances
94
                .uri_StringInstance_True_False_None_None
95
                .loadField(__doc.get("id"), __baseUri, __loadingOptions);
1✔
96
      } catch (ValidationException e) {
×
97
        id = null; // won't be used but prevents compiler from complaining.
×
98
        final String __message = "the `id` field is not valid because:";
×
99
        __errors.add(new ValidationException(__message, e));
×
100
      }
1✔
101

102
    } else {
103
      id = null;
×
104
    }
105

106
    if (id == null) {
1✔
UNCOV
107
      if (__docRoot != null) {
×
NEW
108
        id = __docRoot;
×
109
      } else {
NEW
110
        throw new ValidationException("Missing id");
×
111
      }
112
    }
113
    __baseUri = (String) id;
1✔
114
    if (!__errors.isEmpty()) {
1✔
115
      throw new ValidationException("Trying 'RecordField'", __errors);
×
116
    }
117
    this.id = (String) id;
1✔
118
    for (String field:__doc.keySet()) {
1✔
119
      if (!attrs.contains(field)) {
1✔
120
        if (field.contains(":")) {
×
121
          String expanded_field = __loadingOptions.expandUrl(field, "", false, false, null);
×
122
          extensionFields_.put(expanded_field, __doc.get(field));
×
123
        }
124
      }
125
    }
1✔
126
  }
1✔
127
  private java.util.List<String> attrs = java.util.Arrays.asList("id");
1✔
128
}
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