<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def run_to_selected_state(self, path, state_machine_id=None):
 """Execute the state machine until a specific state. This state won't be executed. This is an asynchronous task """

        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 not self.finished_or_stopped():
            logger.debug("Resume execution engine and run to selected state!")
            self.run_to_states = []
            self.run_to_states.append(path)
            self.set_execution_mode(StateMachineExecutionStatus.RUN_TO_SELECTED_STATE)
        else:
            logger.debug("Start execution engine and run to selected state!")
            if state_machine_id is not None:
                self.state_machine_manager.active_state_machine_id = state_machine_id
            self.set_execution_mode(StateMachineExecutionStatus.RUN_TO_SELECTED_STATE)
            self.run_to_states = []
            self.run_to_states.append(path)
            self._run_active_state_machine()