Table of Contents

Search

  1. Preface
  2. Introduction to Informatica Customer 360 for Salesforce
  3. Configuring the Data Cleansing Settings
  4. Managing Batch Jobs
  5. Verifying Addresses, Email Addresses, and Phone Numbers
  6. Synchronizing Salesforce Records with Customer 360 for Salesforce
  7. Managing Duplicate Records
  8. Consolidating Records
  9. Converting External Records to Salesforce Records
  10. Managing Hierarchies
  11. Integrating Customer 360 for Salesforce with Multidomain MDM
  12. Managing Multi-Org
  13. Troubleshooting
  14. Appendix A: Custom Settings
  15. Appendix B: Glossary

Integrating External Batch Job

Integrating External Batch Job

You can use
Customer 360 for Salesforce
(
Customer 360 for Salesforce
) APIs to push external jobs to the
Customer 360 for Salesforce
batch queue.
You can integrate external Apex batch jobs with the batch queue to get batch statuses, and you can submit external Apex batch jobs to the
Customer 360 for Salesforce
batch queue.
Also register a loop batch job when you want a batch job to launch after a running batch completes. The batch context of the running batch job is passed to the subsequent batch job.
The following code example shows how you can use the QueueManager API to push jobs to the
Customer 360 for Salesforce
batch queue:
global class SampleExternalBatch implements Database.Batchable, Database.Stateful{ private Id cloudMDMJobQueueId = null; private Integer itemProcessed = 0; private Integer totalJobItem = 1000; global Database.QueryLocator start(Database.BatchableContext BC) { cloudMDMJobQueueId = API_QueueManager.start(BC); List<string> accountNames = API_QueueManager.getExtendedParameters (cloudMDMJobQueueId, 'AccountName'); List<string> billingCountry = API_QueueManager.getExtendedParameters (cloudMDMJobQueueId, 'BillingCountry'); API_QueueManager.UpdateStatus(cloudMDMJobQueueId, 'start', 0); return Database.getQueryLocator(<>); } global void execute(Database.BatchableContext BC, List scope) { itemProcessed = itemProcessed + scope.size(); API_QueueManager.updateExecutionProgress(cloudMDMJobQueueId, totalJobItem, itemProcessed); } global void finish(Database.BatchableContext BC) { API_QueueManager.finish(cloudMDMJobQueueId, BATCH_STATUS.SUCCESS); } }
You can use the QueueManager API to perform the following tasks:
  • Submit a batch job to the
    Customer 360 for Salesforce
    batch queue.
    The following code example shows how to submit jobs into the
    Customer 360 for Salesforce
    batch queue:
    API_QueueManager qManager = new API_QueueManager ('CustomBatch', 'ETL_CustomApexBatchJob'); qManager.setQuickParameters (new List<string>{'PARAM1', 'PARAM2', 'PARAM3', 'PARAM4', 'PARAM5', 'PARAM6', 'PARAM7', 'PARAM8'}); qManager.pushExtendedParameters('AccountName', new List<string>{'Informatica', 'EcoLab'}); qManager.pushExtendedParameters('BillingCountry', new List<string>{'USA', 'UK'}); Id batchJobQueueId = qManager.submitJob();
  • Register loop batch jobs.
    The following code example shows how to register batch loop jobs:
    global void finish(Database.BatchableContext BC) { // If more record to process register and loop next chunk or batch if (moreRecordsToProcess ()) { Id newLoopJobId = API_QueueManager.registerJobLoop( cloudMDMJobQueueId); API_QueueManager.submitJob (newLoopJobId); } else { // no more pending records to process. Mark current job as complete API_QueueManager.finish(cloudMDMJobQueueId, BATCH_STATUS.SUCCESS); } }

0 COMMENTS

We’d like to hear from you!