expose StoredWorkflowId in invocation API

This commit is contained in:
Simon Bray
2021-04-22 11:39:49 +02:00
committed by Jelle Scholtalbers
parent b2d63cd71b
commit c799e4a455
2 changed files with 7 additions and 2 deletions
+1
View File
@@ -5514,6 +5514,7 @@ class WorkflowInvocation(UsesCreateAndUpdateTime, Dictifiable, RepresentById):
def to_dict(self, view='collection', value_mapper=None, step_details=False, legacy_job_state=False):
rval = super().to_dict(view=view, value_mapper=value_mapper)
rval['stored_workflow_id'] = self.workflow.stored_workflow.id
if view == 'element':
steps = []
for step in self.steps:
+6 -2
View File
@@ -835,7 +835,7 @@ class WorkflowsAPIController(BaseAPIController, UsesStoredWorkflowMixin, UsesAnn
:func:`galaxy.webapps.galaxy.api.workflows.WorkflowsAPIController.create` above.
"""
# Get workflow + accessibility check.
stored_workflow = self.__get_stored_accessible_workflow(trans, workflow_id)
stored_workflow = self.__get_stored_accessible_workflow(trans, workflow_id, instance=kwd.get('instance', False))
workflow = stored_workflow.latest_workflow
run_configs = build_workflow_run_configs(trans, workflow, payload)
is_batch = payload.get('batch')
@@ -880,6 +880,10 @@ class WorkflowsAPIController(BaseAPIController, UsesStoredWorkflowMixin, UsesAnn
:param workflow_id: an encoded stored workflow id to restrict query to
:type workflow_id: str
:param instance: true if fetch by Workflow ID instead of StoredWorkflow id, false
by default.
:type instance: boolean
:param history_id: an encoded history id to restrict query to
:type history_id: str
@@ -895,7 +899,7 @@ class WorkflowsAPIController(BaseAPIController, UsesStoredWorkflowMixin, UsesAnn
:raises: exceptions.MessageException, exceptions.ObjectNotFound
"""
if workflow_id is not None:
stored_workflow_id = self.__get_stored_workflow(trans, workflow_id).id
stored_workflow_id = self.__get_stored_workflow(trans, workflow_id, instance=kwd.get('instance', False)).id
else:
stored_workflow_id = None