-
Notifications
You must be signed in to change notification settings - Fork 0
The AsyncActionLauncher Class
GitHub Action edited this page Sep 25, 2025
·
1 revision
The AsyncActionLauncher class is responsible for constructing and launching AsyncActionJob queueables. It provides methods to launch processing jobs for processors that have pending AsyncAction__c records, with built-in duplicate prevention and queueable limits validation.
Launches AsyncActionJob queueables for processors that have pending actions.
Map<String, Id> launch(List<AsyncActionProcessor__mdt> settingsList)Id launch(AsyncActionProcessor__mdt settings)
Launches AsyncActionJob queueables for all available processor configurations.
Map<String, Id> launchAll()
// Launch jobs for specific processors
AsyncActionLauncher launcher = new AsyncActionLauncher();
List<AsyncActionProcessor__mdt> processors = [SELECT DeveloperName FROM AsyncActionProcessor__mdt WHERE Enabled__c = true];
Map<String, Id> jobIds = launcher.launch(processors);
// Launch job for a single processor
AsyncActionProcessor__mdt settings = AsyncActionProcessorService.get('MyProcessor');
Id jobId = launcher.launch(settings);
// Launch jobs for all processors
Map<String, Id> allJobIds = launcher.launchAll();