Interfaces
SchedulerCustomIntervalHandlerProvider
Allows to add additional custom Interval Handlers.
Signature:
forvendi.BreezzPlugins.SchedulerCustomIntervalHandlerProvider;
Interface contains a method getCustomIntervalHandlers that returns a map of custom interval handlers. The key in the map represents the name of the handler, while the value represents the implementation of the handler.
AsyncExecutionStrategy
Handles async requests..
Signature:
forvendi.AsyncExecutionStrategy;
Interface defines a method handle which is used to handle async requests. The method takes in two arguments: an array of AsyncRequest objects and a ModificationContext object.
The handle method is used to execute a batch of async requests which have the same execution strategy. The AsyncRequest class defines the individual requests, and the ModificationContext class provides information about the context in which the modification is being performed.
By defining this interface, it allows for different strategies to be used for handling the async requests. Implementations of this interface can vary in their approach to processing the requests, but they must adhere to the basic contract defined by this interface.
AsyncExecutionStrategyProvider
Allows to add custom AsyncExecutionStrategy handlers.
Signature:
forvendi.BreezzPlugins.AsyncExecutionStrategyProvider;
Interface contains a method that returns a map of custom asynchronous execution strategies, where the key is the strategy name and the value is the implementation of the strategy.
FeatureToggleService
The BreezzPlugins.FeatureToggleService interface is implemented in order to control the availability of functions through the logic contained in the isEnabled method. It is activated by checking the checkbox in the selected Breezz Feature Toggle of the option called Use Feature Toggle Service Plugin.
Signature:
forvendi.BreezzPlugins.FeatureToggleService;
An example of a class implementing this interface.
1public class ToogleServicePlugin implements forvendi.BreezzPlugins.FeatureToggleService {
2 public Boolean isEnabled(String featureName){
3 if (featureName == 'checkAnyProductIsActive'){
4 return [SELECT Count() FROM Product2 WHERE IsActive=true LIMIT 1] > 0;
5 }
6 return false;
7 }
8}
BaseApexPlugin
Base Breezz Apex Plugin that allows to access subscriber org metadata**
Signature:
forvendi.BreezzPlugins.BaseApexPlugin;
Interface contains methods:
-
createInstance - creates provided class instance
Parameters:
- String className - value of class name
Return:
Object of a class instance
-
hasCustomPermission - Check if current user has Custom Permission assigned
Parameters:
- String permissionName - value of permission set name
Return:
Boolean value, true if enabled else false
-
searchForClassImplementation - searches for class implementation in code
Parameters:
- String searchText - value provided of class name
- String interfaceName - value provided of interface name
- Integer numberOfRecord - Maximum number of records to be returned
Return:
Array of ApexTypeInfo class
AsyncJob
This interface is meant to be used for asynchronous jobs, where the method execution would be executed in a separate thread to perform a certain operation. The inputs to the execute method would provide information about the job to be executed and the ModificationContext object would contain contextual information. The output of the execute method would indicate any errors encountered during execution
Signature:
forvendi.AsyncJob;
Interface defines method which takes two arguments:
- recordKeyToJobInfo - a Map containing String keys and AsyncJobInfo values.
- ctx - an instance of the ModificationContext class
The execute method returns an array of AsyncJobError objects, which
could be empty if execution was successful.
DML
DML interface describes the supported database operations. The allOrNone parameter specifies whether the operation allows partial success. If you specify false for this parameter and a record fails, the remainder of the DML operation can still succeed. Method which uses this parameter, returns a result object (DBResult class) that can be used to verify which records succeeded, which failed, and why. If the parameter is set true, an exception is thrown if the method is not successful.
SchedulerJob
Classes which implement this interface could be registered and processed by Breezz Scheduler. It is good practice to put uncomplicated logic in the scheduler job. The scheduler job should be used to wake up other processes to run.
- init(SchedulerJobInfo schedulerConfig)
Initializes Scheduler job.
Parameters:
- schedulerConfig - BreezzScheduler job info.
Return:
New instance of SchedulerJob or self reference.
- shouldRun() - Checks if scheduler job should be processes.
Return:
True if job should run.
- run() - Run scheduler job.
TriggerRecordsSplitStrategy
Interface represents a strategy for splitting trigger records into groups for processing. It is designed to be used as a global interface and is called during the trigger execution to determine how records should be grouped for processing.
- canProcess(SObject record, SObject optionalOldRecord)
Determines if record can be processed by Trigger Handler.
Parameters:
- record - salesforce record.
- optionalOldRecord -optional old record or null (available only during updates)
An example of implementation interface:
1public with sharing class RecordsHandler implements forvendi.TriggerRecordsSplitStrategy{
2 public Boolean canProcess(SObject record, SObject optionalOldRecord){
3 return (((Account)record).Name == 'Test') ? true : false;
4 }
5}
Return:
True if records can be processed, false otherwise.
TriggerProcessHook
Defines additional logic which needs to be executed before or after Steps. Could be used as a placeholder for old code that is waiting for refactoring. The interface consists of a single method:
- process(SObject[] records, Map<Id, SObject> optionalOldRecords)
Defines additional logic that could be executed during salesforce trigger execution.
Parameters:
- records - list of records being processed by the trigger.
- optionalOldRecords - optional old version of the records being processed by the trigger. Map is optional and may be null.