Project Demo

Check 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.
  • execute
    Executes the business age calculation on a scope of Case records.
  • execute
    Executes the scheduled job, which conditionally runs the CaseBusinessAgeBatchable batch class. The batch is only executed if both `businessHoursId` and `unit` are non-blank.
  • finish
    Executes logic after all batches are complete. Finish method is required by Database.Batchable interface, but can be left empty.
  • start
    Prepares the query to retrieve Case records to process.
  • start
    Method to start an hourly scheduled job. Calls the start method with a null parameter.
  • start
    Method to start the scheduled job.

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.

execute

Executes 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.

execute

Executes 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.

finish

Executes logic after all batches are complete. Finish method is required by Database.Batchable interface, but can be left empty.
Parameters
bc
The batchable context.

start

Prepares the query to retrieve Case records to process.
Parameters
bc
The batchable context.
Return Value
A QueryLocator that retrieves Case records with relevant fields.

start

Method to start an hourly scheduled job. Calls the start method with a null parameter.
Return Value
The ID of the scheduled job.

start

Method to start the scheduled job.
Parameters
hour
The hour at which to start a daily scheduled job.
Return Value
The ID of the scheduled job.

Powered By ApexDoc