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 :)

Monday, 15 October 2018

Obj - Sort in Pega

Obj - Sort in Pega


Hi Friends Similar like Obj-Filter We can easily guess the functionality of this Method. It will sort the records in Page List Property in clipboard.

Lets See How it Works,


This is My Local Data Table Containing the List of Course Records.


And this is My activity Containing 3 steps.
  1. Page-New -To store data that I process in this activity
  2. Obj-Browse- To retrieve data from Local Data Table
  3. Obj-Sort - To sort data in the page list.

Here is the Pages and Class Tab.

In Obj-Browse I Retrieved all the records from Table.


Now In Clipboard it retrieved all the values 

Before Applying the Obj-Sort First Record is.


Obj-Sort Method.

PageListProperty - We have to provide the PageList in which the records are available.
Class - We have to provide the Class Name to which Class is refering.
Sort Property- Here we have to provide the Property Name by which we are sorting. For example, if I want to sort by Name I have to give here (.Name) .Now I try to Sort Based on Book Title , So  I provide here SortProperty as .Title. 

Then we unchecked that Descending Property this method will sort records in Ascending Order. If we checked this checkbox it will sort the records in descending order.


Lets Check Once in clipboard and see the result of our step.

First Record:

Last Record:




Now u can see that the records are sorted based on Title. 

Thank U Friends for Reading. If any doubt, ask in comment. See U :)

Obj-Filter in Pega

Obj-Filter in Pega

Hi Friends, Today I learnt about Obj-Filter , I will share My Knowledge to you.

From the Method Name itself we can guess the functionality of this Method. Your Guessing is correct. This method is used to filter records .

Let we see in practical. Below is this List of Records in Class TGB-HRApps-Data-Courses

Now we will use one activity to retrieve those records from table and Filter based on some condition.

This is the activity I created in TGB-HRApps-Work.


I added 3 steps in activity

  1. Page-New to store all my data while processing.
  2. Obj-Browse  to retrieve records from Database table
  3. Obj-Filter to filter the retrieved Records.

Here is the Pages and Class Tab


I retrieved all the records from Table Using Obj-Browse Method.


Now Up to this step It will retrieve all the records from Database On seeing the Clipboard U can Get some idea.

Next in Obj-Filter I added a when condition to retrieve only Records having Department "All"

In Obj-Filter Method,
In List Page We have to provide the Page List in which the records are available.
In Result Class We have to provide the Class in which the page list is belongs to.
In When condition we have to provide a when rule , In which we have to write filter condition.

Here is the When rule 


This When for  Filter only the Records Which Contain Department "All"

Record Which satisfy the When rule only remain in the page, other records will be removed.

So  Records having Department only remains in my page, Lets execute and See the result.


Now u can see there is 6 records in the Course Records Page.

It contain only the records Department contain All..

Thank u Friends for Reading.. See u. :)

Monday, 1 October 2018

How to recover deleted rule in pega

How to recover deleted rule in pega

Immediate recovery of rule in pega

In case if you mistakenly delete some rule, How to recover that rule? . Lets see how to do that.


Now I opened an activity and I am going to delete this activity. This is my activity.

On delete pega will ask for description.


After Delete the rule, On Upper right corner you can see the Restore Button. On clicking that button Rule will be recovered.


After Clicked that button, My rule is recovered.


How to recover deleted rules after few days in pega

Select Designer Studio -> Process & Rules -> Tools -> Find Rules


You can able to see this window on following that path.


In Critera to Find Rules, U can see many filter Options.

  1. Recently Updated.
  1. Recently Updated By Ruleset
  1. Find by Ruleset, Version and Rule Type.
  1. Find By Circumstance.

You can use any method to recover your Rules.

Now We use Recently Updated filter.


Before using this we have to delete a rule for recovery.
I deleted the same rule.

Now Click on the Number of rule it showing on right side.

Now window will display like this.
Recent updates to rules are displayed at the front line. In our case my recent update is delete an activity, that is at the first record. 

On clicking that record it show a message at buttom.

It says that record is no longer exists, so we have to recover from the history, so click on the Button to recover.

On clicking the Button the deleted Rule is opened, There Restore button is there,  We can use that button to restore.

I hope that U know how to recover the deleted rules in pega. Thank you for reading. We will see in next post. :)