Get dict of ALL known workflow definitions.

    Returns
        list[dict]
426560
def get_workflows() -> dict:
    
    keys = DB.get_keys("workflow_definitions:*")
    known_workflows = dict()
    for key in keys:
        values = key.split(':')
        if values[1] not in known_workflows:
            known_workflows[values[1]] = list()
        known_workflows[values[1]].append(values[2])

    return known_workflows
652838
def load_workflow_from_cache(self):
        
        if not self.current.new_token:
            self.wf_state = self.current.wf_cache.get(self.wf_state)
            self.current.task_data = self.wf_state['data']
            self.current.set_client_cmds()
            self.current.pool = self.wf_state['pool']
            return self.wf_state['step']
641781
def _get_validated_stages(stages):
    
    if not isinstance(stages, list):
        raise WorkflowBuilderException("Stages must be specified as a list of dictionaries")
    validated_stages = []
    for index, stage in enumerate(stages):
        validated_stages.append(_get_validated_stage(stage, index))
    return validated_stages
527107
def _get_registries(self):
        
        if self.workflow.buildstep_result.get(PLUGIN_BUILD_ORCHESTRATE_KEY):
            registries = self.workflow.push_conf.pulp_registries
            if not registries:
                registries = self.workflow.push_conf.all_registries
            return registries
        else:
            return self.workflow.push_conf.all_registries
984750
def _wf_to_dict(wf, records):
    
    inputs, outputs, records = _get_wf_inout(wf, records)
    out = {"name": _id_to_name(_clean_id(wf.tool["id"])), "inputs": inputs,
           "outputs": outputs, "steps": [], "subworkflows": [],
           "requirements": []}
    for step in wf.steps:
        is_subworkflow = isinstance(step.embedded_tool, cwltool.workflow.Workflow)
        inputs, outputs, remapped, prescatter = _get_step_inout(step)
        inputs, scatter = _organize_step_scatter(step, inputs, remapped)
        if is_subworkflow:
            wf_def, records = _wf_to_dict(step.embedded_tool, records)
            out["subworkflows"].append({"id": "%s.%s" % (wf_def["name"], wf_def["name"]), "definition": wf_def,
                                        "inputs": inputs, "outputs": outputs, "scatter": scatter,
                                        "prescatter": prescatter})
        else:
            task_def, records = _tool_to_dict(step.embedded_tool, records, remapped)
            out["steps"].append({"task_id": task_def["name"], "task_definition": task_def,
                                 "inputs": inputs, "outputs": outputs, "scatter": scatter,
                                 "prescatter": prescatter})
    return out, records
775179
def get_dict_for_mongodb_queries(self):
        
        d = {}
        return d
        # TODO
        all_structures = [task.input.structure for task in self.iflat_tasks()]
        all_pseudos = [task.input.pseudos for task in self.iflat_tasks()]
261005
def parse_workflow_call(self, i):
        '''
        
        '''
        task_being_called = self.parse_workflow_call_taskname(i.attr("task"))
        task_alias = self.parse_workflow_call_taskalias(i.attr("alias"))
        io_map = self.parse_workflow_call_body(i.attr("body"))

        if not task_alias:
            task_alias = task_being_called

        return {'task': task_being_called, 'alias': task_alias, 'io': io_map}
43669
def workflow_stages(self) -> List[WorkflowStage]:
        
        workflow_stages = []
        stages = DB.get_hash_value(self.key, 'workflow_stages')
        for index in range(len(ast.literal_eval(stages))):
            workflow_stages.append(WorkflowStage(self.id, index))
        return workflow_stages
545357
def _load_config(self):
        """"""
        pb_key = SchedulingObject.get_key(PB_KEY, self._pb_id)
        stages = DB.get_hash_value(pb_key, 'workflow_stages')
        stages = ast.literal_eval(stages)
        return stages[self._index]
81481
def get_works(self):
        
        return [os.path.split(filepath)[1] for filepath in
                glob.glob(os.path.join(self._path, '*'))
                if os.path.isdir(filepath)]
437763
def workflow_get_details(object_id, input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/%s/getDetails' % object_id, input_params, always_retry=always_retry, **kwargs)
855076
def getDict(self):
        
        # We are going to have to return the dict so let's
        # first make sure all of our models are up to date with the values in
        # the GUI right now.
        badList = self.checkSetSaveEntries(doSave=False)
        if badList:
            self.processBadEntries(badList, self.taskName, canCancel=False)
        return self._taskParsObj.dict()
1043184
def _get_task_kwargs(self):
        
        res = {}
        for (param_name, param_obj) in self._get_task_cls().get_params():
            attr = getattr(self.known_args, param_name)
            if attr:
                res.update(((param_name, param_obj.parse(attr)),))

        return res
896662
def find_workflow_path(self):
        
        for pth in settings.WORKFLOW_PACKAGES_PATHS:
            path = "%s/%s.bpmn" % (pth, self.current.workflow_name)
            if os.path.exists(path):
                return path
        err_msg = "BPMN file cannot found: %s" % self.current.workflow_name
        log.error(err_msg)
        raise RuntimeError(err_msg)
1182222
def tasks(self):
        
        if self._tasks is None:
            self._tasks = TaskList(self._version, workspace_sid=self._solution['sid'], )
        return self._tasks
282229
def _build_underlying_workflows(enabled_regions, json_spec, args):
    
    projects_by_region = _create_temporary_projects(enabled_regions, args)
    workflows_by_region = {}

    try:
        for region, project in projects_by_region.items():
            json_spec['project'] = project
            workflow_id = _build_regular_workflow(json_spec)
            logger.debug("Created workflow " + workflow_id + " successfully")
            workflows_by_region[region] = workflow_id
    except:
        # Clean up
        if projects_by_region:
            dxpy.executable_builder.delete_temporary_projects(projects_by_region.values())
        raise

    return workflows_by_region, projects_by_region
741542
def get_current_task_info(self):
        """"""
        name = self.model.workflow.name
        if not name:
            return

        current_task = workflows[name].workflow
        for step in self.callback_pos:
            current_task = current_task[step]
            if callable(current_task):
                return get_func_info(current_task)