Merge pull request #2632 from guerler/fix_workflow_data_on_load

Properly initialize datasets when workflow is loaded for execution
This commit is contained in:
John Chilton
2016-07-21 08:52:32 -04:00
committed by GitHub
3 changed files with 7 additions and 2 deletions
+1 -1
View File
@@ -1838,7 +1838,7 @@ class DataToolParameter( BaseDataToolParameter ):
happens twice (here and when generating HTML).
"""
# Can't look at history in workflow mode. Tool shed has no histories.
if trans.workflow_building_mode or trans.app.name == 'tool_shed':
if trans.workflow_building_mode is workflow_building_modes.ENABLED or trans.app.name == 'tool_shed':
return RuntimeValue()
history = self._get_history( trans )
dataset_matcher = DatasetMatcher( trans, self, None, other_values )
@@ -32,6 +32,7 @@ from galaxy.workflow.modules import WorkflowModuleInjector
from galaxy.workflow.render import WorkflowCanvas
from galaxy.workflow.run import invoke
from galaxy.workflow.run import WorkflowRunConfig
from galaxy.tools.parameters.basic import workflow_building_modes
log = logging.getLogger( __name__ )
@@ -1130,6 +1131,7 @@ class WorkflowController( BaseUIController, SharableMixin, UsesStoredWorkflowMix
else:
# Prepare each step
missing_tools = []
trans.workflow_building_mode = workflow_building_modes.USE_HISTORY
for step in workflow.steps:
try:
module_injector.inject( step )
+4 -1
View File
@@ -16,6 +16,7 @@ from galaxy.tools.parameters.basic import (
DataCollectionToolParameter,
DataToolParameter,
RuntimeValue,
workflow_building_modes
)
from galaxy.tools.parameters.wrapped import make_dict_copy
from galaxy.tools import DefaultToolState
@@ -1148,10 +1149,12 @@ class ToolModule( WorkflowModule ):
# Any connected input needs to have value RuntimeValue (these
# are not persisted so we need to do it every time)
def callback( input, prefixed_name, **kwargs ):
def callback( input, prefixed_name, context, **kwargs ):
if isinstance( input, DataToolParameter ) or isinstance( input, DataCollectionToolParameter ):
if connections is None or prefixed_name in input_connections_by_name:
return RuntimeValue()
elif self.trans.workflow_building_mode is workflow_building_modes.USE_HISTORY:
return input.get_initial_value( self.trans, context )
visit_input_values( self.tool.inputs, self.state.inputs, callback )