Merge pull request #2625 from jmchilton/history_extract_fixes_2

Fixes for workflow extraction of mapping collection jobs.
This commit is contained in:
Dannon Baker
2016-07-22 09:26:23 -04:00
committed by GitHub
2 changed files with 14 additions and 9 deletions
+3
View File
@@ -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 ]
+11 -9
View File
@@ -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: