Thursday, November 15, 2018

Pega Differ Tool

Pega Differ Tool - Pega PRPC Exchange Component

Pega Exchange Components had given some tools which are developed by pega partners. It can be used by anyone and for some tools which has license which need to be obtained from their companies.

In this blog we will check about Pega Differ Tool.

Pega Differ:

This is used to identify differences in execution patterns between two traces by highlighting difference while also allowing users to ignore minor differences based on particular attributes

This tool can be downloaded from:
https://community1.pega.com/exchange/components/pegadiffer

Scenario for easy understanding:
Some times in our application(consider environment Dev and Prod), in Dev one functionality is working and in prod the same functionality is working. So we usually execute, run the tracer and compare it with each other. step by step we need to compare each values. That is tedious job to identify the issue.

In Pega Exchange, We have one tool available, "PegaDiffer" to compare the results of the tracer and check it easily.

Pega Differ Tool looks like:


Steps to use the Pega Differ:
1)Run the tracer in Dev or any other environment to compare and save the result.
2)Same way run the tracer in other environment which needed to compare and save the result as well.
3)Open the tool and load the two files.

In the tool, Under Source Tab, Click the icon  , to load the source file ( in our case, its dev environment).  And under target Tab, click the same icon to load the file(ie. Prod Environment).

-- source tab


-- Target Tab

once its loaded, we will get the list of differences between the traces.
Whether its been called in the source or target and any difference in the value of properties.

If same values are present in the source and target, then it display as below, no highlights will be there.


If differences are there, then it will highlight as below:




Then these differences can be exported to excel sheet.




Note: Please let me know, if any need to modify.

Wednesday, November 14, 2018

SQL Queries in Java Method in Pega PRPC

SQL Methods in Java Method in Activities:

In Activities, if we want to write some custom java functions or some java methods, we will be using Java Method.

Now we will see how to include custom SQL queries without RDB methods.

In Pega, in activity whatever the steps you are including, it will be converted to corresponding Java steps. For each and every method also it will be behave in the same way. similarly RDB Methods also will be converted to corresponding Java methods using inbuilt pega functionality.

In this approach, we will see how to call the Select Query in java method by using inbuilt java methods.

Sample SQL approach:

String StrSQL= "Select pzInskey as \"pzInsKey\",pyClass as \"pxObjclass\", pxUpdatedatetime as \"pxUpdateDatetime\"";
StrSQL += " from {class:Data-Rule-Summary} where rownum=1";
try{
tools.getDatabase().executeRDB(strSQL, pg);
java.util.Iterator iterResults = pr.getProperty(".pxResults).iterator();
ClipboardPage resultPage = null;
while (iterResults.hasNext()){
ClipboardProperty resultProperty = (ClipboardProperty)iterResults.next();
resultPage = resultProperty.getPageValue();
}


} catch(DatabaseException dbEx){
oLog.error("Error while listing instances", dbEx);
}


Please let me know, if any correction is needed.