Returns the final outcome of the child state specified by the state_id.

        :param state_id: The id of the state to get the final outcome for.
        :return:
774885
def get_outcome_for_state_id(self, state_id):
        
        return_value = None
        for s_id, name_outcome_tuple in self.final_outcomes_dict.items():
            if s_id == state_id:
                return_value = name_outcome_tuple[1]
                break
        return return_value
828523
def run_to_states(self):
        
        self.execution_engine_lock.acquire()
        return_value = self._run_to_states
        self.execution_engine_lock.release()
        return return_value
812869
def create_output_dictionary_for_state(state):
        
        from rafcon.core.states.library_state import LibraryState
        result_dict = {}
        for key, data_port in state.output_data_ports.items():
            if isinstance(state, LibraryState) and state.use_runtime_value_output_data_ports[key]:
                result_dict[data_port.name] = copy.copy(state.output_data_port_runtime_values[key])
            else:
                result_dict[data_port.name] = copy.copy(data_port.default_value)
        return result_dict
41734
def get_store_local_final_result(self):
        
        fw_dict = self.get_fw_dict()
        fw_data, fw_data_dict = self.get_fw(fw_dict.get('fw_id'))
        res = fw_data.result
        self.store_local_final_result(res)
1249505
def get_start_state(self, set_final_outcome=False):
        

        # overwrite the start state in the case that a specific start state is specific e.g. by start_from_state
        if self.get_path() in state_machine_execution_engine.start_state_paths:
            for state_id, state in self.states.items():
                if state.get_path() in state_machine_execution_engine.start_state_paths:
                    state_machine_execution_engine.start_state_paths.remove(self.get_path())
                    self._start_state_modified = True
                    return state

        if self.start_state_id is None:
            return None

        # It is possible to connect the income directly with an outcome
        if self.start_state_id == self.state_id:
            if set_final_outcome:
                for transition_id in self.transitions:
                    # the transition of which the from state is None is the transition that directly connects the income
                    if self.transitions[transition_id].from_state is None:
                        to_outcome_id = self.transitions[transition_id].to_outcome
                        self.final_outcome = self.outcomes[to_outcome_id]
                        break
            return self

        return self.states[self.start_state_id]
490218
def get_child(self, usage_id):
        """"""
        if usage_id in self._child_cache:
            return self._child_cache[usage_id]

        child_block = self.runtime.get_block(usage_id, for_parent=self)
        self._child_cache[usage_id] = child_block
        return child_block
68010
def get_task_result(self, task_id):
        
        data = {
            'action': 'get_result',
            'id': task_id
        }
        self.__send_pyobj(data)
        task = self.__recv_pyobj()
        return task
1036350
def _get_last_state(self, state_file):
        """"""
        state = None
        fp = open(state_file)
        try:
            state = int(fp.read())
            print("Found previous state: %d" % (state,))
        finally:
            fp.close()
        return state
931045
def __get_state_by_id(cls, job_id):
    
    state = model.MapreduceState.get_by_job_id(job_id)
    if state is None:
      raise ValueError("Job state for job %s is missing." % job_id)
    return state
446485
def _get_state(self, **kwargs):
        '''
        

        '''

        return self.describe(fields=dict(state=True), **kwargs)["state"]
841004
def get_next_del_state(self, state, ret):
        
        if ret:
            if state == fw_const.INIT_STATE:
                return state
            else:
                return state - 1
        else:
            return state
1145979
def getStateCode(self,state):
        
        return np.dot(state-self.minvalues,self.statecode)
958926
def _handle_forward_execution_after_child_execution(self):
        
        self.add_state_execution_output_to_scoped_data(self.child_state.output_data, self.child_state)
        self.update_scoped_variables_with_output_dictionary(self.child_state.output_data, self.child_state)
        self.execution_history.push_return_history_item(
            self.child_state, CallType.EXECUTE, self, self.child_state.output_data)
        # not explicitly connected preempted outcomes are implicit connected to parent preempted outcome
        transition = self.get_transition_for_outcome(self.child_state, self.child_state.final_outcome)

        if transition is None:
            transition = self.handle_no_transition(self.child_state)
        # if the transition is still None, then the child_state was preempted or aborted, in this case
        # return
        if transition is None:
            return True

        self.last_transition = transition
        self.child_state = self.get_state_for_transition(transition)
        if transition is not None and self.child_state is self:
            self.final_outcome = self.outcomes[transition.to_outcome]

        if self.child_state is self:
            singleton.state_machine_execution_engine._modify_run_to_states(self)
        return False
768369
def fetch_node_manager_states
      states = {}
      @zk.children(current_state_root).each do |child|
        full_path = "#{current_state_root}/#{child}"
        begin
          states[child] = symbolize_keys(decode(@zk.get(full_path).first))
        rescue ZK::Exceptions::NoNode
          # ignore, this is an edge case that can happen when a node manager
          # process dies while fetching its state
        rescue => ex
          logger.error("Failed to fetch states for #{full_path}: #{ex.inspect}")
        end
      end
      states
    end
777893
def _toState(self, state, *args, **kwargs):
        
        try:
            method = getattr(self, '_state_%s' % state)
        except AttributeError:
            raise ValueError("No such state %r" % state)

        log.msg("%s: to state %r" % (self.__class__.__name__, state))
        self._state = state
        method(*args, **kwargs)
959045
def in_state(obj, states, stateflowid='review_state'):
    
    if not states:
        return False
    obj_state = getCurrentState(obj, stateflowid=stateflowid)
    return obj_state in states
1071894
def lastId(self) -> BaseReference:
        
        if self.childIds is not None:
            if len(self.childIds) > 0:
                return self.childIds[-1]
            return None
        else:
            raise NotImplementedError