How to Retrieve the Pega Platform Version in Your Application

Introduction

When developing applications on the Pega Platform, you may need to access the platform version for various purposes such as compatibility checks, conditional functionality, or reporting. This tutorial explains how to programmatically retrieve the Pega Platform version and store it in a property for use within your application.
Problem Statement

You need to retrieve the Pega Platform version within your application, but standard methods only provide information about the application version rather than the underlying platform version.
Solution Overview

The solution involves creating a data transform that uses the pxGetBuildInfoString function to retrieve the platform version information and store it in a property for later use.

Step-by-Step Implementation

  1. Create a Data Transform
    First, create a data transform specifically for retrieving the platform version:
  2. In Dev Studio, navigate to Create > Technical > Data Transform
  3. Name the data transform ApplyPlatformVersion
  4. Configure the data transform to set your target property with the platform version
  5. Use the pxGetBuildInfoString Function
    Within the data transform, use the pxGetBuildInfoString function to retrieve the platform version:
    @pxGetBuildInfoString(false,false)
    This function returns information about the Pega Platform build. The parameters (both set to false in this example) control the format and detail level of the returned information.
  6. Call the Data Transform
    To apply the platform version to your property, call the data transform from a flow action:
  7. Add the data transform to a flow action’s pre-processing section
  8. This ensures the platform version is retrieved and stored before the action executes

Technical Details

About pxGetBuildInfoString Function
The pxGetBuildInfoString function is a built-in Pega function that returns information about the current platform build. The function accepts two boolean parameters:

  • First parameter: Controls whether to include detailed information
  • Second parameter: Controls the formatting of the returned string

When both parameters are set to false, as in our example, the function returns the core platform version information in a standard format.

Best Practices

  • Store the platform version in a property that’s accessible throughout your application
  • Consider caching the version information to avoid unnecessary function calls
  • Use the retrieved version information for compatibility checks or conditional processing

Conclusion

By following this tutorial, you can easily retrieve the Pega Platform version programmatically and use it within your application. This approach provides a direct method to obtain the platform version through the pxGetBuildInfoString function and store it in a property using a data transform.

References

  1. Pegasystems Documentation
  2. Application data manipulation in Dev Studio | Pega Academy
  3. Pegasystems Documentation