You can check if a global variable is defined in an environment by calling the isGlobalVariable(String variableName) method

If the global variable specified by the given variable name is present in the scripting environment, this method will return true. Otherwise, it returns false.

public boolean isGlobalVariable(String variableName) {
...
}


The following code fragment shows how to check if a global variable, e.g., GLOBAL_COUNT, is defined through ALH API.

ALH.isGlobalVariable("GLOBAL_COUNT");	// Returns true or false.