In this quick tutorial you will learn about How to Addressing Integration Errors in Pega 8
Connectors are used to integrate with external systems. Errors may occur when a connector invokes a service.
It might be related to the infrastructure (Ex: not be able to connect to the server) . It may also be due to the configuration (Ex: return response that the connector does not understand)
There are different mechanisms for handling errors, depending on how the connector is invoked.
Error handling in Connectors:
Connectors are used to read data or write data to an external system. Two types of errors can occur when integrating with an external system.
- Transient Errors
- Permanent Errors
- These errors typically do no last long, they correct themselves over time. For example, the connector is unable to connect because the application is being restarted and is temporarily unavailable.
Note: For transient errors, post a not to alert the end user that the integration failed. Ask the user to retry at a later time. Alternatively, if the response is not immediately needed, the connection can be automatically retried.
- These are typically due to a configuration error or an error in the remote application logic. For example, an invalid SOAP request is sent to a SOAP service.
- In this scenario, the error persists until the SOAP request message is fixed.
Note: For permanent errors, write the details to a log file so that errors can be investigated and fixed.
Configuring Error Detection:
When a data pages and activities invoke a connector, the best practices are to:
- Add error detection to all data pages and activities
- Invoke a reusable data transform to handle errors.
Pega provides a template data transform called pxErrorHandlingTemplate. This can be used to create a reusable error handling data transform.
In addition, each connector has an error handling flow. Pega automatically invokes the error handler flow if the error is not detected by another mechanism.
Connectors, report definitions, and lookups use the response data transform to detect errors.
Activities use a transition condition in the activity step to detect errors.
Configuring error detection for a Data Page:
To configure error detection for a data page, create a new data transform for error handling. This data transform is applied when an error is detected.
- In Dev Studio, search for the standard data transform called pxErrorHandlingTemplate.
- Save pxErrorHandlingTemplate with a new name to create a new data transform in your application.
- Next, in your response data transform, apply the error handling data transform you just created.
- Use the standard when condition pxDataPageHasErrors to detect errors in the data page.
Configuring error detection in an Activity:
The error handling data transform may be used when connectors are called from an activity as well.
- Define an error label for the error handling step.
- Identify the steps in you activity that include error detection. Click Jump to define a transition condition.
- Select the StepStatusFail when condition to detect errors. Jump to the error step when an error occurs.
- You can use the error handling data transform you created previously that specifies how to handle the error.
Error handling flow:
- The error handling flow feature detects errors that are not detected in a data page or an activity. This feature is always enabled.
- The error handler flow allows you to implement a process for handling the error.
- It is typically used when the connector response is not required immediately.
- Configure the error handler flow in 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.
Hope you learned about How to Addressing Integration Errors in Pega 8.