Skip to main content

Handling data page errors by using a data transform

Pega Community logo

Note: The following content, referenced from Pega Community, is included here to help you better achieve the module learning objectives.

To specify error handling for each data source in your data page, use a data transform. You can use this data transform across multiple data sources and data pages in the application. For example, with an activity data source, the same data transform can be used to handle data page errors.

Pega Platform provides various ways to handle data page errors. Because data pages are inherently declarative, error handling needs to be contained within the data page load process. As a best practice, use a response data transform that can detect the type of data source and handle the errors appropriately.
  1. In the navigation pane of Dev Studio, click Records.
  2. Expand the Data Model category, and then click Data Page.
  3. Click the name of the data page to open it or create a new data page.
    For more information, see Creating a data page.
  4. On the Definition tab, in the Data Sources section, identify the data source type in the Source field.
    The error handler must be able to identify the type of connected data source so that it can customize the solution. To identify the data source, use a response data transform or activity step for every data source.
    • Connector: Use a response data transform to detect and handle Connector data source errors.
    • Report definition: Use a response data transform to detect and handle Report Definition data source errors.
    • Lookup: Use a response data transform and select the Run response data transform on error check box to detect and handle Lookup data source errors.
    • Data transform: Use the hasMessages when condition to detect and handle data transform data source errors.
    • Activity: Use appropriate transition conditions such as StepStatusFail in activity steps to detect and handle activity data source errors.
  5. To create the error handler, create a data transform by saving the default data transform pxErrorHandlingTemplate to your top-level class and ruleset. For example: You can save the default data transform as MyCoErrorHandlerMaster.
    1. In the header of Dev Studio, search for and then select the pxErrorHandlingTemplate data transform.
    2. In the data transform rule form, click Save as, and then save the data transform to your top-level class and ruleset.
      For more information, see Configuring a data transform.Note: Make sure to change the status of the rule from Final to Available. For more information, see Setting rule status and availability.
    3. From the data page, pass a parameter (for example, Connector-GetCustomerData) to the response data transform to uniquely identify the data source that is used to load the data page.
    4. On the Definition tab of each response data transform, use the when condition pxDataPageHasErrors to identify any errors in the data page and apply the MyCoErrorHandlerMaster data transform.
      For more information, see Data transform actions for Clipboard.
    5. In the MyCoErrorHandlerMaster data transform, create and call a decision table that determines the appropriate error handling based on the data source.
      For more information, see Creating decision tables.
    6. Based on the decision table, perform the error handling action for the data source in the MyCoErrorHandlerMaster data transform.
    7. In the MyCoErrorHandlerMaster data transform, create and call a decision table to map user-friendly error messages instead of the default error messages.

      For more information, see Creating decision tables.

    Tip:
    • Handle other invocation errors procedurally in flows, post-flow action processing, or activities, as appropriate for the specific requirement.

      For more information, see Understanding invocation errors.

    • In use cases that require a manual retry during data page error, consider using the hasNoMessages when condition in the Do not reload when field on the Load Management tab of the data page rule form. The data page is reloaded on retry whenever there is a data page error.
    • To trace Data Page and Data Transform rules, open the Tracer tool directly from the rule form.
    • To trace date pages that are loaded asynchronously, open the Tracer tool from the Data Page rule.
    Result: This data transform can now be used across multiple data sources and data pages in the application. For example, with an activity data source, the same data transform can be used to handle data page errors.
If you are having problems with your training, please review the Pega Academy Support FAQs.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Academy has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice