![]() | Project DemoCheck out the gitHub project at:http://github.com/SalesforceFoundation/ApexDoc |
Show: global public webService | |
CaseBusinessAgeSchedulableBatch@description Schedulable class responsible for kicking off the batch job and providing the option to schedule it. This class is designed to trigger the calculation of business age for Case records using a provided {@link BusinessHoursService} implementation. Includes defensive checks to ensure the batch job is only started if the required configuration values are non-blank. The job can be scheduled using a CRON expression, and the ID of the batch job is stored in a static, test-visible variable for test verification purposes. @see CaseBusinessAgeAutomator @see BusinessHoursService Methods
CaseBusinessAgeSchedulableBatch@constructor Constructor for the schedulable batch class. Parameters businessHoursId The ID of the Business Hours record to use in calculations. unit The unit of measurement for business age ('Days' or 'Hours'). calc The implementation of BusinessHoursService used to perform calculations. executeExecutes the business age calculation on a scope of Case records. Parameters bc The batchable context. scope A list of Case records to process in this batch if not empty. executeExecutes the scheduled job, which conditionally runs the CaseBusinessAgeBatchable batch class. The batch is only executed if both `businessHoursId` and `unit` are non-blank. Parameters sc The context object passed to all scheduled job executions. finishExecutes logic after all batches are complete. Finish method is required by Database.Batchable interface, but can be left empty. Parameters bc The batchable context. startPrepares the query to retrieve Case records to process. Parameters bc The batchable context. Return Value A QueryLocator that retrieves Case records with relevant fields. startMethod to start an hourly scheduled job. Calls the start method with a null parameter. Return Value The ID of the scheduled job. |