Skip to content

Commit 60eeeb3

Browse files
author
Peter Amstutz
committed
Support "outputSource"
1 parent a219637 commit 60eeeb3

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

cwltool/process.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"invocation.md")
5353

5454
salad_files = ('metaschema.yml',
55+
'metaschema_base.yml',
5556
'salad.md',
5657
'field_name.yml',
5758
'import_include.md',

cwltool/workflow.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,17 +104,17 @@ def are_same_type(src, sink): # type: (Any, Any) -> bool
104104
return src == sink
105105

106106

107-
def object_from_state(state, parms, frag_only, supportsMultipleInput):
107+
def object_from_state(state, parms, frag_only, supportsMultipleInput, sourceField):
108108
# type: (Dict[str,WorkflowStateItem], List[Dict[str, Any]], bool, bool) -> Dict[str, str]
109109
inputobj = {} # type: Dict[str, str]
110110
for inp in parms:
111111
iid = inp["id"]
112112
if frag_only:
113113
iid = shortname(iid)
114-
if "source" in inp:
115-
if isinstance(inp["source"], list) and not supportsMultipleInput:
114+
if sourceField in inp:
115+
if isinstance(inp[sourceField], list) and not supportsMultipleInput:
116116
raise WorkflowException("Workflow contains multiple inbound links to a single parameter but MultipleInputFeatureRequirement is not declared.")
117-
connections = aslist(inp["source"])
117+
connections = aslist(inp[sourceField])
118118
for src in connections:
119119
if src in state and state[src] is not None:
120120
if not match_types(inp["type"], state[src], iid, inputobj,
@@ -205,7 +205,7 @@ def try_make_job(self, step, **kwargs):
205205
supportsMultipleInput = bool(self.workflow.get_requirement("MultipleInputFeatureRequirement")[0])
206206

207207
try:
208-
inputobj = object_from_state(self.state, inputparms, False, supportsMultipleInput)
208+
inputobj = object_from_state(self.state, inputparms, False, supportsMultipleInput, "source")
209209
if inputobj is None:
210210
_logger.debug(u"[%s] job step %s not ready", self.name, step.id)
211211
return
@@ -326,7 +326,7 @@ def job(self, joborder, output_callback, move_outputs=True, **kwargs):
326326

327327
supportsMultipleInput = bool(self.workflow.get_requirement("MultipleInputFeatureRequirement")[0])
328328

329-
wo = object_from_state(self.state, self.tool["outputs"], True, supportsMultipleInput)
329+
wo = object_from_state(self.state, self.tool["outputs"], True, supportsMultipleInput, "outputSource")
330330

331331
if wo is None:
332332
raise WorkflowException("Output for workflow not available")

0 commit comments

Comments
 (0)