Skip to content

PlatformEventPublishCallback

pozil edited this page Nov 14, 2024 · 4 revisions

PlatformEventPublishCallback Class

Demonstrates how to write Platform Event publish success and failure callbacks

Group Platform Event Recipes

See PlatformEventRecipes

Implements

EventBus.EventPublishFailureCallback, EventBus.EventPublishSuccessCallback

Fields

eventMap

Map that correlates event UUIDs with event data

Signature

private eventMap

Type

Map<String,EventInfo>

Constructors

PlatformEventPublishCallback(eventInfos)

Signature

public PlatformEventPublishCallback(List<EventInfo> eventInfos)

Parameters

Name Type Description
eventInfos List<EventInfo>

Methods

onFailure(result)

Callback for events that failed to publish Note: this method is always called by the Automation user

Signature

public void onFailure(EventBus.FailureResult result)

Parameters

Name Type Description
result EventBus.FailureResult

Return Type

void


onSuccess(result)

Callback for events that were successfully published Note: this method is always called by the Automation user

Signature

public void onSuccess(EventBus.SuccessResult result)

Parameters

Name Type Description
result EventBus.SuccessResult

Return Type

void


insertTask(eventUuids, isSuccess)

Signature

private void insertTask(List<String> eventUuids, Boolean isSuccess)

Parameters

Name Type Description
eventUuids List<String>
isSuccess Boolean

Return Type

void

Classes

EventInfo Class

Data object that holds the minimum amount of information to identify our event and potentially republish it. We recommend that you don't store all event fields to avoid hitting callback handler internal limits.

Fields

eventUuid
Signature
public eventUuid
Type

String


accountId
Signature
public accountId
Type

Id

Constructors

EventInfo(eventUuid, accountId)
Signature
public EventInfo(String eventUuid, Id accountId)
Parameters
Name Type Description
eventUuid String
accountId Id
Clone this wiki locally