Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Global variables are very useful to persist information either:

  • between elements within the execution of a logic 
  • between executions of a logic for a set of items (i.e. PG, PL ...) if 'api.retainGlobal = true' is called


This 'retainGlobal' works also to make use of global variables during executions of both 1st and 2nd pass (i.e. dirty pass).

BUT given that the second pass is a whole new JST, the global variables are persisted between the 2 passes.

The persistence is done in JSON.


So if you have a complex object (such as a 'Filter') and you store it in a global variable.

As long as you are in the first pass, this global variable can be retrieved from global cache as a 'Filter' object.

But during the second pass, if you retrieve it you will get the JSON representation of this object !!!

And making use of this in your logic might cause errors.

  • No labels