Foundations Apex API Developer Reference

fferpcore.ffasync_ProcessIterable

global abstract inherited sharing class ffasync_ProcessIterable implements ffasync_IProcess

This class is the main entry point for the system. It must be implemented.

This class implements the following interfaces:

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 SampleProcessIterable extends fferpcore.ffasync_ProcessIterable
{
    private List<Object> data;
    private IterableStep step;
    private List<fferpcore.ffasync_IAction> endOfProcessActions;

    public SampleProcessIterable(List<Object> data)
    {
        this.data = data;
        this.step = new SampleIterableStep();
        this.endOfProcessActions = new List<fferpcore.ffasync_IAction>();
    }

    public override Iterable<Object> getIterable()
    {
        return data;
    }

    public override IterableStep getStep()
    {
        return step;
    }

    public override String getDescription()
    {
        return "Sample";
    }

    public override Integer getScopeSize()
    {
        return 1;
    }

    public void addEndOfProcessAction(fferpcore.ffasync_IAction action)
    {
        endOfProcessActions.add(action);
    }

    public override List<fferpcore.ffasync_IAction> getEndOfProcessActions()
    {
        return endOfProcessActions;
    }

    public class SampleIterableStep extends fferpcore.ffasync_ProcessIterable.IterableStep
    {
        public override Boolean canRunParallel()
        {
            return true;
        }

        public override fferpcore.ffasync_ProcessService.ProcessResponse run(
            fferpcore.ffasync_ProcessService.ProcessExecutionContext ec,
            List<Object> objs
        )
        {
            // Batch/Queueable Execute code over chunk of data 
        }
    }
}

Methods

ffasync_ProcessIterable

global ffasync_ProcessIterable()

getIterable

global abstract Iterable<Object> getIterable()

Returns the Iterable list of data used by this process.

getStep

global abstract fferpcore.ffasync_ProcessIterable.IterableStep getStep()

Returns the IterableStep used by this process for each chunk of data.

getLoggingRequirement

global fferpcore.ffasync_Process.LoggingRequirement getLoggingRequirement()

Returns the Logging Requirement for this process. As iterable processes may not have object records, simple logging is enforced in all instances.

getDescription

global virtual String getDescription()

Text description of the process. Used on Process Run SObject records. Defaults to "ProcessIterable".

getScopeSize

global virtual Integer getScopeSize()

Data scope size for the batch spawned by the process. Defaults to 1.

getEndOfProcessActions

global virtual List<fferpcore.ffasync_IAction> getEndOfProcessActions()

Provides custom actions to be run after process completion. For example, email or task notifications can be generated to inform users that the process has completed.

fferpcore.ffasync_ProcessIterable.IterableStep

global abstract inherited sharing class IterableStep implements ffasync_IProcessStep

A step encapsulates the work that will be done by the process on a chunk of data, executed via Batch or Queueable apex.

This class implements the following interfaces:

Methods

IterableStep

global IterableStep()

canRunParallel

global virtual Boolean canRunParallel()

Flag used to run process steps in parallel or serial.

run

global abstract fferpcore.ffasync_ProcessService.ProcessResponse run(fferpcore.ffasync_ProcessService.ProcessExecutionContext ec, List<Object> objs)

The framework calls this method as part of the Batch or Queueable execute.

Input Parameters

Name Type Description
ec fferpcore.ffasync_ProcessService.ProcessExecutionContext Execution Context for the current process.
objs List<Object> A list of objects representing a chunk of the data. Length determined by scope size.
© Copyright 2009–2024 Certinia Inc. All rights reserved. Various trademarks held by their respective owners.