I was working with quite long GEL script which in the future will be divided in several steps and actions -in order to place in Production-.
For that reason I was interested in writing definitive code including global variables despite that they will be read just some lines below.
Unexpectedly, i found that a global variable (<gel:persist scope="INSTANCE") when it is read from the same action return no value, whereas it has the expected value in later actions or steps etc..
I suppose that there is a technical reason for this behavior - maybe because global info is stored in database -
In which table are these variables stored?
However, if it is the expected behavior, I think it should be included in documentation. What do u think?
From this link i found the following info:
INSTANCE. Set once, use it anywhere in the same process during the current execution.
I just found the below info in the official documentation where the word "beyond" seems to be the key point.
<gel:persist> This tag allows you to set variables with a scope that extends beyond the current script.
XML Open Gateway Developer Guide Release 13.2.00
yes, but if you use the scope="PROCESS" or scope="GLOBAL", the variables are available in the current script.
i have run into this same behavior.
if i define a variable with all 3 scopes (INSTANCE, PROCESS and GLOBAL) in one gel script, and try and reference them in that same script, the INSTANCE scopes shows as NULL, but PROCESS and GLOBAL are visible.
when the subsequent gel script (in the next action) is run, then all 3 are visible.
there's nothing in any documentation regarding the difference in behavior and in, in fact, the 14.4 documentation has this...