@@ -72,6 +72,7 @@ public class CWLCollection {
72
72
private final String DESCRIPTION = "description" ;
73
73
private final String ARRAY = "array" ;
74
74
private final String ARRAY_ITEMS = "items" ;
75
+ private final String LOCATION = "location" ;
75
76
76
77
/**
77
78
* Creates a new collection of CWL files from a Github repository
@@ -275,13 +276,22 @@ private Map<String, CWLElement> getStepInputsOutputs(JsonNode inOut) {
275
276
276
277
if (inOut .getClass () == ArrayNode .class ) {
277
278
// array<WorkflowStepInput>
279
+ int test = 1 ;
278
280
} else if (inOut .getClass () == ObjectNode .class ) {
279
281
// map<WorkflowStepInput.id, WorkflowStepInput.source>
280
282
Iterator <Map .Entry <String , JsonNode >> iterator = inOut .fields ();
281
283
while (iterator .hasNext ()) {
282
284
Map .Entry <String , JsonNode > inOutNode = iterator .next ();
283
285
CWLElement inputOutput = new CWLElement ();
284
- inputOutput .addSourceID (stepIDFromSource (inOutNode .getValue ().asText ()));
286
+ if (inOutNode .getValue ().getClass () == ObjectNode .class ) {
287
+ inputOutput .setDefaultVal (extractDefault (inOutNode .getValue ()));
288
+ } else if (inOutNode .getValue ().getClass () == ArrayNode .class ) {
289
+ for (JsonNode key : inOutNode .getValue ()) {
290
+ inputOutput .addSourceID (stepIDFromSource (key .asText ()));
291
+ }
292
+ } else {
293
+ inputOutput .addSourceID (stepIDFromSource (inOutNode .getValue ().asText ()));
294
+ }
285
295
returnMap .put (inOutNode .getKey (), inputOutput );
286
296
}
287
297
}
@@ -379,7 +389,11 @@ private String extractLabel(JsonNode node) {
379
389
*/
380
390
private String extractDefault (JsonNode node ) {
381
391
if (node != null && node .has (DEFAULT )) {
382
- return node .get (DEFAULT ).asText ();
392
+ if (node .get (DEFAULT ).has (LOCATION )) {
393
+ return node .get (DEFAULT ).get (LOCATION ).asText ();
394
+ } else {
395
+ return node .get (DEFAULT ).asText ();
396
+ }
383
397
}
384
398
return null ;
385
399
}
@@ -425,7 +439,7 @@ private List<String> extractOutputSource(JsonNode node) {
425
439
* @return The step ID
426
440
*/
427
441
private String stepIDFromSource (String source ) {
428
- if (source != null ) {
442
+ if (source != null && source . length () > 0 ) {
429
443
// Strip leading # if it exists
430
444
if (source .charAt (0 ) == '#' ) {
431
445
source = source .substring (1 );
0 commit comments