Skip to main content

Pega tools for debugging Constellation applications

With changes to the application architecture and front-end technology stack, Constellation introduces a different approach to debugging Pega Platform™ applications. Rather than relying on stateful interactions and tools such as the Clipboard, developers use a combination of Pega Platform tools and standard web developer tools to investigate application behavior. Understanding the available debugging tools and when to use them is essential for effectively troubleshooting Constellation applications.

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 into their place in the UI hierarchy and to visualize information about Constellation UI components, including metadata, field properties, and View properties.

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

PCore.getDebugger().toggleInspector();

Note:  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 your browser's local storage. 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 Infinity Studio and then switch to the user Portal thread to investigate live data.

Constellation applications communicate with the Infinity server via the Constellation DX API V2, which is a stateless interface. Because of Constellation's stateless nature, 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 Tracer tool continues to support tracing of Service REST rules, which is particularly useful when debugging DX API calls and can also be used during a Service REST simulation.

The Tracer tool can be used to open the current Step Page for any Rule that runs during a Constellation DX API call, or 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

Inspecting View metadata

Constellation applications use a model-driven architecture in which Views are generated from the application's Data Model, Field Types, and configuration. When troubleshooting a View, it is often more useful to inspect the generated metadata than the underlying rule definition.

You can use the UI Inspector to examine the metadata associated with a View and its components at run time. Open the UI Inspector and select the View that you want to investigate. The Metadata panel displays information about the selected View, including its configuration and the properties used to render the user experience. Reviewing this metadata can help you validate View behavior, identify configuration issues, and better understand how the View is assembled at run time.

In the following example, the UI Inspector displays the metadata associated with the Pulse widget:

UI Inspector showing metadata
Note: The metadata displayed in the UI Inspector reflects the generated View model that the application uses at run time. For additional information about troubleshooting Constellation applications, see Tools for debugging Constellation. 

Check your knowledge with the following interaction:


This Topic is available in the following Module:

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