Sunday, 25 November 2018

How to Use Navigation in PEGA


How to Use Navigation in PEGA

Lets assume we have a portal in which there is a Navigation on the Left side and header on the top and Main Working area is in Right Side like this



Now On Clicking Home, Corresponding Home content should visible in Main Content area,
On Clicking About Us, Corresponding About Us Content should visible in Main Content area,
On Clicking Services, Corresponding Services Content should visible in Main Content area

How to achieve this in Pega?

There is a rule called Navigation rule , by using this we can achieve this concept. Lets see how to use this practically.
Every portal has a portal rule, Manager portal has a portal rule, Case Worker portal has a portal rule.
Lets Create One Portal Named "Lets Shop".

In the access group we can see the available portals in the application. Click Add Portal and add our portal by creating New one.


I created a portal, Here we have to map a Harness that will visible when we launch the portal.




I created a New Harness Name "LetsShopMainHarn" and mapped to our portal rule and save.


I mapped our portal in list of portals in Access Group Rule. Now we can launch our portal, Lets see how it looks .


Now I launched the portal, there is nothing in this portal, because we not configured anything in the harness.

So lets design our portal.


Choose Header Left screen layout.




Now lets Create One section for Header Area.




I added my Header Section contain one label.

Lets Create Navigation Section and add Navigation rule in that section.




I drag and drop the menu control from Advance Category and added a navigation rule.

Now we have to add Menus to our Navigation rule.


I added the first menu of our portal named 'Home', We have to add action for this menu, then only corresponding harness will load on the right content area of the portal.


I select Harness from action and select Target as "Replace Current".We have to provide here the Harness which we are going to create for Home Page.

Lets Create and Map HomePage harness.


I created one Harness with some content for Home page and added to the Home Page Menu.


Next to the Harness I added another one action "Run Script". We have to add this function for indexing purpose. Here I mapped Home page index as 0, Then it automatically take about as index as 1, our service index as 2 respectively.


Similarly I added menu for about us , and added Harness for About us and after the Harness we have to add one Script "RemoveScreenLayoutMask". If we not used this function then a empty screen will display if we cut the harness, So added this script.


Similarly I added menu for Our Services and added harness for this menu.


Now we finished Navigation rule part. Lets Design content part of our Harness. 



Lets Drag and Drop One section, I provide Name for this section like "LetsShopMainArea"

In this section, Our First Layout should be "Dynamic Container", Why we should use Dynamic Container??.

If we are not use dynamic container, Then on clicking menu your harness will not load on Main Content area.
If you use Dynamic Container, then the harness in your menu will replace the harness that we provide in the Dynamic Container.


Lets implement Dynamic Container in our Section.




We have to load the harness dynamically in this section so we have to choose Harness as Default View in this option and we have to provide a Default harness which is visible on portal launch. I add HomePage harness in this option.





Delete the Dynamic layout which is there as default.


Lets Launch the portal and see the result.


This is the screen which is visible on launching portal, Now Click About Us and check AboutUsHarness is loading or not.





On Clicking About Us "AboutUs" Harness is loading.

Lets click Our Service and test that menu also.


Now all the menus working properly. If u have any doubt ask in comment :)

How to Insert Records into Table in Pega

How to Insert Records into Table in Pega


I was created an Local Data Type with Zero Records, Lets see how to insert data in to Table.

I have created a flow , in the first assignment I get Employee Information .In  the flow action post action I mapped an activity to enter the information what we get in the first assignment into the table.


Now add activity to flow action post action.

Activity Methods used to insert data to table.

Pages and Class Tab:

In this activity we are inserting the data in to the table, We have all the data except EmployeeID, We have to get incremented  EmployeeID for each employee.

EmpCaseInfo page to store Case Details what user provide in the form.
MaxRecords page to store existing records in table.

Obj-Browse to retrieve all the data which is already present in the table. We are using this step to get the count of the table, Now we can add 1 to get next employee id for current Case.
In the property-set , I copied the data in Primary Page(pyWorkPage-TGB-HRApps-Work) to EmpCaseInfo(TGB-HRApps-Data-EmployeeInfo) Page.


EmployeeID is calculated by record count of the table +1, if 10 records are already present then pxResultCount will be 10, for our next record we are providing EmployeeID 11.


Obj-Save to save the data into Table.

Lets test the activity by run the flow and enter test data.

I am providing this data and click submit.

Now you can see first record is inserted.

Lets provide another one data.
After processed this case, you can see a new record is added in table.

That's all insertion of data into table. If you have any doubt ask in comment.

Saturday, 27 October 2018

How to change Ruleset Password when password is forgotten

How to change Ruleset Password when password is forgotten

Lets assume, You lock a ruleset with a password after some month you need to open that ruleset but you forgot the password. Then what we have to do??

We can write one simple activity to change the password.

Actually all the ruleset details like RulesetName, Ruleset Version, Ruleset Version Password  will be stored in Pega Rules Database.

So we can write one simple activity to update the password in the table .. Lets see how to do that .



Now Lets see how to open this ruleset. I dont know the password of this ruleset.

We can create activity in any class.  I create my activity in TG-HRApps-Work

We have to write 4 steps to achieve this.

  1. Page-New - Create New page and to store all the details that we are going to process.
  2. Obj-Open-By-Handle - To open the ruleset instance from database 
  3. Property-Set-  To update password with new password.
  4. Obj-Save- To save the details in to database.

I created a page with name "RulesetRecord" and below is the pages and class tab


Ruleset version details are there in Class Name "Rule-Ruleset-Version" , So I provide this class name.

In second step we have to open the record , by using Obj-Open-By-Handle method. For this method we have to provide the pzInsKey of the record to get the record detail to clipboard.
Normally pzInsKey Structure will be like

"RULE-RULESET-VERSION RulesetNameVersionNumber”

Now I try to open HRApps 01-04-01  so my key will be like
"RULE-RULESET-VERSION HRApps 01-04-01"

In Third step we have to use  Property-Set 
Here for this property we have to provide  new password. My New password is “Learn”.

Then we have to use Obj-Save to save the new password. With Write Now Enabled

Save and run the activity. Now U can open the ruleset with new password. Old Password is replaced with New Password.

Activity Status

Now Lets Open the ruleset with New password.



Now my ruleset is Unlocked. :)

Thank You guys for reading.

Wednesday, 24 October 2018

Obj-Delete and Obj-Delete-By-Handle in Pega

Obj-Delete and Obj-Delete-By-Handle in Pega


Today We will see how to use Obj Delete in Pega and how to use Obj-Delete-By-Handle in Pega.

This method is used to delete record from database. What is the difference between these two method??

  • If u don't know the Key (pzInsKey) of the record and U have to delete the record then U have to use Obj-Delete. 
  • If u know the Key(pzInsKey) then U can use Obj-Delete-By-Handle to delete the exact record.
Lets see how to use these two method in pega.

OBJ-Delete-By-Handle

My Local Table record is shown below.

Now lets create one activity in Work class and Write Code to Delete the record in this table.


Now I am going to delete a record from Table where Title is "Insurance Options" for that I use Obj-Browse

Now it will retrieve the record where title is Insurance Options. And U can see GetRowKey is enabled, that means it retrieve key also to clipboard. 


Lets Check key is available or not in clipboard.


pzInsKey is there so we can use this key to Delete this record. Lets Do it



Now in 3 rd Step I Loop through all the records available in CourseRecords.pxResults PageList and Copy the Key to a Local Variable Named Key.

In 3.1 th Step I used Obj-Delete-By-Handle 
Here I pass the Key Value to Delete . This indicates we are going to delete the record having the provided Key.

After this step I used Commit Method to Complete the process.

Lets Run and See whether it is deleting or Not.


Activity Run successfully Lets check in Local Table whether value is there or Not.


Now u can see the record is not there in table. We Successfully deleted a record. :)

OBJ-Delete

Lets See How to use Obj-Delete.

I will use this Method When I don't know the Key Value. Lets Delete the record having ID = SAL-002

I used Obj-Open to get the record in Clipboard.

Lets See whether Obj-Open retrieve values in Clipboard
.

Data is there , Now we can delete this record.


Now I added the Method Obj-Delete and Enabled Remove and Immediate Check Box.

And at last I added Commit to complete the transaction.

Lets Run the activity and test whether Record is deleted or Not.


Now U can see the record is not available after delete.



U can see SAL-002 record is not here. Thank u friends for reading and learning with me.If any doubt ask me in comment . Bye :)