def _get_wf_resource_from_db_model(wf_ex, include_output): if include_output: rest_utils.load_deferred_fields(wf_ex, ['params', 'input', 'output']) else: rest_utils.load_deferred_fields(wf_ex, ['params', 'input']) return resources.Execution.from_db_model(wf_ex)
def _get_task_execution(id): with db_api.transaction(): task_ex = db_api.get_task_execution(id) rest_utils.load_deferred_fields(task_ex, ['workflow_execution']) rest_utils.load_deferred_fields( task_ex.workflow_execution, ['context', 'input', 'params', 'root_execution']) return _get_task_resource_with_result(task_ex), task_ex
def _get_workflow_execution(id, must_exist=True): with db_api.transaction(): if must_exist: wf_ex = db_api.get_workflow_execution(id) else: wf_ex = db_api.load_workflow_execution(id) return rest_utils.load_deferred_fields( wf_ex, ['params', 'input', 'output', 'context', 'spec'])
def _get_workflow_execution_resource(wf_ex): rest_utils.load_deferred_fields(wf_ex, ['params', 'input']) return resources.Execution.from_db_model(wf_ex)
def _get_task_executions(wf_id): with db_api.transaction(): task_execs = db_api.get_task_executions(workflow_execution_id=wf_id) for task_ex in task_execs: rest_utils.load_deferred_fields(task_ex, ['spec']) return task_execs