From bee175384a1aefd063be96b7a987ae1231f5b076 Mon Sep 17 00:00:00 2001 From: HadleyKing Date: Wed, 19 Feb 2020 15:32:30 -0500 Subject: [PATCH] Add code to extract input_subdomain fix #17 add code to parse data_collection_input and data_input objects from the workflow invocation for the input_subdomaiRremove debugging text --- lib/galaxy/webapps/galaxy/api/workflows.py | 26 ++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/lib/galaxy/webapps/galaxy/api/workflows.py b/lib/galaxy/webapps/galaxy/api/workflows.py index faa6a2e86ac8..d81529211fa4 100644 --- a/lib/galaxy/webapps/galaxy/api/workflows.py +++ b/lib/galaxy/webapps/galaxy/api/workflows.py @@ -1135,9 +1135,27 @@ def export_invocation_bco(self, trans, invocation_id, **kwd): tools.append(software_prerequisite['uri']['uri']) except Exception: continue - # method to grab the workflow inputs? [WIP] TODO - if step.workflow_step.type != 'tool': - input_subdomain.append(step.workflow_step) + + if step.workflow_step.type == 'data_input': + for output_assoc in step.output_datasets: + encoded_dataset_id = trans.security.encode_id(output_assoc.dataset.id) + input_obj = { + 'filename': step.workflow_step.label, + 'uri': url_for('history_content', history_id=encoded_history_id, id=encoded_dataset_id, qualified=True), + 'access_time': step.workflow_step.update_time.isoformat(), + } + input_subdomain.append(input_obj) + + if step.workflow_step.type == 'data_collection_input': + encoded_dataset_id = trans.security.encode_id(step.workflow_step.id) + input_obj = [] + input_obj = { + 'filename': step.workflow_step.label, + 'uri': url_for('history_content', history_id=encoded_history_id, id=encoded_dataset_id, qualified=True), + 'access_time': step.workflow_step.update_time.isoformat(), + } + input_subdomain.append(input_obj) + usability_domain = [] for a in stored_workflow.annotations: usability_domain.append(a.annotation) @@ -1163,7 +1181,7 @@ def export_invocation_bco(self, trans, invocation_id, **kwd): } galaxy_extension = [] # TODO - input_subdomain = [] # TODO + input_subdomain = input_subdomain # TODO ret_dict = { 'bco_id': url_for('invocation_export_bco', invocation_id=invocation_id, qualified=True),