How to customize the success and exception windows
Optionally, your application can override the processing and user presentation of activity success and failure messages.
Default operation
By default, when a top-level activity completes execution but does not send HTML code to a browser display, it presents a success form, defined by the standard harness @baseclass.ActivityStatusSuccess, containing a green checkmark:
Similarly, by default when an activity (at any level) encounters an uncaught Java exception or other failure condition, a red-X window appears with the text "Please contact your system administrator". This window is defined by the standard harness @baseclass.ActivityStatusError. The system also adds information about the failure or exception to the Pega log.
Your application can localize these standard harnesses, to present a different message or a message in a specific language.
Overriding the harnesses
Optionally, you can override either or both of these two standard harnesses to localize the text or change the wording or presentation:
- Open the standard harness.
- Use the Save As toolbar operation to copy the rule into an application RuleSet, optionally changing the Applies To key part to Work- or an application-specific class.
- Update the copy, referencing properties and sections in your application as desired
- Test.
Overriding the calling activities
You can override either or both of the standard activities that present the success window and exception windows. Familiarity with Java and Java exceptions is required.
Standard activity @baseclass.ActivityStatusNoContentHandler displays the success harness. This activity has no parameters.
Standard activity @baseclass.ActivityStatusExceptionHandler displays the exception (failure) harness. This activity access a single Java Object parameter that is an instance of the java.util.Map interface. It copies the error information on a page and then uses the @baseclass. ActivityStatusHarness to display the information.
To override the default activities:
- Open the standard activity.
- Use the Save As toolbar operation to copy the activity into an application RuleSet, optionally changing the Applies To key part to Work- or an application-specific class.
- Update the copy, referencing properties and sections in your application as desired
- Test.
If you override the standard activities, keep your activities simple, as they may execute in a wide variety of situations. Exceptions that occur during exception processing may mask the original cause. Don't assume that the entire clipboard environment of your application is present and correct.
Technical category