agave-jobs/jobs-core/src/main/java/org/iplantc/service/jobs/managers/launchers/CondorLauncher.java
/**
	 * Parses all the inputs, parameters, and macros for the given string. This is appropriate for both resolving
     * wrapper templates and condor submit scripts.
	 * 
	 * @param appTemplate the wrapper template as provided by the app definition
	 * @return fully resolved template to run and start the condor job
	 * @throws JobException if unable to parse the job template
	 * @throws URISyntaxException when invalid input URI are found in the job inputs.
	 */
Parses all the inputs, parameters, and macros for the given string. This is appropriate for both resolving
wrapper templates and condor submit scripts.

@param appTemplate the wrapper template as provided by the app definition
@return fully resolved template to run and start the condor job
@throws JobException if unable to parse the job template
@throws URISyntaxException when invalid input URI are found in the job inputs.
Parses all the inputs parameters and macros for the given string . This is appropriate for both resolving wrapper templates and condor submit scripts . @param appTemplate the wrapper template as provided by the app definition @return fully resolved template to run and start the condor job @throws JobException if unable to parse the job template @throws URISyntaxException when invalid input URI are found in the job inputs .
protected String resolveTemplateMacros(String appTemplate)
	throws JobException, URISyntaxException, JobMacroResolutionException {
		JsonNode jobParameters = getJob().getParametersAsJsonObject();
		for (SoftwareParameter param: getSoftware().getParameters())
		{
			if (jobParameters.has(param.getKey())) 
			{
				JsonNode jobJsonParam = jobParameters.get(param.getKey());
				String templateVariableValue = parseSoftwareParameterValueIntoTemplateVariableValue(param, jobJsonParam);
				appTemplate = appTemplate.replaceAll("(?i)\\$\\{" + param.getKey() + "\\}", templateVariableValue);
			}
			else if (!param.isVisible())
			{
				String templateVariableValue = parseSoftwareParameterValueIntoTemplateVariableValue(param, param.getDefaultValueAsJsonArray());
				appTemplate = appTemplate.replaceAll("(?i)\\$\\{" + param.getKey() + "\\}", templateVariableValue);
			}
			else 
			{
				appTemplate = appTemplate.replaceAll("(?i)\\$\\{" + param.getKey() + "\\}", "");
			}
		}
		JsonNode jobInputs = getJob().getInputsAsJsonObject();
		for (SoftwareInput input: getSoftware().getInputs())
		{
			if (jobInputs.has(input.getKey())) 
			{
				JsonNode jobJsonInput = jobInputs.get(input.getKey());
				String templateVariableValue = parseSoftwareInputValueIntoTemplateVariableValue(input, jobJsonInput);
				appTemplate = appTemplate.replaceAll("(?i)\\$\\{" + input.getKey() + "\\}", templateVariableValue);
			}
			else if (!input.isVisible())
			{
				String templateVariableValue = parseSoftwareInputValueIntoTemplateVariableValue(input, input.getDefaultValueAsJsonArray());
				appTemplate = appTemplate.replaceAll("(?i)\\$\\{" + input.getKey() + "\\}", templateVariableValue);
			}
			else 
			{
				appTemplate = appTemplate.replaceAll("(?i)\\$\\{" + input.getKey() + "\\}", "");
			}
		}
		if (getExecutionSystem().isPubliclyAvailable()) {
			appTemplate = CommandStripper.strip(appTemplate);
		}
		appTemplate = filterRuntimeStatusMacros(appTemplate);
		appTemplate = resolveRuntimeNotificationMacros(appTemplate);
		appTemplate = resolveMacros(appTemplate);
		return appTemplate;
	}
protected String resolveTemplateMacros ( String appTemplate ) throws JobException , URISyntaxException , JobMacroResolutionException { JsonNode jobParameters = getJob ( ) . getParametersAsJsonObject ( ) ; for ( SoftwareParameter param : getSoftware ( ) . getParameters ( ) ) { if ( jobParameters . has ( param . getKey ( ) ) ) { JsonNode jobJsonParam = jobParameters . get ( param . getKey ( ) ) ; String templateVariableValue = parseSoftwareParameterValueIntoTemplateVariableValue ( param , jobJsonParam ) ; appTemplate = appTemplate . replaceAll ( "(?i)\\$\\{" + param . getKey ( ) + "\\}" , templateVariableValue ) ; } else if ( ! param . isVisible ( ) ) { String templateVariableValue = parseSoftwareParameterValueIntoTemplateVariableValue ( param , param . getDefaultValueAsJsonArray ( ) ) ; appTemplate = appTemplate . replaceAll ( "(?i)\\$\\{" + param . getKey ( ) + "\\}" , templateVariableValue ) ; } else { appTemplate = appTemplate . replaceAll ( "(?i)\\$\\{" + param . getKey ( ) + "\\}" , "" ) ; } } JsonNode jobInputs = getJob ( ) . getInputsAsJsonObject ( ) ; for ( SoftwareInput input : getSoftware ( ) . getInputs ( ) ) { if ( jobInputs . has ( input . getKey ( ) ) ) { JsonNode jobJsonInput = jobInputs . get ( input . getKey ( ) ) ; String templateVariableValue = parseSoftwareInputValueIntoTemplateVariableValue ( input , jobJsonInput ) ; appTemplate = appTemplate . replaceAll ( "(?i)\\$\\{" + input . getKey ( ) + "\\}" , templateVariableValue ) ; } else if ( ! input . isVisible ( ) ) { String templateVariableValue = parseSoftwareInputValueIntoTemplateVariableValue ( input , input . getDefaultValueAsJsonArray ( ) ) ; appTemplate = appTemplate . replaceAll ( "(?i)\\$\\{" + input . getKey ( ) + "\\}" , templateVariableValue ) ; } else { appTemplate = appTemplate . replaceAll ( "(?i)\\$\\{" + input . getKey ( ) + "\\}" , "" ) ; } } if ( getExecutionSystem ( ) . isPubliclyAvailable ( ) ) { appTemplate = CommandStripper . strip ( appTemplate ) ; } appTemplate = filterRuntimeStatusMacros ( appTemplate ) ; appTemplate = resolveRuntimeNotificationMacros ( appTemplate ) ; appTemplate = resolveMacros ( appTemplate ) ; return appTemplate ; }
Parses all the inputs, parameters, and macros for the given string.
Parses all the inputs parameters and macros for the given string .
// replace the parameters with their passed in values // serialized the runtime parameters into a string of space-delimited  // values after enquoting and adding relevant argument(s) // now actually filter the template for this parameter // serialized the runtime parameters into a string of space-delimited  // values after enquoting and adding relevant argument(s) // now actually filter the template for this parameter // replace the parameters with their passed in values // serialized the runtime parameters into a string of space-delimited  // values after enquoting and adding relevant argument(s) // now actually filter the template for this parameter // serialized the runtime parameters into a string of space-delimited  // values after enquoting and adding relevant argument(s) // now actually filter the template for this parameter // strip out all references to icommands and it irods shadow files // strip out premature completion callbacks that might result in archiving starting before // the script exists. // Replace all the runtime callback notifications // Replace all the agave job attribute macros