Batch Action

Estimated reading: 2 minutes 5 views

The Batch action allows you to execute a batch process using the Wattyo Batch Manager. This action is ideal for processing large volumes of records or performing complex calculations in a scalable and efficient manner.

Batch action detail

Key Features

  • Supports scalable batch processing using Salesforce’s batch execution framework.
  • Enables dynamic configuration of batch parameters, such as SOQL queries and execution modes.
  • Provides flexibility to control batch size and thread usage for optimized performance.

Configuring a Batch Action

When adding a Batch action, the following fields must be configured:

1. Common Properties

  • Label:
    • A user-friendly name for the action, displayed in the process flow.
    • Required field.
  • Name:
    • A unique identifier for the action, used internally.
    • Required field.

2. Inputs

The inputs section defines the parameters required to execute the batch process. The following fields are available and required:

  1. SOQL Query:

    • The Salesforce Object Query Language (SOQL) query to select the records to be processed by the batch.
    • Example: SELECT Id, Name FROM Account WHERE Active__c = TRUE.
  2. Batch Class:

    • Select the Apex class that implements the batch logic from the dropdown list.
    • The selectable Apex clas are those that implements the interface BatchableJob.
    • Example: BillingBatch, ConsumptionValidationBatch.
  3. Threads Number:

    • The number of parallel threads to use for batch execution.
    • Example: 2 (uses two threads for concurrent processing).
  4. Batch Size:

    • Defines the number of records processed per batch execution.
    • Example: 200 (processes 200 records at a time).
  5. Execution Mode:

    • Configures how the batch is executed:
      • Standard: Executes the batch with the salesforce standar engine.
      • High volume: Executes the batch with the wattyo batch engine.

Usage Example

Scenario: Generating Billing Records

  1. SOQL Query: SELECT Id FROM Account WHERE BillingStatus__c = 'Pending'
  2. Batch Class: BillingBatch
  3. Threads Number: 3
  4. Batch Size: 500
  5. Execution Mode: Standard

Steps:

  1. Add a Batch action to the process.
  2. Fill in the Label and Name fields.
  3. Define the SOQL Query to select the records for processing.
  4. Select the Batch Class (BillingBatch) from the dropdown.
  5. Specify the Threads Number (3) and Batch Size (500).
  6. Set the Execution Mode to Standard for background processing.
  7. Save the configuration and test the process.

Best Practices

  • Use optimized SOQL queries to minimize resource consumption and avoid query limits.
  • Test the selected batch class independently before integrating it into the process.
  • Monitor batch execution through the Orchestrator Batch Tabs to ensure successful processing.

Leave a Comment

       
Euphoria, forever till the end of times

Euphoria

Share this Doc

Batch Action

Or copy link

CONTENTS