Cache Fetch Flow Behavior
  • 15 Feb 2021
  • 1 Minute to read
  • Dark
    Light

Cache Fetch Flow Behavior

  • Dark
    Light

Article Summary

Overview

This tutorial demonstrates how to use Cache Fetch Flow Behavior. This Flow Behavior can be used to fill the Cache in with data that needs to be kept for a certain period of time. Additionally, this tutorial demonstrates how to get a collection of data from the cache.

In the following example, Cache a collection of Account Emails. Next, this Flow will fill a custom created Cache Type. Finally, a second Flow will get all items from the custom Cache Type.



Example

  1. From a Designer Project, select CREATE FLOW from the top Action bar. 
    1. Select Flow, provide a Name, and click CREATE.
  2. Navigate to the Properties tab on the right.
  3. Under the SETTINGS section, select System Cache Flow Behavior from the Behavior Type dropdown menu.
  4. Attach a GetAll step from the INTEGRATION > INTERNAL SERVICES > ACCOUNTSERVICE category of the Toolbox tab; connect the Done path to the Cache Value step.
  5. Select the Cache Value step to navigate to its Properties tab.
  6. Select From Flow map GetAll1_Output.All EmailAddress to INPUTS > Value.
  7. Save the Flow, then close with X.



Define Cache Type

  1. From System > Administration > Cache, select ADD > TimeCacheDefinition from the top Action bar.  
  2. In the TimeCacheDefinition dialog, under CACHE, check Fill Cache Using Flow; then, from Cache Fill Flow, PICK the Flow that was previously created in the beginning example.
  3. Under CACHE INFORMATION, provide a Configuration Name
  4. Under TIME CACHE DEFINITION INFO, from the Target Cache Config Name dropdown, Select Default.MemoryCache.
  5. Click SAVE.
  6. Verify that the Cache was created in the Cache Folder
  7. From a Designer Project, select CREATE FLOW from the top Action bar; select Flow, provide a Name, and click CREATE.
  8. Attach a [List] Get From Cache step from the SYSTEM > CACHING category of the Toolbox tab, to the Start and End steps. 
  9. Navigate to and define the Properties tab for the [List] Get From Cache step.
    1. Provide a Cache Instance Name and from the CachTypeName drop-down; select the Cache that was previously created.
    2. Constant map, "Emails" to INPUTS > Key. 
  10. Save the Flow, then if desired, close via X



Debug

  1. From the Flow Designer, click the Debug link on the top Action bar.
  2. Click START DEBUGGING. 
  3. Click the [List] Get From Cache step, and select View Input/Output Data.
    The Output Data will display a list of the cached data. 


Was this article helpful?