A number of Decisions on Demand helper classes can be extended to implement custom functionality at the APEX level, including:
-
DecsOnD.ApplyPolicyHelper
Handles the entire process of applying a business policy - Action classes (including DecsOnD.AssignOwnerAction, DecsOnD.UpdateObjectAction andDecsOnD.CustomAction)
These classes are instantiated to apply updates to the Salesforce data resulting from a business policy invocation -
DecsOnD.AssignmentHelper
This is a dedicated helper class for assignment rules
To register customized versions of the classes listed above with the Decisions on Demand app, you should create a class called DecsOnD_CustomizationManager. This class:
- Must implement the DecsOnD.ICustomizationManager interface
- Must be global
To register your customizations, implement the getCustomizations method. A separate call will be made to this method for each customizable helper class, passing in the name of the class to be extended. For custom actions, a single call is made for all actions (using the feature name DecsOnD.PolicyActionHandler.CUSTOMIZABLE_FEATURE_ACTIONS). Your implementation should return the Apex Type corresponding to your custom class, which must be global and extend the class you are customizing.
For example, the following will register:
- A custom implementation of DecsOnD.ApplyPolicyHelper called CustomApplyPolicyHelper
- A custom implementation of DecsOnD.AssignOwnerAction called CustomAssignOwnerAction
global class DecsOnD_CustomizationManager implements DecsonD.ICustomizationManager {
global Map<String, Object> getCustomizations(String featureName, Map<String, Object> parameters) {
// Handle request for custom implementation of ApplyPolicyHelper
if (DecsOnD.ApplyPolicyHelper.class.getName().equals(featureName)) {
Map<String, Object> results = new Map<String, Object>();
// Register the custom implementation
results.put(DecsOnD.Config.CUSTOMIZATION_FEATURE_APEX_TYPE, CustomApplyPolicyHelper.class);
return
} else if (DecsOnD.PolicyActionHandler.CUSTOMIZABLE_FEATURE_ACTIONS==featureName) {
// Handle request for custom action implementations
Map<String, Object> actions = new Map<String, Object>();
// Register a custom implementation for the AssignOwner action
actions.put(DecsOnD.AssignOwnerAction.NAME, CustomAssignOwnerAction.class);
return actions;
}
return null;
}
}Where CustomApplyPolicyHelper and CustomAssignOwnerAction should be global classes that extend DecsOnD.ApplyPolicyHelper and DecsOnD.AssignOwnerAction respectively.