fferpcore.ffasync_Processglobal abstract class ffasync_Process This class is the main entry point for the system. It must be implemented. 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. You need to provide some sample code EnumsMonitoringTypeThis class specifies the Monitoring Types which are supported by the framework. The supported values are DETAILED and SIMPLE.
Methods
ffasync_Processglobal ffasync_Process() getQueryLocatorglobal abstract Database.QueryLocator getQueryLocator() Return the query locator for your process. Return ValueDatabase.QueryLocator - records to be run for this Process getStepglobal abstract fferpcore.ffasync_Process.Step getStep() Get the step that will be run for each chunk of records. Return ValueStep class instance getLoggingRequirementglobal virtual fferpcore.ffasync_Process.LoggingRequirement getLoggingRequirement() Get the Logging Requirements for current Process. Takes DETAILED as monitoring type and No userField by default. Return ValueFfasync_Process.LoggingRequirement class instance getDescriptionglobal virtual String getDescription() Description of process. Returns Process as process default description if not overrided. Return ValueDescription of process getScopeSizeglobal virtual Integer getScopeSize() Scope size for the batch. The default value is 1. Return ValueScope size for batch getEndOfProcessActionsglobal virtual List<fferpcore.ffasync_IAction> getEndOfProcessActions() Some custom actions can be run after Process completion. For example, email or task notifications can be generated to inform users that Process has completed. By default no action will be added. Return ValueList of actions to be run after Process Completion fferpcore.ffasync_Process.Stepglobal abstract class Step A step is the work that is to be done on each chunk of records that we have, e.g. a batch execute or a qeueueable execute. Methods
Stepglobal Step() canRunParallelglobal virtual Boolean canRunParallel() Steps can be executed serially or in parallel. If set to False, the step runs serially. The default value is True, to run the step in parallel. Return ValueFlag to decide whether to run the step Parallel or Serial runglobal abstract fferpcore.ffasync_ProcessService.ProcessResponse run(fferpcore.ffasync_ProcessService.ProcessExecutionContext ec, List<Id> recordsIds) This will be called by the async job for the main task and returns ffasync_ProcessService.ProcessResponse. This will be called by the async job, it could be a batch, queueuable etc. Input Parameters
Return ValueInstance of ProcessResponse, which specifies if all records are processed successfully or failed getExecutionGroupingFieldsglobal virtual List<SObjectField> getExecutionGroupingFields() Used to group records by a grouping key and only run a set of records from that group in any one execution. This is useful for things such as FFA company handling, where all records must be in the same company for a given service call and the process may pick up records from many companies. Returns null as default value. Return ValueList of grouping fields fferpcore.ffasync_Process.LoggingRequirementglobal virtual class LoggingRequirement This class holds the properties specific to the logging requirements of the framework. Methods
LoggingRequirementglobal LoggingRequirement() LoggingRequirementglobal LoggingRequirement(fferpcore.ffasync_Process.MonitoringType monitoringType, SObjectField userField) This parameterized constructor enables users to create a LoggingRequirement instance with minimal code without extending the LoggingRequirement class. The default value for MonitoringType is DETAILED and the default value for userField is Null. This default behavior is provided to users unless they override the getLoggingRequirement() method in the Process class. Users can still extend the LoggingRequirement class to provide custom valid values for MonitoringType and UserField. getMonitoringTypeglobal virtual fferpcore.ffasync_Process.MonitoringType getMonitoringType() There are currently two Monitoring Types you can use, Simple and Detailed. Simple monitoring, which is light and fast, does not generate Process Logs or details about the failure or success of processes. Detailed monitoring generates the Process Logs and detailed information about failure or success of the processes. To enable detailed monitoring, DETAILED must be returned from this method. The system runs in detailed mode by default. Return ValueMonitoring Type which should be used by framework- Detailed or Simple getUserFieldglobal virtual SObjectField getUserField() This field specifies the user that will be notified when the process ends. It can be used to create a custom relationship between records and a user. If this field is specified, then there will be changes in the logging. Records will be created in the database for each UserGroup i.e. groups of source object records on the basis of UserField. This field could be createdByID or another field containing a lookup to user ID on the source object. By default it returns null. Return ValueField that specifies the source record user |