def process_next_step()

in workflows-generator/WorkflowsGenerator.py [0:0]


    def process_next_step(self,steps, step, index, level_id, thread_id, step_body, single_thread):
        """method to process next step"""
        if step.get("TYPE") in ('sync', 'async', 'workflows'):
            if "NEXT" not in step.keys():
                try:
                    next_step = steps[index + 1]
                    #next_step_name = next_step.get("JOB_ID") + "_" + next_step.get("JOB_NAME")
                    next_step_name = next_step.get("JOB_NAME")
                    step_body = step_body.replace("{NEXT_JOB_ID}", next_step_name)
                except (KeyError, IndexError):
                    if level_exists(int(level_id) + 1, self.workflow_config) and single_thread:
                        if level_exists_and_is_parallel(int(level_id) + 1, self.workflow_config):
                            step_body = step_body.replace("{NEXT_JOB_ID}",
                                                     "Level_" + str(int(level_id) + 1))
                        else:
                            step_body = step_body.replace("{NEXT_JOB_ID}",
                                                          "Level_" + str(int(level_id) + 1) + "_Thread_" + thread_id)
                    else:
                        if single_thread:
                            step_body = step_body.replace("{NEXT_JOB_ID}","end")
                        else:
                            step_body = step_body.replace("{NEXT_JOB_ID}","continue")
            else:
                next_step = find_step_by_id(step.get("NEXT"))
                #next_step_name = next_step.get("JOB_ID") + "_" + next_step.get("JOB_NAME")
                next_step_name = next_step.get("JOB_NAME")
                step_body = step_body.replace("{NEXT_JOB_ID}", next_step_name)

        return step_body