agave-jobs/jobs-core/src/main/java/org/iplantc/service/jobs/managers/launchers/StartupScriptJobMacroResolver.java
/**
     * The {@code startupScript} is a optional path to a file residing on, and defined by, the {@link ExecutionSystem}
     * of this job. The path may include job macros similar to the app wrapper template. This method resolves any
     * macros in path (not the actual file), and returns it for use building the submit command.
     *
     * @return the {@code startupScript} file path on the remote system, filtered for any job macros
     * @throws JobMacroResolutionException when the execution system or batch queue is not available
     */
The  startupScript is a optional path to a file residing on, and defined by, the  ExecutionSystem
of this job. The path may include job macros similar to the app wrapper template. This method resolves any
macros in path (not the actual file), and returns it for use building the submit command.

@return the  startupScript file path on the remote system, filtered for any job macros
@throws JobMacroResolutionException when the execution system or batch queue is not available
The startupScript is a optional path to a file residing on and defined by the ExecutionSystem of this job . The path may include job macros similar to the app wrapper template . This method resolves any macros in path ( not the actual file ) and returns it for use building the submit command . @return the startupScript file path on the remote system filtered for any job macros @throws JobMacroResolutionException when the execution system or batch queue is not available
public String resolve() throws JobMacroResolutionException
    {
            ExecutionSystem executionSystem = getExecutionSystem();
            String startupScript = executionSystem.getStartupScript();
            if (StringUtils.isBlank(startupScript)) {
                return null;
            }
            else {
                String resolvedStartupScript = startupScript;
                for (StartupScriptSystemVariableType systemMacro: StartupScriptSystemVariableType.values()) {
                    String escapedSystemMacro = "${" + systemMacro.name() + "}";
                    if (resolvedStartupScript.contains(escapedSystemMacro)) {
                        resolvedStartupScript = StringUtils.replace(resolvedStartupScript, escapedSystemMacro, resolveStartupScriptSystemMacros(executionSystem, systemMacro));
                    }
                }
                for (StartupScriptJobVariableType jobMacro: StartupScriptJobVariableType.values()) {
                    String escapedJobMacro = "${" + jobMacro.name() + "}";
                    if (resolvedStartupScript.contains(escapedJobMacro)) {
                        resolvedStartupScript = StringUtils.replace(resolvedStartupScript, escapedJobMacro, resolveStartupScriptJobMacro(getJob(), executionSystem, jobMacro));
                    }
                }
                return resolvedStartupScript;
            }
    }
public String resolve ( ) throws JobMacroResolutionException { ExecutionSystem executionSystem = getExecutionSystem ( ) ; String startupScript = executionSystem . getStartupScript ( ) ; if ( StringUtils . isBlank ( startupScript ) ) { return null ; } else { String resolvedStartupScript = startupScript ; for ( StartupScriptSystemVariableType systemMacro : StartupScriptSystemVariableType . values ( ) ) { String escapedSystemMacro = "${" + systemMacro . name ( ) + "}" ; if ( resolvedStartupScript . contains ( escapedSystemMacro ) ) { resolvedStartupScript = StringUtils . replace ( resolvedStartupScript , escapedSystemMacro , resolveStartupScriptSystemMacros ( executionSystem , systemMacro ) ) ; } } for ( StartupScriptJobVariableType jobMacro : StartupScriptJobVariableType . values ( ) ) { String escapedJobMacro = "${" + jobMacro . name ( ) + "}" ; if ( resolvedStartupScript . contains ( escapedJobMacro ) ) { resolvedStartupScript = StringUtils . replace ( resolvedStartupScript , escapedJobMacro , resolveStartupScriptJobMacro ( getJob ( ) , executionSystem , jobMacro ) ) ; } } return resolvedStartupScript ; } }
The {@code startupScript} is a optional path to a file residing on, and defined by, the {@link ExecutionSystem}
 of this job.
The { @code startupScript } is a optional path to a file residing on and defined by the { @link ExecutionSystem } of this job .
//        try { // checking for existence first so we can skip resolving the value when not necessary // checking for existence first so we can skip resolving the value when not necessary //        } catch (SystemUnavailableException e) { //            throw new JobMacroResolutionException("Execution system " + getJob().getSystem() + //                    " is no longer available to resolve batch queue for job " + getJob().getUuid()); //        }