A global variable is a variable that is accessible from any session in the same execution. You can use ALH API to create a global variable and specify its value by calling ALH.setGlobalVariable(String variableName, Object value).
public void setGlobalVariable(String variableName, Object value) { ... }
The code example is as follows
ALH.setGlobalVariable("GLOBAL_COUNT", 1);
The example code assigns 1 to a global variable named GLOBAL_COUNT. If the global variable with the given name does not exist, this method will create a new global variable with the same name and add the value to it.