Packaged interface
Namespace: overcast
The ComponentPlugin interface provides a way for Overcast Components to execute custom code.
See the Overcast Component Plugin Template for the full implementation example.
The class and method visibility must be global so the Overcast managed package can call it.
beforeScenarioCall(recordId, referenceFieldValues, importParameters, settings)
Executed before the request is made to the backend system. After the user either loads the page and the component runs automatically, or the user submits the form on screen, this method is executed to allow for data to be added, removed, or changed before sending it to the backend system.
The same instance of this class is used to call both beforeScenarioCall() and afterScenarioCall() so state can be maintained between calls in class properties.
The method visibility must be global.
Signature
void beforeScenarioCall(Id recordId, Map<String, Object> referenceFieldValues, Map<String, Object> importParameters, Map<String, Object> settings)
Parameters
recordId
Type: Id
The ID of the record for the page the component is executing on. For example, if the component is on an Account detail screen, recordId will be the ID of the Account the user has on screen.
referenceFieldValues
Type: Map<String, Object>
A collection of all the reference values that have been loaded from the database from the configured parameter mappings.
importParameters
Type: Map<String, Object>
The data that will be sent to the backend system. The structure corresponds to that specified in the component definition. The data in importParameters can be added to, removed, or changed.
settings
Type: Map<String, Object>
The parameter mapping configuration defined as Settings. Allows the custom values that have been defined in the component definition to be read and used in this method for custom processing.
Return Value
Type: void
afterScenarioCall(returnedData, cmp, settings)
Executed after the request is made to the backend system and before the data is returned to the user. This method is executed to allow for data to be added, removed, or changed before returning returning the data to the user.
The same instance of this class is used to call both beforeScenarioCall() and afterScenarioCall() so state can be maintained between calls in class properties.
The method visibility must be global.
Signature
void afterScenarioCall(Map<String, Object> returnedData, overcast.ComponentDefinition.Component cmp, Map<String, Object> settings)
Parameters
returnedData
Type: Map<String, Object>
The data that was returned from the backend system. The structure corresponds to that specified in the component definition. The data in returnedData can be added to, removed, or changed.
cmp
Type: overcast.ComponentDefinition.Component
The definition for the component. Changes to cmp will affect the UI if the UI has not been displayed. (Some components display the UI and the user performs an action, after which the scenario call is made. Other components run the scenario on load and display the UI before the user can perform any actions.)
settings
Type: Map<String, Object>
The parameter mapping configuration defined as Settings. Allows the custom values that have been defined in the component definition to be read and used in this method for custom processing.
Return Value
Type: void