How to Eliminate the PEGA Properties in the Clipboard Page?




The most common question we hear in PEGA is “I need to remove "pxObjClass" property from the clipboard page”. As it is a reserved property we can't use Property-Remove Method in Activity. 

Now let us see how we can remove the PEGA properties(px, py and pz) from the Clipboard Page using java step and to convert it to JSON String.

Then we can convert the JSON String to Clipboard Page with no pega properties in it.😊

Lets get Started:
I have created a sample DataPage and loaded using Load-DataPage Method.


We can see the Data Page has both Pega and User-Defined Properties in it.This page will be provided as the step page to the java step. 


The below Java Step is used to Eliminate the pega properties and convert it to JSON String format.
Logic:

Iterate the ClipboardPage to get all its Properties and Values.

Add the Properties and its Values that do not start with (px, py & pz) to the ArrayList Object.

Now convert the ArrayList Object to String and then replace the “[” to “{” by String replace method to get the String in JSON format and store the value into the Parameter.


Used the Show-Property method to display the value stored in the parameter.


The JSON String after eliminating the pega properties.


Now we will convert the JSON String back to ClipboardPage using below java step.
Logic:

Create a new clipboardpage by using CreatePage() function by passing Class Name and Page Name as a parameter.

Use the adpotJSONObject() method to convert the JSON String to ClipboardPage.


Now the ClipboardPage is created after eliminating the Pega Properties (px, py & pz)with the Page Name specified.



Happy Learning!!!😊






Popular Posts