Temporary Cache
Introduction
The FacetScript Language allows developers to store data in a temporary store. Temporary store availability is dependent upon the lifecycle of FacetInstance.
List of Commands
Following are list of command at each of the scoping level.
Local Lifespan
SetLocalData
AddLocalData
DelLocalData,
Request/Response Lifespan
SetProcessData
AddProcessData
DelProcessData
Connection Lifespan
SetContextData
AddContextData
DelContextData
FacetInstance Lifespan
SetFacetData
AddFacetData
DelFacetData
Command Format
In FacetScript
<[:CommandName:] [:KeyName:] [:KeyValue:] />
In Javascript
sffContext.[:CommandName:]([:KeyName:], [:KeyValue:])
Temporary Cache Accessibility Rule
Accessibility Code Block | LocalData | ContextData | ProcessData | FacetData |
---|---|---|---|---|
Accessible within same block | YES | YES | YES | YES |
Accessible in other block | NO | YES | YES | YES |
Accessible in two different macros | ||||
If both macros are called within a same request | Yes | Yes | Yes | Yes |
If called in two different requests | NO | NO | NO | Yes |
Accessible in outer macro which call inner macro (Set variables inside this macro) | NO (YES If not inside any block) | YES | YES | YES |
Accessible in facet when we trigger it from macro using create/update query | NO | YES | YES | YES |
Accessible in macro again which triggers facet and set new values inside facet invoke | All will get first value because its async process | |||
Accessible in between invokes (In both FacetScript and Javascript) | NO | Getting different output in different times | NO | YES |
Accessible in output block of action | Not able to print log | |||
Accessible in other TQL Facet( Other project ) | NO | NO | NO | NO |
Accessible in Scheduler action block or not | NO | YES | YES | YES |
when temporary cache Variables are set before starting the Scheduler and attempt is made to access it in a scheduler | No | Yes | Yes | Yes |
If set in one scheduler, and attempt is made to access it in a different scheduler | ||||
Second scheduler is started after stoping the first one | No | No | No | Yes |
Second scheduler is started before stoping the first one | Yes | Yes | Yes | Yes |
For Loop | ||||
when temporary cache variables are set before starting the for block and attempt is made to access it in a block | Yes | Yes | Yes | Yes |
when temp cache var are set in one for loop and attempt is made to access it in different for loop | No | Yes | Yes | Yes |
Select Case: when set in one case block and accessed from different case | No | Yes | Yes | Yes |
If Else Statement | ||||
If set before the If-Else block and accessed within If or else | Yes | Yes | Yes | Yes |
If set in if block and accessed from else | No | Yes | Yes | Yes |