Clarity

Expand all | Collapse all

gel:persist  - Definition and access from same action(script)

  • 1.  gel:persist  - Definition and access from same action(script)

    Posted 06-07-2017 12:44 PM

    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.



  • 2.  Re:  gel:persist  - Definition and access from same action(script)

    Posted 06-08-2017 12:19 PM

    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 



  • 3.  Re:  gel:persist  - Definition and access from same action(script)

    Posted 02-08-2018 05:47 AM

    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...

    • GLOBAL. Set once, use it anywhere.
    • PROCESS. Set once, use it anywhere in the same process.
    • INSTANCE. Set once, use it anywhere in the same process during the current execution.

     

    Any thoughts?

    Thanks

    B