Foundations Apex API Developer Reference

fferpcore.MessageDescriptionService

global with sharing class MessageDescriptionService

Service for working with fferpcore.Message Descriptions and the declarative publishing engine.

Methods

buildMessageRequests

global static fferpcore.MessageDescriptionService.BuildMessageRequestsResult buildMessageRequests(String productDeveloperName, String messageTypeDeveloperName, fferpcore.DataSource records)

Generate multiple MessageRequest objects using both the specified DataSource, and the fferpcore.MessageDescription of the publication that corresponds to the given productDeveloperName and messageTypeDeveloperName. Any declarative fields will also included.

Input Parameters

Name Type Description
productDeveloperName String Product developer name of the publication.
messageTypeDeveloperName String Message type developer name of the publication.
records fferpcore.DataSource Source of data to populate the requests.

Return Value

This service returns an MessageDescriptionService.BuildMessageRequestsResult object.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

//Inside trigger handler.

fferpcore.DataSource dataSource = new fferpcore.TriggerDataSource(Records);

List<fferpcore.MessagingSystemService.MessageRequest> messages = 
  fferpcore.MessageDescriptionService.buildMessageRequests('TestProduct', 'TestMessageType', dataSource);

//Deliver messages.

fferpcore.MessageDescriptionService.BuildMessageRequestsResult

global inherited sharing class BuildMessageRequestsResult

Instantiate the given Context, given its class name and initialisation memento, Will given an exception if instantiation fails for any reason.

Methods

BuildMessageRequestsResult

global BuildMessageRequestsResult(List<fferpcore.MessagingSystemService.MessageRequest> requests)

Creates a successful result containing the given requests and no error.

Input Parameters

Name Type Description
requests List<fferpcore.MessagingSystemService.MessageRequest> Requests to contain within the results.

BuildMessageRequestsResult

global BuildMessageRequestsResult(String error)

Creates a failed result containing the given error.

Input Parameters

Name Type Description
error String Error message to contain within the results.

getRequests

global List<fferpcore.MessagingSystemService.MessageRequest> getRequests()

Gets the list of mapping requests.

Return Value

This service returns a list of MessagingSystemService.MessageRequest objects.

getRequestsNotNull

global List<fferpcore.MessagingSystemService.MessageRequest> getRequestsNotNull()

Gets the list of mapping requests if the list is not null, otherwise throws an exception using the error message.

Return Value

This service returns a list of MessagingSystemService.MessageRequest objects.

getError

global String getError()

Gets the error message.

Return Value

This service returns a String object.

© Copyright 2009–2024 Certinia Inc. All rights reserved. Various trademarks held by their respective owners.