def start(self, state_machine_id=None, start_state_path=None):
        """ Start state machine

        If no state machine is running start a specific state machine.
        If no state machine is provided the currently active state machine is started.
        If there is already a state machine running, just resume it without taking the passed state_machine_id argument
        into account.

        :param state_machine_id: The id if the state machine to be started
        :param start_state_path: The path of the state in the state machine, from which the execution will start
        :return:
        """

        if not self.finished_or_stopped():
            logger.debug("Resume execution engine ...")
            self.run_to_states = []
            if self.state_machine_manager.get_active_state_machine() is not None:
                self.state_machine_manager.get_active_state_machine().root_state.recursively_resume_states()
                if isinstance(state_machine_id, int) and \
                        state_machine_id != self.state_machine_manager.get_active_state_machine().state_machine_id:
                    logger.info("Resumed state machine with id {0} but start of state machine id {1} was requested."
                                "".format(self.state_machine_manager.get_active_state_machine().state_machine_id,
                                          state_machine_id))
            self.set_execution_mode(StateMachineExecutionStatus.STARTED)
        else:
            # do not start another state machine before the old one did not finish its execution
            if self.state_machine_running:
                logger.warning("An old state machine is still running! Make sure that it terminates,"
                               " before you can start another state machine! {0}".format(self))
                return

            logger.debug("Start execution engine ...")
            if state_machine_id is not None:
                self.state_machine_manager.active_state_machine_id = state_machine_id

            if not self.state_machine_manager.active_state_machine_id:
                logger.error("There exists no active state machine!")
                return

            self.set_execution_mode(StateMachineExecutionStatus.STARTED)

            self.start_state_paths = []

            if start_state_path:
                path_list = start_state_path.split("/")
                cur_path = ""
                for path in path_list:
                    if cur_path == "":
                        cur_path = path
                    else:
                        cur_path = cur_path + "/" + path
                    self.start_state_paths.append(cur_path)

            self._run_active_state_machine()
def start ( self , state_machine_id = None , start_state_path = None ) : if not self . finished_or_stopped ( ) : logger . debug ( "Resume execution engine ..." ) self . run_to_states = [ ] if self . state_machine_manager . get_active_state_machine ( ) is not None : self . state_machine_manager . get_active_state_machine ( ) . root_state . recursively_resume_states ( ) if isinstance ( state_machine_id , int ) and state_machine_id != self . state_machine_manager . get_active_state_machine ( ) . state_machine_id : logger . info ( "Resumed state machine with id {0} but start of state machine id {1} was requested." "" . format ( self . state_machine_manager . get_active_state_machine ( ) . state_machine_id , state_machine_id ) ) self . set_execution_mode ( StateMachineExecutionStatus . STARTED ) else : if self . state_machine_running : logger . warning ( "An old state machine is still running! Make sure that it terminates," " before you can start another state machine! {0}" . format ( self ) ) return logger . debug ( "Start execution engine ..." ) if state_machine_id is not None : self . state_machine_manager . active_state_machine_id = state_machine_id if not self . state_machine_manager . active_state_machine_id : logger . error ( "There exists no active state machine!" ) return self . set_execution_mode ( StateMachineExecutionStatus . STARTED ) self . start_state_paths = [ ] if start_state_path : path_list = start_state_path . split ( "/" ) cur_path = "" for path in path_list : if cur_path == "" : cur_path = path else : cur_path = cur_path + "/" + path self . start_state_paths . append ( cur_path ) self . _run_active_state_machine ( )
Start state machine

        If no state machine is running start a specific state machine.
        If no state machine is provided the currently active state machine is started.
        If there is already a state machine running, just resume it without taking the passed state_machine_id argument
        into account.

        :param state_machine_id: The id if the state machine to be started
        :param start_state_path: The path of the state in the state machine, from which the execution will start
        :return: