mil.dod.th.ose.core/src/mil/dod/th/ose/core/impl/mp/MissionProgramManagerImpl.java
private boolean execReadyProgram(final ProgramImpl program)
    {
        //evaluate the status of the program
        if (program.getProgramStatus() == ProgramStatus.EXECUTED)
        {
            m_Logging.debug("The program [%s] has already executed, will not run", program.getProgramName());
            return false;
        }

        //check if deps are available
        if (program.getProgramStatus() == ProgramStatus.UNSATISFIED)
        {
            m_Logging.debug("checking if program [%s] dependencies are satisfied", program.getProgramName());
            program.reconcileDependencies();
        }

        //check if the program is initialized, as deps must be satisfied for this to take place
        if (program.getProgramStatus() == ProgramStatus.WAITING_UNINITIALIZED)
        {
            //do not initialize if program should not be executed after a restart
            if (!program.isLoadedAfterReset()
                  || (program.isLoadedAfterReset() && program.getScheduleFlag(ScheduleEnum.START_AT_RESTART)))
            {
                scriptInitialization(program);
            }
            else
            {
                m_Logging.debug("Program [%s] will not run after a restart", program.getProgramName());
            }
        }

        // if dependencies are satisfied execute the program
        if (program.getProgramStatus() == ProgramStatus.WAITING_INITIALIZED)
        {
            m_Logging.debug("deps satisfied, executing program [%s]", program.getProgramName());
            executeProgram(program);
            return true;
        }

        //There are no more possibilities that the program's status can be updated to a 
        //satisfactory state to allow execution right now. The program will be checked again as long as
        //there are no errors with the program.
        m_Logging.debug("Program [%s] could not be executed, state is [%s]", program.getProgramName(), 
                program.getProgramStatus());
        return false;
    }
/**
     * Execute the program if enabled and ready.
     * 
     * @param program
     *      program to execute at restart if ready
     * @return
     *      true if the given program executed, false otherwise
     */
Execute the program if enabled and ready.

@param program
program to execute at restart if ready
@return
true if the given program executed, false otherwise
Execute the program if enabled and ready . @param program program to execute at restart if ready @return true if the given program executed false otherwise
private boolean execReadyProgram(final ProgramImpl program)
    {
        if (program.getProgramStatus() == ProgramStatus.EXECUTED)
        {
            m_Logging.debug("The program [%s] has already executed, will not run", program.getProgramName());
            return false;
        }
        if (program.getProgramStatus() == ProgramStatus.UNSATISFIED)
        {
            m_Logging.debug("checking if program [%s] dependencies are satisfied", program.getProgramName());
            program.reconcileDependencies();
        }
        if (program.getProgramStatus() == ProgramStatus.WAITING_UNINITIALIZED)
        {
            if (!program.isLoadedAfterReset()
                  || (program.isLoadedAfterReset() && program.getScheduleFlag(ScheduleEnum.START_AT_RESTART)))
            {
                scriptInitialization(program);
            }
            else
            {
                m_Logging.debug("Program [%s] will not run after a restart", program.getProgramName());
            }
        }
        if (program.getProgramStatus() == ProgramStatus.WAITING_INITIALIZED)
        {
            m_Logging.debug("deps satisfied, executing program [%s]", program.getProgramName());
            executeProgram(program);
            return true;
        }
        m_Logging.debug("Program [%s] could not be executed, state is [%s]", program.getProgramName(), 
                program.getProgramStatus());
        return false;
    }
private boolean execReadyProgram ( final ProgramImpl program ) { if ( program . getProgramStatus ( ) == ProgramStatus . EXECUTED ) { m_Logging . debug ( "The program [%s] has already executed, will not run" , program . getProgramName ( ) ) ; return false ; } if ( program . getProgramStatus ( ) == ProgramStatus . UNSATISFIED ) { m_Logging . debug ( "checking if program [%s] dependencies are satisfied" , program . getProgramName ( ) ) ; program . reconcileDependencies ( ) ; } if ( program . getProgramStatus ( ) == ProgramStatus . WAITING_UNINITIALIZED ) { if ( ! program . isLoadedAfterReset ( ) || ( program . isLoadedAfterReset ( ) && program . getScheduleFlag ( ScheduleEnum . START_AT_RESTART ) ) ) { scriptInitialization ( program ) ; } else { m_Logging . debug ( "Program [%s] will not run after a restart" , program . getProgramName ( ) ) ; } } if ( program . getProgramStatus ( ) == ProgramStatus . WAITING_INITIALIZED ) { m_Logging . debug ( "deps satisfied, executing program [%s]" , program . getProgramName ( ) ) ; executeProgram ( program ) ; return true ; } m_Logging . debug ( "Program [%s] could not be executed, state is [%s]" , program . getProgramName ( ) , program . getProgramStatus ( ) ) ; return false ; }
Execute the program if enabled and ready.
Execute the program if enabled and ready .
//evaluate the status of the program //check if deps are available //check if the program is initialized, as deps must be satisfied for this to take place //do not initialize if program should not be executed after a restart // if dependencies are satisfied execute the program //There are no more possibilities that the program's status can be updated to a  //satisfactory state to allow execution right now. The program will be checked again as long as //there are no errors with the program.