Create a Top-Level Caching Example (Managed Package)

For the managed package runtime, an Integration Procedure accepts a list of first or last names and retrieves Contacts having those names. Top-level caching to the VlocityAPIResponse partition improves Contact retrieval performance.

Managed Package app icon This information is for Omnistudio for Managed Packages. For Omnistudio on standard runtime, see Omnistudio Help.

This Integration Procedure also includes a Loop Block; see Process Arrays Using Loop Blocks (Managed Package).

To download a data pack of this example for Omnistudio for Managed Packages, click here.

This Integration Procedure has these components:

  • A Loop Block, named LoopBlock1

  • An Omnistudio Data Mapper Extract Action within the Loop Block, named ExtractContact

  • A Response Action, named ResponseAction

The Structure panel looks like this:

The contents of the Structure panel are listed in the preceding text.

To build this Integration Procedure:

  1. From the Omnistudio Integration Procedures tab, click New.
  2. Provide an Integration Procedure Name, a Type, and a SubType, and click Save.
  3. In the Procedure Configuration, set the Salesforce Platform Cache Type to Org Cache.
  4. Drag a Loop Block component into the Structure panel. Give the Loop Block the following settings:

    Property

    Value

    Loop List

    names

    Additional Loop Output

    ExtractContact set to %ExtractContact%

  5. Create the Data Mapper Extract that the Data Mapper Extract Action calls, name it ExtractContactName, and give it the following settings:

    Tab

    Settings

    Extract

    A Contact extract step set to Contact Name LIKE name

    Output

    A mapping from Contact:Id to Contact:Id

    A mapping from Contact:Name to Contact:Name

    If you aren't sure how to create a Data Mapper Extract, see the examples in Omnistudio Data Mapper Extract Examples (Managed Package).

  6. Drag a Data Mapper Extract Action inside the Loop Block and give it the following settings:

    Property

    Value

    Element Name

    ExtractContact

    Data Mapper Interface

    ExtractContactName

    Data Source

    names:name

    Filter Value

    name

  7. Create the Response Action below the Loop Block and give it the following settings:

    Property

    Value

    Send JSON Path

    LoopBlock1:ExtractContact

    Response JSON Node

    Contact

  8. In the Procedure Configuration, click Activate Version.
  9. On the Preview Tab, click Edit as JSON and provide input with the following structure:
    {
        "names": [
            {
                "name": "Miller"
            },
            {
                "name": "Torres"
            }
        ]
    }

    To demonstrate performance most effectively, specify common names or many names.

  10. Click Execute and note the resulting Browser, Server, and Apex CPU values.
  11. Open the Options pane and change the ignoreCache value to false.
    Under Errors/Debug Output are the Debug Log, errors, and Options panes. The Options pane is expanded to reveal resetCache, ignoreCache, and other options.
  12. Click Execute again. This step populates the cache, so the resulting Browser, Server, and Apex CPU values are likely to be similar to the previous values.
  13. Click Execute a third time. This step uses the cached values, so the resulting Browser, Server, and Apex CPU values are likely to be noticeably less than the previous values. In addition, Cached Response: true appears after the performance metrics.