Centralized Salesforce Development Framework

Scott Covert (scott.b.covert@gmail.com)
Home
AccountAfterDeleteTriggerHandler
AccountAfterInsertTriggerHandler
AccountAfterUnDeleteTriggerHandler
AccountAfterUpdateTriggerHandler
AccountBeforeDeleteTriggerHandler
AccountBeforeInsertTriggerHandler
AccountBeforeUpdateTriggerHandler
AccountHelper
AccountTriggerDispatcher
AccountsTest
CalloutHandler
ConfigService
CustomException
DMLManager
DataFactoryService
DataFactoryServiceTest
DateService
DateServiceTest
DiagnosticsInstrumentation
HttpCalloutMockService
ITriggerDispatcher
ITriggerHandler
QueueableDispatcher
QueueableHandler
QueueableHandlerTest
RepeatingBatch
RepeatingFuture
SObjectService
SObjectServiceTest
ScheduleHandler
ScheduledDispatcher
TestVerificationService
Test_DMLManager
TriggerDispatcherBase
TriggerFactory
TriggerHandlerBase
TriggerParameters

QueueableHandler

DescriptionDefines the Handler for Queueable Apex
AuthorScott Covert
Date2/21/2016

  Properties

asyncJobQueued
public static Boolean asyncJobQueued
Stores whether or not the current transaction has already queued an async job for future processing
queuedJobId
private static Id queuedJobId
Stores the id of the async job queued by this transaction

  Constants

CALLOUT_TOKEN
public static final String CALLOUT_TOKEN
Constant representing the token that signifies the queueable apex is to perform a callout
'Callout:'
ASYNC_TOKEN
public static final String ASYNC_TOKEN
Constant representing the token that signifies the queueable apex job itself should be processed asynchronously
'Async'

Methods

  chainJob

@future private static void chainJob()
DescriptionChains Queueable Apex
AuthorScott Covert
Date2/22/2016

  execute

public void execute(QueueableContext sc)
DescriptionExecute Queueable Apex
AuthorScott Covert
Date2/21/2016
Parameters
QueueableContextCurrent schedulable context

  flushAsyncQueue

@TestVisible private void flushAsyncQueue()
DescriptionFlushes Async Queue
AuthorScott Covert
Date2/24/2016

  processAsyncRequest

private void processAsyncRequest(AsyncRequest__c ar)
DescriptionProcesses async request based on type; this is where specific business logic will be added
AuthorScott Covert
Date2/24/2016
Parameters
AsyncRequest__cAsync request to be processed

  startCalloutJob

public static void startCalloutJob(String asyncJobType, CalloutRequest__c cr)
DescriptionEnqueues Queueable Apex Job
AuthorScott Covert
Date2/24/2016
Parameters
StringType of asynchronous job to be queued
CalloutRequest__cCallout request to be performed by the asynchronous job; should have HTTP request info populated but should not yet inserted to the database

  startDelayedJob

public static AsyncRequest__c startDelayedJob(String asyncJobType, DateTime scheduledTime)
DescriptionEnqueues Queueable Apex Job to run after a delay
AuthorScott Covert - Tython Co.
Date7/19/2018
Parameters
StringType of asynchronous job to be queued
DateTimeScheduled time for asynchronous job to run

  startJob

public static AsyncRequest__c startJob(String asyncJobType)
DescriptionEnqueues Queueable Apex Job
AuthorScott Covert
Date2/24/2016
Parameters
StringType of asynchronous job to be queued

  updateOrDeleteAsyncRequest

private void updateOrDeleteAsyncRequest(AsyncRequest__c ar, Map<Id,AsyncRequest__c> arsToDelete)
DescriptionIncrements async request attempts counter and aborts the job if needed or deletes the job altogether
AuthorScott Covert
Date2/24/2016
Parameters
AsyncRequest__cAsync request that was processed
MapMap of Async Requests to be deleted from the queue