Skip to main content
close Search
Close search

Challenge

Configuring error handling for data pages

5 Tasks

30 mins

Visible to all users
Beginner Pega Platform 8.2 English

Scenario

As part of each candidate case, TGB performs a background check on the applicant. As part of the background check, a credit report is retrieved from a credit check provider using a SOAP connector.

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 the user.

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

Role Operator ID Password
Senior System Architect SSA@TGB rules

Your assignment

The recommended tasks for completing this assignment are:

  • 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.
  • Verify that all errors are detected and handled in the error handling data transform.

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

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

Detailed Tasks

1 Source the D_CreditReport data page with the CheckCredit connector

  1. Open the D_CreditReport data page.

  2. On the Credit report data page, click the Definition tab to view the data sources.
  3. Under Data sources, disable data simulation.

  4. Below 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.

  5. Below 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 called ErrorHandlingMaster.

  3. On the Parameters tab, define a parameter named pyCaseID for the case ID and mark the parameter as required.

  4. On the Definition tab, right-click step number 2 and select Enable to get messages using the pxGetPageMessages function.
  5. On step number 4, right-click and 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.
  6. On step number 6, right-click and select Enable to use the pxAddMessageToPage function and add the ErrorMessage input parameter as a message.
  7. On step number 8, right-click and select Enable to use the pxLogMessage function to write messages in the log file.
  8. In the Source field of step 8, Enter @(Pega-RULES:Default).pxLogMessage(param.getMessage + " for case number " + param.pyCaseID).

     

    You always need to specify a target, even if the function does not return anything or if you are not interested in the response.
  9. Save the ErrorHandlingMaster data transform.

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.

    Enable
  3. Configure the CreditCheckResponse data transform to apply the ErrorHandlingMaster data transform if an error occurs.

  4. Click the Gear icon to specify the input parameters for the ErrorHandlingMaster data transform.

  5. In the pyCaseID input parameter field, enter param.CaseID.

  6. Save the CreditCheckResponse data transform.

4 Configure an error message in UI

  1. In Application Explorer, under Candidate case type expand the User Interface > Section and click BackgroundCheck_0 section to open BackgroundCheck_0 section rule.

  2. Click Section - Credit report to open the BackgroundCheck_0_CreditReport section rule.

  3. From the Basic menu, select Label field and append it in the dynamic Layout.

  4. Next to the new label field, click the Gear icon to configure the open 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 visibilty hasMessages
  6. Click the Presentation tab, and in the Label format field, select Error Message.

  7. Save the BackgroundCheck_0_CreditReport section rule.

5 Confirm your work

Simulation might be enabled if you completed the Configuring data access patterns exercise prior to this exercise. Disable simulation for the CreditCheck connector before you proceed.

  1. From the Case Manager portal, begin a Candidate case.
  2. Complete the Submission stage (Collect Personal Details, Collect Professional Details, Collect Educational Details and Collect a Work Sample views).

    You can specify any values to complete the steps. They do not impact this exercise.
  3. From Actions menu, select Conduct phone screen to open the conduct phone screen view.

  4. In the Conduct screen view, click Submit to advance the case to Approval assignment.

  5. From the Actions menu, select Approval.

  6. In the Approval view, click Approve to advance the case to Background check assignment.

  7. From Actions menu, select Background Check to start the Background Check.
  8. The message Credit Check unavailable: contact your system administrator on you screen indicates the system executed the error handling data transform.

  9. In Dev Studio, from the Configure menu, click System > Operations > Logs to open the logs of the system.
  10. Click Log files to open the all logs window.
  11. Click PegaRULES.log to open the PegaRules log.

  12. Scroll the log file to the end to the see more details on error message.

    To see the error, you can search the log file with Case ID.

If you are having problems with your training, contact Pega Academy technical support.

Did you find this content helpful?

Want to help us improve this content?

Suggest an edit

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