Adding error handling to a case type
Add error handling to a case type to ensure that operators process the work correctly and completely, for example, to ensure that users complete required fields. To add error handling to a case type, you call the czErrorHandler activity or the czErrorHandler data transform from the case type flow.
For example, the out-of-the box Update a contact name case type calls the error handler during post-processing. The following figure shows how the Check Primary Address activity calls the czErrorHandler activity:
The error handler feature includes extension points in an ErrorHandlerExt activity so that you can customize error processing to meet your specific business needs.
When an error occurs, you can configure the error handler to display a message to the operators and to log the error to the PEGA log file. For more information, see Log files tool.
If the error type is Alert, you can configure an alert message and code to send to Pega Diagnostic Cloud (PDC) for further action.
- In the navigation pane of Dev Studio, click App.
- In the App pane, select the class and then scroll to find the case type that you want to modify.
- Click the Expand icon next to the case type name to show components of the case type, and then click to view the case type flow.
- Modify the case type flow to call the error handler activity or data transform from the
appropriate flow action or step.For detailed information about how to modify case types from Dev Studio, see Automating work by creating case types.
- Configure the parameters for the error handler.
For example, if you call the error handler activity from another activity, configure the Method Parameters for that call as shown in the following figure:
- In the Message parameter, select the message to display and log.
- In the MessagePage parameter, select the page on which to
display the message.The default is pyWorkPage.
- If you do not want to display an error message on the page, for example, if you only want to log the error, clear the SetPageMessages check box.
- If you do not want to log the error message in the application error logs, for example, if you only want to display the error on the page, clear the SetLogMessages check box.
- In the LoggingLevel parameter, select the error type. The
page error message and logged error message both include the error type.
- Alert
- Debug
- Error
- Info
- InfoForced
- Warn
- If you set the LoggingLevel to
Alert, configure the alert code and message for the
application log:
- In the AlertCode parameter, select the alert code.
- In the AlertMessage parameter, select the alert message.
- If you set the LoggingLevel to Alert,
configure the alert parameters to send to PDC:
- Open the error handler activity or data transform.
- For the Generate and report the PDC alerts method, click the Expand to see method parameters icon to display the Method Parameters.
- Enter a value for each alert parameter that the case type sends to PDC.
- Click Save.
Previous topic Defining knowledge content integration Next topic Adding new case types