Run the PopulateCacheOrchestratorApplication Class

You've used Postman to get the session token from your org, configured your IDE for Java, and loaded the orchestration classes into your IDE. Now you're ready to configure and run the PopulateCacheOrchestratorApplication class.

To run the PopulateCacheOrchestratorApplication class in Visual Studio Code:

  1. In Visual Studio Code, click the Explorer icon and expand the CACHE_AND_POPULATE_ORCHESTRATORS pane.

  2. Locate and click the PopulateCacheOrchestratorApplication.java file. The file opens in a tab.

  3. Edit these String values in the file:

    String Value Set the value to
    accessToken The access_token value you saved in the Set Up Postman, Import the Files, and Get the Token task
    orgNamespace vlocity_cmt.
    instanceUrl Your org's hostname, for example https://demo.my.salesforce.com
    catalogCodes The name of a catalog in your org
  4. Make sure the file looks something like this, then save it:

    import com.fasterxml.jackson.core.JsonProcessingException;
    
    import java.net.URISyntaxException;
    import java.util.List;
    
    public class PopulateCacheOrchestratorApplication {
      public static void main(String[] args) throws URISyntaxException, InterruptedException, JsonProcessingException {
        String accessToken = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
        String orgNamespace = "vlocity_cmt";
        String instanceUrl = "https://demo.my.salesforce.com";
        List < String > catalogCodes = List.of("AcmeProductCatalog");
    
        PopulateCacheOrchestrator orchestrator = new PopulateCacheOrchestrator(
          accessToken, orgNamespace, instanceUrl, catalogCodes);
    
        orchestrator.populateCache();
      }
    }
    
  5. Right-click the PopulateCacheOrchestratorApplication.java file and select Run Java.

  6. Watch the TERMINAL pane to see JSON responses for REST API calls appear.

Prepare to Use the Regenerate Cache APIs