The Platform Event Service Class - manages the async processing of some internal routines of Fielo. The main goal of this class is to be able to process non-global apex APIs in customer's orgs. But only APIs enabled by Fielo can be called.
publishAsyncEvent(type, payloadOrRecordIds)
static void publishAsyncEvent(String type,Object payloadOrRecordIds)
Enables or disables the on-demand assembling of the cache. Assembling the cache on the runtime may consume additional SOQL queries. If your development or your test class is hitting the SOQL limit required by Salesforce this method will reduce the access to the database (number of SOQL queries).
Parameters
| Parameter | Type | Description |
|---|---|---|
| type | String | Name of the routine/method to be executed. |
| payloadOrRecordIds | Object | It can be either String/JSON formatted String or a Set of Ids |
Async Event types
The following event types (aka methods) are the currently existing methods that any customer on Fielo R2'22+ is allowed to use.
CacheRefresh

Use this event type if you need to refresh the entire Fielo cache. It will reset (set to null) and reload all the cache structures Fielo has.
Example:
FieloPLT.PlatformEventsService.publishAsyncEvent('CacheRefresh',null);UpdateActionCriteriaField

Use this event type if you need to recalculate the Action__c.CriteriaField__c from any action record.
Example:
FieloPLT.PlatformEventsService.publishAsyncEvent(
'UpdateActionCriteriaField',
new Set<Id>{
'your_action_id',
'another_action_id'
}
);UpdateSummer22MetadataFields

Use this event type if in your org the post-install script of the R2'22 failed. To detect if the script fails search for any record in Rules or Criterion Groups with the field RelatedListObject__c null.
Example:
FieloPLT.PlatformEventsService.publishAsyncEvent('UpdateSummer22MetadataFields',null);AddProgramToMetaSegments

Use this event type if in your org the post-install script of the R1'22 failed. To detect if the script fails search for any Meta Segment without Program__c set.
Example:
FieloPLT.PlatformEventsService.publishAsyncEvent('AddProgramToMetaSegments',null);UpdateProgramJsonFields

Use this event type if you need to recalculate the Program__c.CriteriaField__c from any program record.
Example:
FieloPLT.PlatformEventsService.publishAsyncEvent(
'UpdateProgramJsonFields',
new Set<Id>{
'your_program_id',
'another_program_id'
}
);ExpirePoints

Use this event type if you need to expire any not expired and not used point records.
Example:
FieloPLT.PlatformEventsService.publishAsyncEvent(
'ExpirePoints',
new Set<Id>{
'your_point_record_id',
'another_point_record_id'
}
);UpdateSummer22

Use this event type if in your org the post-install script of the R2'22 failed. It will execute all the post-install scripts required for R2'22 again.
Example:
FieloPLT.PlatformEventsService.publishAsyncEvent('UpdateSummer22',null);UpdateR1/23

Use this event type if in your org the post-install script of the R1'23 failed. It will execute all the post-install scripts required for R1'23 again.
Example:
FieloPLT.PlatformEventsService.publishAsyncEvent('UpdateR1/2023',null);