Skip to content
Elucidation edited this page Jun 28, 2011 · 5 revisions

Currently it's hardCoded into doCheck() function which does a boolaen check on the option, resulting in whether that option is displayed or not.

The function is ready to be replaced with an external system such as an SQL database for reduction checks or an OWL ontology w/ inference engine for a full suite of semantic relationships.

the doCheck() function

private boolean doCheck(EnvConfigOption option) {
	// Checks if there is special circumstance for field given
	// This hardcoding needs to be moved to either SQL table merges of some sort (for deduction only)
	// Or for a more powerful comparison, OWL ontology inference engine.
	
	// RUN_STARTDATE only allowed if RUN_TYPE == Startup|Hybrid
	//System.err.println(":: "+option.getName() + " vs " + template.getEnvConfigValue("RUN_TYPE"));
	if (option.getName().equalsIgnoreCase("RUN_STARTDATE")
		&& template.getEnvConfigValue("RUN_TYPE").equalsIgnoreCase("Branched")) {
		return false;
	} 
	// RUN_REFDATE&RUN_REFCASE ignored for RUN_TYPE == Startup (default)
	if ((option.getName().equalsIgnoreCase("RUN_REFDATE") || option.getName().equalsIgnoreCase("RUN_REFCASE"))
		&& (template.getEnvConfigValue("RUN_TYPE").equalsIgnoreCase("startup")
		|| template.getEnvConfigValue("RUN_TYPE").equalsIgnoreCase(""))) {
		return false;
	}
	// RUN_REFCASE ignored for RUN_TYPE == Startup (default)
	
	return true;
}