Salesforce Framework
Asynchronous Job Framework
Framework for building and monitoring multi-step asynchronous Apex processes.
Purpose
CMU’s integrations perform ordered work such as retrieving data, matching and validating records, applying updates, and reporting outcomes. Those steps need to run in sequence while remaining visible and traceable.
Implementation
The framework composes Batch and Queueable jobs into a defined sequence and records the chain and each job as it runs. It can publish job status and progress through Platform Events and send a completion email summarizing duration, record counts, and errors across the chain.
Jobs can run in their normal scope, expand to a full run, or target selected records for partial reprocessing.
It also logs record changes and errors. Existing records are updated only when tracked fields have changed, minimizing unnecessary updates during high-volume processing. When enabled, field history preserves old and new values for troubleshooting and rollback.
public static Id runChain() {
return new JobChain(ExampleLoadJobChain.class)
.publishEvents()
.addJob(new DownloadQueue())
.addJob(new MatchRecordsBatch())
.addJob(new ProcessRecordsBatch())
.addJob(new ValidateResultsBatch())
.execute();
}
Production use
- Supports 85 production asynchronous Apex jobs.
- Used by finance, gift, payroll, student data, commencement, and scheduled maintenance processes.