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.

Saturday, June 9, 2018

Pega PRPC PDF Generation - 1

Pega Default functionality:

In Pega PRPC,  Flow Rule Pega had given Smart Shape by default.
as utility, which will generate a PDF and attach to the Work Object, in this session we will see, using the same functionality how we can download file.

In this, we will see how to generate PDF using the default functionality and download the Generated PDF File.

Consider a scenario:
On click of on button, we need to generate a displayed section to PDF.

Steps to follow:
1. On click of button, in the onClick function, we need to call an activity.
2. In Activity will three steps.
   a.need to pass HTML name Property-Set-HTML to method for creating the HTML with the required values from the Clipboard page.
   b. the returned html need to be passed into the default activity - Call HTMLToPDF.
   c. down the generated file as PDF.






and step 3:


This will download the PDF file.

Note: Please let me know in the comments if any thing need to Change/Modify.

Tuesday, March 20, 2018

In Pega PRPC to hide or display column in the Grid Layout


In Pega PRPC, the list of items we will use grid format to display the items.

In Grid Layout, if we want to display/hide a column based on some value, it will display empty column or header will be empty. it won't look good to view.

We can add below code to make the column hidden without any empty header.
Sample code: <pega:when name="When Rule Name"> display:none;</pega:when>







In this grid, consider based on some requirement we need to hide Lot Quantity column without any space or empty column in the grid.

In this inline section we need to add the above code need to add.

"When rule"needs to be created at the top level page and with the same name we need to create "When rule" in the Data class item level also, so at runtime, it will not give an exception for "No rule found".

Example: pyWorkPage.PageList(PegaFW-Data-Person)
Actual "when rule" should refer properties from pyWorkPage level and Another when rule with the same name at "PegaFW-Data-Person" class.


Note: Please let me know if anything needs to modify

Saturday, February 24, 2018

To Display Worklist and Workbasket in same Report Definition

Displaying Worklist and Workbaset in the Same grid with joining the work table:

In Pega PRPC Report definitions are used to get the results from Database table.
if we need to get fetch results from two tables with equii join we will get the results. From Prpc V7 onwards we can get the results based on Left Outer and Right Outer Joins.

In our example to see how to use left outer join, Assign worklist and Assign workbasket are stored in two different database tables. And work is stored in another table.

Normal scenarios will be like displaying the results from work list or work basket in a separate grid. In our requirement, we need to display worklist and workbasket in the same report or in the same grid.

we will see how to implement it:

A report definition needs to be created in the Work class and in the Report tab in the joining condition we need to provide Both Assign-Worklist and Assign-WorkBasket with conditions (.pxRefObjectKey == .pzInsKey )

In the Data Access Tab, we need to add both the classes in the join condition with Join Type as "Left Outer Join" as "include all rows in the joined class" with Condition pzInskey == .pxRejObjectKey.




On Executing we can see the results in the same report definition.



Note: Please let me know if any updation is needed.