diff --git a/lib/galaxy/tools/execute.py b/lib/galaxy/tools/execute.py index 20ba6dea2b9..39cec6b346a 100644 --- a/lib/galaxy/tools/execute.py +++ b/lib/galaxy/tools/execute.py @@ -197,6 +197,9 @@ class ToolExecutionTracker( object ): job.add_output_dataset_collection( output_name, collection ) collections[ output_name ] = collection + # Needed to flush the association created just above with + # job.add_output_dataset_collection. + trans.sa_session.flush() self.implicit_collections = collections __all__ = [ execute ] diff --git a/lib/galaxy/workflow/extract.py b/lib/galaxy/workflow/extract.py index 285afda733b..5737eb6f57e 100644 --- a/lib/galaxy/workflow/extract.py +++ b/lib/galaxy/workflow/extract.py @@ -220,15 +220,17 @@ class WorkflowSummary( object ): dataset_collection = content hid = content.hid self.collection_types[ hid ] = content.collection.collection_type - if content.creating_job_associations: - for assoc in content.creating_job_associations: - job = assoc.job - if job not in self.jobs or self.jobs[ job ][ 0 ][ 1 ].history_content_type == "dataset": - self.jobs[ job ] = [ ( assoc.name, dataset_collection ) ] - if content.implicit_output_name: - self.implicit_map_jobs.append( job ) - else: - self.jobs[ job ].append( ( assoc.name, dataset_collection ) ) + cja = content.creating_job_associations + if cja: + # Use the first job to represent all mapped jobs. + representive_job_assoc = content.creating_job_associations[0] + job = representive_job_assoc.job + if job not in self.jobs or self.jobs[ job ][ 0 ][ 1 ].history_content_type == "dataset": + self.jobs[ job ] = [ ( representive_job_assoc.name, dataset_collection ) ] + if content.implicit_output_name: + self.implicit_map_jobs.append( job ) + else: + self.jobs[ job ].append( ( representive_job_assoc.name, dataset_collection ) ) # This whole elif condition may no longer be needed do to additional # tracking with creating_job_associations. Will delete at some point. elif content.implicit_output_name: