def _pre_submit_check()

in src/pydolphinscheduler/core/workflow.py [0:0]


    def _pre_submit_check(self):
        """Check specific condition satisfy before.

        This method should be called before workflow submit to java gateway
        For now, we have below checker:
        * `self.param` or at least one local param of task should be set if task `switch` in this workflow.
        """
        if (
            any([task.task_type == TaskType.SWITCH for task in self.tasks.values()])
            and self.param is None
            and all([len(task.local_params) == 0 for task in self.tasks.values()])
        ):
            raise PyDSParamException(
                "Parameter param or at least one local_param of task must "
                "be provider if task Switch in workflow."
            )