Skip to content

EnqueueNextQueueableProcessStep

codefriar edited this page Oct 5, 2023 · 2 revisions

STATUS: ACTIVE

This class implements the Apex Transaction Finalizer interface. It's used to implement promises. This class is constructed with a list of QueueableProcess Objects, and any passthrough data. The first promise in the list is executed. The QueueableProcess class automatically attaches this finalizer to it's execution.

Implemented types

System.Finalizer

Constructors

public EnqueueNextQueueableProcessStep(List<QueueableProcess> processSteps, Object dataPassthrough, List<QueueableContext> queueableContextHistory, List<FinalizerContext> finalizerContextHistory)

SUPPRESSWARNINGS

Constructor for the EnqueueNextQueueableProcessStep class.

Parameters

Param Description
processSteps List A list of QueueableProcess Objects. The first step in the list is executed.
dataPassthrough Object this is either the initial data passed into the first QueueableProcessStep, or the data passed from the previous QueueableProcessStep.
queueableContextHistory List A list of QueueableContext Objects.
finalizerContextHistory List A list of FinalizerContext Objects.

Fields

private dataPassthroughObject

This field allows you to pass information into your initial QueueableProcessStep. This is also the field that is passed to the next QueueableProcessStep in the list.

private dataProviderQueueableProcessDataProvider

TESTVISIBLE

a DataProvider instance. This is used to allow for dependency injection in unit tests.

private finalizerContextHistoryList<FinalizerContext>

private processStepsList<QueueableProcess>

A list of QueueableProcess Objects. The first step in the list is executed.

private queueableContextHistoryList<QueueableContext>


Methods

public void execute(FinalizerContext context)

This method is required by the Apex Transaction Finalizer interface. It's used to enqueue the next QueueableProcessStep in the list, if one exists.

Parameters

Param Description
context FinalizerContext Dependency injected by Salesforce at execution time. Contains the result of the QueueableProcessStep that just executed.

private void handleException(FinalizerContext context)


Clone this wiki locally