fferpcore.ScheduledJobService
global with sharing class ScheduledJobService
A scheduled job service structure.
Methods
removeSchedules
global static void removeSchedules(Set<Id> existingJobs)
This method aborts the scheduled jobs specified by the Ids provided.
Input Parameters
existingJobs |
Set<Id> |
A set of Ids associated with the scheduled jobs on the database. |
Sample Code
1 2 3 4 5 6 7 8 9 | List<fferpcore.ScheduledJob__c> jobs = [SELECT Id FROM fferpcore.ScheduledJob__c];
Set<Id> ids = new Set<Id>{jobs[ 0 ],...};
fferpcore.ScheduledJobService.removeSchedules(ids);
|
runNow
global static void runNow(Set<Id> scheduledJobIds)
This method sets up a batch job and submits it for the specified scheduled jobs.
Input Parameters
scheduledJobIds |
Set<Id> |
A set of Ids associated with the scheduled jobs on the database. |
Exceptions Thrown
Exceptions.ScheduleJobException |
Exception that is thrown if the method is called with a scheduled job that is not schedulable. |
Sample Code
1 2 3 4 5 6 7 8 9 | List<fferpcore.ScheduledJob__c> jobs = [SELECT Id FROM fferpcore.ScheduledJob__c];
Set<Id> ids = new Set<Id>{jobs[ 0 ],...};
fferpcore.ScheduledJobService.runNow(ids);
|
setupSchedules
global static void setupSchedules(Set<Id> scheduledJobIds)
This method sets up scheduled jobs on the database using their Ids to specify which to schedule.
Input Parameters
scheduledJobIds |
Set<Id> |
A set of Ids associated with the scheduled jobs on the database. |
Exceptions Thrown
Exceptions.ScheduleJobException |
Exception that is thrown if the method is called with a scheduled job that is not schedulable. |
Sample Code
1 2 3 4 5 6 7 8 9 | List<fferpcore.ScheduledJob__c> jobs = [SELECT Id FROM fferpcore.ScheduledJob__c];
Set<Id> ids = new Set<Id>{jobs[ 0 ],...};
fferpcore.ScheduledJobService.setupSchedules(ids);
|
|