An Apex plugin class is an Apex class that implements specific Overcast interfaces. When registered in an Overcast Component, it will be loaded and executed at runtime, allowing custom code to be executed in the Overcast Component execution pipeline.
This document provides a standard template for all Overcast Components. Refer to the API documentation for specific method information.
// This class is used by component <component name>.
// <add description>
global class MyPlugin implements overcast.ComponentPluginV4, overcast.Loggable {
private overcast.Logger logger;
global void beforeScenarioCall(
Id recordId,
Map<String, Object> referenceFieldValues,
Map<String, Object> importParameters,
Map<String, Object> settings
) {
}
global void afterScenarioCall(
Map<String, Object> returnedData,
overcast.ComponentDefinition.Component cmp,
Map<String, Object> settings
) {
}
global void afterComponentMetadataLoaded(Id recordId, overcast.ComponentDefinition.Component cmp) {
}
// Implement either afterReferenceValuesLoaded(recordId, componentName, referenceValues)
// or afterReferenceValuesLoaded(recordId, componentName, referenceValues, referenceChildValues)
// because both will be called.
global void afterReferenceValuesLoaded(
Id recordId,
String componentName,
Map<String, Map<String, Object>> referenceValues
) {
}
// Implement either afterReferenceValuesLoaded(recordId, componentName, referenceValues)
// or afterReferenceValuesLoaded(recordId, componentName, referenceValues, referenceChildValues)
// because both will be called.
global void afterReferenceValuesLoaded(
Id recordId,
String componentName,
Map<String, Map<String, Object>> referenceValues,
Map<String, List<Map<String, Object>>> referenceChildValues
) {
}
global Boolean onScenarioException(Exception ex, Map<String, Object> retData) {
return true;
}
global void onBackendMessageReceived(String backendMessage) {
}
global void setLogger(overcast.Logger logger) {
this.logger = logger;
}
}