Skip to main content

Pega tools for debugging Constellation applications

With changes to the entire architecture and front-end stack, Constellation requires developers to utilize new tools for debugging Pega Platform™ applications. While debugging in Constellation may initially feel challenging for developers who are accustomed to relying heavily on the Clipboard and stateful interactions, Constellation provides a variety of debugging options that are modern, powerful, and well understood across the web developer ecosystem. 

This topic examines the tools used to debug Pega Platform applications built on Constellation.

The UI Inspector

The UI Inspector is a built-in Pega Platform™ tool that enables you to select UI components on your screen to gain insight about their place in the UI hierarchy and visualize information about the Constellation UI components, including metadata and field properties and View properties.

Run the following code in your browser's Console to start the UI Inspector:

PCore.getDebugger().toggleInspector();

Note:  The PCore and PConnect APIs are not available in the App Studio shell. To utilize methods related to PCore and PConnect, it is a best practice to launch the Portal from Dev Studio. To learn more about using the PCore and PConnect Public APIs to debug Constellation applications, see Using PCore and PConnect Public APIs

The application refreshes. An Open UI Inspector icon appears on the right side of the window, as shown in the following figure:

Open UI Inspector icon
Note:  The UI Inspector is available to all users regardless of role and, once activated, remains in the local storage of your browser. As a result, the UI Inspector persists even if you log out or refresh. Run the same in the console to stop the UI Inspector: PCore.getDebugger().toggleInspector();

Clicking the Open UI Inspector icon opens the UI Inspector pane on the right side of the window with a list of components. Each component has a Metadata icon that displays the component metadata. In the following figure, the metadata for the pyAddressForm View is displayed:

A View's metadata in the UI Inspector pane

When you are finished working with UI Inspector, run the following code in the Console to turn off the UI Inspector functionality:

PCore.getDebugger().toggleInspector();

Note:  To learn more about the structure of your application's UI by using the UI Inspector, see Checking your application with UI Inspector.

The Pega Clipboard

The Pega Clipboard is partially supported in Constellation applications.

The Clipboard tool is only usable to investigate static data when a Case is run in Preview mode.

It is not possible to run the Clipboard tool from the end user (React-based) Portal, or to run it from Dev Studio and then switch to the user Portal thread to investigate live data.

Constellation applications communicate with the Infinity server using the Constellation DX API V2, and this is a stateless interface. Because of the stateless nature of Constellation, the Clipboard tool is released after each DX API call. 

The Tracer tool

Pega's Tracer tool is supported for Constellation applications with some changes.

Because Constellation applications are stateless and rely on DX APIs, the Tracer tools' results window reflects the scheme in which your application interacts with a browser during a browser session. 

The following options are still supported for the Tracer tool:

  • Running a full trace from both App Studio and Dev Studio to trace the whole requestor session.
  • Tracing Service REST Rules – this option is especially useful when debugging DX API calls. This also works when running a Service REST simulation.

The Tracer tool can be used to open the current Step Page of any Rule that is run during a Constellation DX API call, or it can be set to watch for a particular Page. There are some differences in the output:

  • Tracer tool output is grouped by Constellation DX API call
  • Each UI action generates a separate Constellation DX API call. The stateless architecture forces each request to follow the same procedure:
    1. Authenticate the API call
    2. Invoke an Automation Rule.
    3. Process the initial setup (ApplicationSetup, InitialProfileSetup, etc)
    4. Process the API request
    5. Return the response to the client

There is a new Tracer tool setting called View Rules. As seen in the following figure, you must open the Tracer tool's settings and select the View Rules checkbox for the Tracer to capture the relevant information:

Updating Tracer setting to capture View Rules information.

The View Rule setting enables you to trace Views and investigate the View metadata being passed back to the client.

For greater clarity, the results window groups events by request ID, because in Constellation applications multiple requests can be active simultaneously.

Note: For more information about debugging Constellation applications using the Tracer tool, see Application debugging by using the Tracer tool.

The DebugPegaAPI dynamic system setting

For more verbose debugging of API calls, set the DebugPegaAPI dynamic system setting Rule equal to true, as seen in the following figure:

The DebugPegaAPI rule set equal to true.

This option logs additional fields in the Pega API Rest Service Info statements, helping to debug Page instructions and field level security.

When the DebugPegaAPI rule is active, the following information is saved into the Pega log files:

  • Input values used in the request body of the DX API calls
  • Actions performed by the DX API
  • Fields in the View where your DX API encounters errors and exceptions
  • Descriptions of the cause for errors and exceptions
  • Error codes and exception numbers

Debugging Views in Dev Studio

You can access the metadata for each View in Dev Studio. To inspect the JSON associated with a View, first set the rule pxEnableC11nDev When Rule to true, as seen in the following figure:

The pxEnableC11nDev rule set equal to true.

To run a quick search for the View rule, enter the following syntax into the Search bar: ViewName pxObjClass:Rule-UI-View. Alternatively, use the App explorer, and search Rule-UI-View and search the list of Views available in your application, as seen in the following figure:

The list of available Views using Rule-UI-View in the App explorer.

When you open a View rule in Dev Studio, the result displays the metadata associated with the individual View. In the following figure, you see the JSON data associated with the ResolutionMethod View:

ResolutionMethod View JSON Metadata
Note: For more information about debugging Constellation applications, see Tools for debugging Constellation

Check your knowledge with the following interaction:


This Topic is available in the following Modules:

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