Foundations Apex API Developer Reference

fferpcore.FilteringDataSourceDecorator

global with sharing class FilteringDataSourceDecorator extends DataSource

Filters a fferpcore.DataSource using a PublicationMatcher.

This class extends fferpcore.DataSource

Methods

FilteringDataSourceDecorator

global FilteringDataSourceDecorator(fferpcore.DataSource subject, fferpcore.PublicationMatcher matcher)

Constructor to create a filtering DataSource.

Input Parameters

Name Type Description
subject fferpcore.DataSource The fferpcore.DataSource on which to perform operations.
matcher fferpcore.PublicationMatcher Used to filter messages, Only matching messages are sent.

requireField

global override void requireField(SObjectField field)

Implements requireField(SObjectField field) on DataSource. Calls requireField(SObjectField field) on the fferpcore.DataSource provided in the constructor.

Input Parameters

Name Type Description
field SObjectField A field to be included in the query.

requireField

global override void requireField(String fieldName)

Implements requireField(String fieldName) on DataSource. Calls requireField(String fieldName) on the fferpcore.DataSource provided in the constructor.

Input Parameters

Name Type Description
fieldName String A field to be included in the query.

require

global override void require(fferpcore.Path path)

Implements require(Path path) on DataSource. Calls require(Path path) on the fferpcore.DataSource provided in the constructor.

Input Parameters

Name Type Description
path fferpcore.Path A path to be included in the query.

requireLookupField

global override fferpcore.DataSource requireLookupField(SObjectField field)

Implements requireLookupField(SObjectField field) on DataSource. Calls requireLookupField(SObjectField field) on the fferpcore.DataSource provided in the constructor.

Input Parameters

Name Type Description
field SObjectField The field representing the lookup.

Return Value

A DataSource representing the target of the lookup.

requireLookupField

global override fferpcore.DataSource requireLookupField(String name)

Implements requireLookupField(String name) on DataSource. Calls requireLookupField(String name) on the fferpcore.DataSource provided in the constructor.

Input Parameters

Name Type Description
name String The field representing the lookup.

Return Value

A DataSource representing the target of the lookup.

requireOneToManyField

global override fferpcore.DataSource requireOneToManyField(fferpcore.DataSource.BackReference backReference)

Implements requireOneToManyField(DataSource.BackReference backReference) on DataSource. Calls requireOneToManyField(DataSource.BackReference backReference) on the fferpcore.DataSource provided in the constructor.

Input Parameters

Name Type Description
backReference fferpcore.DataSource.BackReference A description of the relationship as viewed from the defining "Many" Detail end.

Return Value

A DataSource representing the target of the lookup.

runQuery

global override Iterator<Row> runQuery()

Implements runQuery() on DataSource. Calls runQuery() on the fferpcore.DataSource provided in the constructor. The results of this query are filtered based on the fferpcore.PublicationMatcher provided to the description and only results matching the query will be returned.

Return Value

An iterator of fferpcore.DataSource.Row objects containing the required data.

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 class ExampleDataSource extends fferpcore.DataSource
{
    private Set<SObjectField> m_fields;

    public ExampleDataSource()
    {
    }

    public override void requireField(SObjectField field)
    {
        m_fields.add(field);
    }

    public override Iterator<fferpcore.DataSource.Row> runQuery()
    {
        // Run SOQL to retrieve the data in m_fields
    }

}

ExampleDataSource source = new ExampleDataSource();
source.requireField(Account.Name);
source.requireField(Account.AccountNumber);
Iterator<fferpcore.DataSource.Row> rows = source.runQuery();
//use rows to construct a message
© Copyright 2009–2023 Certinia Inc. All rights reserved. Various trademarks held by their respective owners.