Skip to main content

Configuring error handling for Data Pages

4 Tasks

30 mins

Visible to: All users
Intermediate Pega Platform '23 Data Integration English


As part of each candidate Case, TGB performs a background check on the applicant. As part of the background check, a SOAP connector is invoked to retrieve a credit report from a credit check provider. If something goes wrong when the SOAP connector is invoked, TGB wants to log errors and display the message Credit Check unavailable: contact your system administrator.

To accomplish this functionality, configure the CreditCheck connector for the D_CreditReport Data Page, detect errors and invoke a reusable error handling Data Transform from the response Data Transform, and verify that all errors are detected and handled in the error handling Data Transform. 

The following table provides the credentials you need to complete the challenge.

Role User name Password
Senior System Architect SSA@TGB pega123!
Note: Your practice environment may support the completion of multiple challenges. As a result, the configuration shown in the challenge walkthrough may not match your environment exactly.

You must initiate your own Pega instance to complete this Challenge.

Initialization may take up to 5 minutes so please be patient.

Challenge Walkthrough

Detailed Tasks

1 Source the D_CreditReport Data Page with the CreditCheck connector

  1. In the Pega instance for the challenge, enter the following credentials:
    1. In the User name field, enter SSA@TGB.
    2. In the Password field, enter pega123!.
  2. In the Data Explorer, open the D_CreditReport Data Page.
  3. In the Definition tab, in the Data sources section, disable data simulation.
  4. Under the Request Data Transform field, click Parameters to verify that Pass current parameter page is selected to ensure that the TIN (Tax identification number) is passed to the request Data Transform.
    Pass Parameters
  5. Under the Response Data Transform field, click Parameters to verify that Pass current parameter page is selected to ensure that the Case ID is passed to the response Data Transform.
  6. Save the D_CreditReport Data Page.

2 Create reusable error handling Data Transform

  1. Open the standard pxErrorHandlingTemplate Data Transform.
  2. Create a copy of the pxErrorHandlingTemplate Data Transform named ErrorHandlingMaster in the top-level class, TGB.
  3. On the Parameters tab, define a parameter named pyCaseID for the Case ID.
  4. Mark the pyCaseID parameter as required.
  5. On the Definition tab, right-click step 2, and then select Enable to get messages using the pxGetPageMessages Function.
  6. Right-click step 4, and then select Enable to enable the Step to use the pxClearMessages Function to clear the messages on the Data Page before adding your custom error message.
  7. Right-click step 6, and select Enable to use the pxAddMessageToPage Function and add the ErrorMessage input parameter as a message.
  8. Right-click step 8, and then select Enable to use the pxLogMessage Function to write messages in the log file.
  9. In the Source field of step 8, enter @(Pega-RULES:Default).pxLogMessage(param.getMessage + " for Case number " + param.pyCaseID).
    Note: You always need to specify a target, even if the Function does not return anything or if you are not interested in the response.
  10. Save the ErrorHandlingMaster Data Transform.
    Error handling data transform definition list

3 Configure the CreditCheckResponse Data Transform with ErrorHandlingMaster

  1. From D_CreditReport Data Page, open the CreditCheckResponse Data Transform.
  2. Right-click step 2 and select Enable to ensure that the pxDataPageHasErrors When Rule is invoked to check for errors.
  3. Configure the CreditCheckResponse Data Transform to apply the ErrorHandlingMaster instead of the pxErrorHandlingTemplate Data Transform if an error occurs.
  4. Click the Gear icon to specify the input parameters for the ErrorHandlingMaster Data Transform.
    Error handling definition list
  5. In the pyCaseID input parameter field, enter param.CaseID.
    pyCaseID parameter field
  6. Save the CreditCheckResponse Data Transform.

4 Configure an error message in UI

  1. In the Application Explorer, under the Candidate Case Type, click User Interface > Section > BackgroundCheck_0 Section to open the BackgroundCheck_0 Section Rule.
  2. Click Section - Credit report to open the BackgroundCheck_0_CreditReport Section Rule.
    Credit report section
  3. On the Template configuration menu, click Add > Data display > Label to append a label to the dynamic layout.
    Template configuration
  4. In the dynamic layout, click the new label field to configure the cell properties for the new label.
  5. Use the following information to complete the General form.
    Property Value
    Value Credit Check unavailable: contact your system administrator
    Visibility Condition (When Rule)
    Condition for Visibility hasMessages
  6. Save the BackgroundCheck_0_CreditReport Section Rule.

Confirm your work

  1. In the User Portal, create a Candidate Case.
  2. Complete the Submission Stage.
    Note: You can specify any values to complete the Steps. They do not impact this challenge.
  3. In the Conduct phone screen View, click Submit to advance the Case to the Approval Assignment.
  4. In the Approval View, click Approve to advance the Case to the Background check Assignment.
  5. To the right of the Background check Assignment, click Go to start the Background check.
    Note: The SOAP connector in this challenge is configured to always generate an error.
  6. The Credit Check unavailable: contact your system administrator message indicates that the system ran the error handling Data Transform.
    Background check credit report
  7. In Dev Studio, on the Configure menu, click System > Operations > Logs to open the logs of the system.
  8. Click Log files to open the Logs Files window.
  9. Click PegaRULES.log to open the PegaRules log.
  10. Scroll through the log file to the end to see more details on the error message.
    Error handler message
    Tip: To see the error, you can search the log file with Case ID.

This Challenge is to practice what you learned in the following Module:

Available in the following mission:

If you are having problems with your training, please review the Pega Academy Support FAQs.

Did you find this content helpful?

100% found this content useful

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