Foundations Apex API Developer Reference

fferpcore.TransformService

global with sharing class TransformService

Transform source data using mappings to create or update target records.

All aspects of the service are extensible.
Support for SObjects is provided in the Foundations package.
Support for custom source and target data can be easily added by other packages.

Methods

transform

global static fferpcore.TransformService.TransformResult transform(fferpcore.TransformService.TransformRequest request)

Perform the transform operation as specified in the transform request.

Input Parameters

Name Type Description
request fferpcore.TransformService.TransformRequest The request that specifies the required information for the transform operation.

Return Value

A TransformResult instance containing summary information after running the operation.

fferpcore.TransformService.TransformRequest

global abstract class TransformRequest

The data required to perform a transform operation.

The TransformRequest is an abstract class, meaning custom request types can be created.
The following implementations are provided by Foundations:

  • RecordIdTransformRequest
  • RecordIdDeclarativeTransformRequest

Methods

getSourceContext

global abstract fferpcore.Context getSourceContext()

The source context describes the type of source data being processed, including:

  • The fields and relationships available for use by the mappings.
  • How to verify permissions to read the available fields.
  • The display information for the fields, including labels.
As fferpcore.Context is an abstract class, custom implementations can be created.
The following implementations are provided by Foundations:
  • SObjectContext

Return Value

The Context instance.

getDataTarget

global abstract fferpcore.DataTargetRoot getDataTarget()

The data target describes the target records being created, including:

  • How to create new target records.
  • How to locate existing target records.
  • What to do with the resulting target records, such as a database commit.
  • How to verify permissions to create or update the target records.
As fferpcore.DataTargetRoot is an interface, custom implementations can be created.
The following implementations are provided by Foundations:
  • SObjectDataTarget

Return Value

The DataTargetRoot instance.

getSourceData

global abstract fferpcore.TransformSourceData getSourceData()

The source data provides the raw data to be processed.

As fferpcore.TransformSourceData is an abstract class, custom implementations can be created.
The following implementations are provided by Foundations:

  • RecordIdTransformSourceData

Return Value

The TransformSourceData instance.

getMappings

global virtual List<fferpcore.TransformMapping> getMappings()

The mappings that specify how to populate the target record from the source record.

See fferpcore.TransformMapping for further information.

Return Value

The list of TransformMapping instances.

fferpcore.TransformService.TransformResult

global class TransformResult

Information following a transform operation.

Methods

TransformResult

global TransformResult()

Create an empty TransformResult.

addError

global void addError(fferpcore.TransformError error)

Add an error to the TransformResult.

Input Parameters

Name Type Description
error fferpcore.TransformError The TransformError.

isSuccess

global Boolean isSuccess()

Return Value

Whether the TransformResult contains any errors.

getErrors

global List<fferpcore.TransformError> getErrors()

Return Value

A list of all the TransformErrors in the TransformResult.

© Copyright 2009–2022 FinancialForce.com, inc. All rights reserved. Various trademarks held by their respective owners.