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 BlockLocalDataContextDataProcessDataFacetData
Accessible within same blockYESYESYESYES
Accessible in other blockNOYESYESYES
Accessible in two different macros    
If both macros are called within a same requestYesYesYesYes
If called in two different requestsNONONOYes
Accessible in outer macro which call inner macro (Set variables inside this macro)NO (YES If not inside any block)YESYESYES
 Accessible in facet when we trigger it from macro using create/update queryNOYESYESYES
Accessible in macro again which triggers facet and set new values inside facet invokeAll will get first value because its async process
Accessible in between invokes (In both FacetScript and Javascript)NOGetting different output in different timesNOYES
Accessible in output block of actionNot able to print log
Accessible in other TQL Facet( Other project )NONONONO
Accessible in Scheduler action block or notNOYESYESYES
when temporary cache Variables are set before starting the Scheduler and attempt is made to access it in a schedulerNoYesYesYes
If set in one scheduler, and attempt is made to access it in a different scheduler    
Second scheduler is started after stoping the first oneNoNoNoYes
Second scheduler is started before stoping the first oneYesYesYesYes
For Loop    
when temporary cache variables are set before starting the for block and attempt is made to access it in a blockYesYesYesYes
when temp cache var are set in one for loop and attempt is made to access it in different for loopNoYesYesYes
Select Case: when set in one case block and accessed from different caseNoYesYesYes
If Else Statement    
If set before the If-Else block and accessed within If or else YesYesYesYes
If set in if block and accessed from elseNoYesYesYes