Foundations Apex API Developer Reference

fferpcore.LinkControlBodyHandler

global with sharing class LinkControlBodyHandler

Methods

LinkControlBodyHandler

global LinkControlBodyHandler(Schema.SObjectType sourceObject, fferpcore.LinkingCorrelationStrategy correlation)

This constructor is used to specify the object we want to amend the link control fields on and what kind of linking strategy to use.

Input Parameters

Name Type Description
sourceObject Schema.SObjectType The SObject type we want to link to.
correlation fferpcore.LinkingCorrelationStrategy A correlation strategy used to determine the unique field of the 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.

/*
 * This handler is associated with the Resource.LinkControl message type
 */
global class HCMResourceLinkControlHandler implements fferpcore.MessageHandler
{
    public void onMessages(fferpcore.HandleMessagesRequest request)
    {
        List<fferpcore.DeliveredMessage> messages = request.getMessages();
        
        fferpcore.LinkControlBodyHandler linkControlBodyHandler = new fferpcore.LinkControlBodyHandler(
            HCMFakeWorker__c.SObjectType, new fferpcore.SimpleLinkingCorrelationStrategy(HCMFakeWorker__c.EmployeeId__c));

        linkControlBodyHandler.onMessages(messages);
    }
}

withChildLinkControl

global fferpcore.LinkControlBodyHandler withChildLinkControl(Id publicationId)

Enable the population of child link control fields.

Input Parameters

Name Type Description
publicationId Id The ID of the associated publication containing the list nodes.

Return Value

The instance of the LinkControlBodyHandler to enable fluent invocations.

onMessages

global void onMessages(List<fferpcore.DeliveredMessage> messages)

This method selects the link status fields on the sourceObject using fferpcore.LinkingCorrelationStrategy and fferpcore.LinkingFieldManager and applies the data from the LinkControl message. If no record exists for the correlation Id, the deliveries are marked in error.

Input Parameters

Name Type Description
messages List<fferpcore.DeliveredMessage> The list of messages to be processed.

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.

public void handleLinkControlMessages(
    Schema.SObjectType sourceObject,
    fferpcore.LinkingCorrelationStrategy correlationStrategy,
    List<fferpcore.DeliveredMessage> messages)
{
    fferpcore.LinkControlBodyHandler handler = 
        new fferpcore.LinkControlBodyHandler(sourceObject, correlationStrategy);

    handler.onMessages(messages);
}
© Copyright 2009–2022 FinancialForce.com, inc. All rights reserved. Various trademarks held by their respective owners.