Error detection configuration
Connectors are used with Data Pages to read data — such as customer and insurance policy data — from an external system. When a connector is invoked by a Data Page, error detection identifies and addresses any integration errors. Each connector includes an error handling flow.
Data source errors
Data Pages are loaded on demand. Errors may occur when retrieving data from a data source.
Examples of errors include:
- Time out: a source system or database is down
- Invalid request: an invalid authentication or data request
- System error: an error during loading or on the external system
The type of data source that is used to load the Data Page affects how errors are detected and handled. Data source errors must be handled as part of the Data Page load mechanism.
When Data Pages invoke a connector, best practices are to:
- Add error detection to all Data Pages
- Invoke a reusable error handling Data Transform to identify and address errors
Error handling logic
Design your error handling logic based on business needs and the types of errors that occur. Three situations to consider are:
- When an error is fixable by the user
- When an error is not fixable by the user, but processing can continue (for example, if the data is not mandatory for the Process)
- When an error is not fixable by the user, and Case processing must stop
Early error detection
To ensure the best user experience, identify errors as early as possible in the Process, with clear error messages explaining to the user what happened and what they should do next. Whenever possible, include an alternate Process flow when the Case cannot proceed, such as to open a chat for assistance, or send an email to confirm to the user that an error resolution Case has been created.
Response Data Transform
The Connector, Report definition, and Lookup data source options of a Data Page require a Response Data Transform. Apply the best practice of checking for errors directly in the Response Data Transform using a When Condition to check for any error messages on the Data Page. If errors exist, call a separate Error handling Data Transform.
Error messages
If there is an issue, an error message displays on the Clipboard. If the error is correctable by the user, display an error message to explain to the user how to correct it.
Error handling flow
The Error handling flow feature identifies errors that are not detected in a Data Page or in a Data Transform. Pega Platform automatically invokes the Error handler flow if the error is not addressed by another mechanism. This feature is always enabled and allows you to implement a Process for handling the error. It is typically used when the connector response is not required immediately — for example, when updating a legacy system.
You can configure the Error handling flow on the Service tab for the connector. By default, connectors use the standard ConnectionProblem flow. The flow can be copied and customized. You may also choose to create an alternative error handler flow.
When an error occurs, the original flow execution is paused. Control is handed over to the Error handler flow. If the resource is not responding to a request, a transient error may be preventing processing. If there is a transient error, the connector is retried, and processing continues in a flow called FlowProblems.
The FlowProblems flow either routes the work item to a problem flow workbasket or notifies an operator about the issue.
The operator may:
- Retry the connector
- Resume the flow without retrying the connector
- Restart the initial flow
- Cancel the error handling flow
Error handling Data Transform
The template for the Error handling Data Transform includes examples of calls to standard utility Functions. You can configure the Data Transform to customize error handling behavior, such as providing more user-friendly error messages.
In the following image, click the + icons to learn more about Error handling data transform template:
Retry a connector invoked from a Data Page
If the returned error is temporary, give the user the option to retry the connector. To retry the connector, configure the Data Page refresh strategy:
- Create a When Condition that returns true when there are no error messages.
- Configure the Do not reload when setting so that the Data Page does not reload if there are no error messages.
Addressing responses from returned errors
If there is an immediate need for the response to be returned by the invoked service, in addition to providing an error message to the user, you should write the error to the log file. Writing a message to the log file helps you troubleshoot errors. For example, you analyze the log file to identify patterns related to a specific error. In the log message, include details about the connector request to help identify the cause of the error.
Check your knowledge with the following interaction:
This Topic is available in the following Module:
Want to help us improve this content?