Thursday, 12 July 2018

Call a Pega Activity from Java

Sometime we may need to call a pega activity programmatically instead of declaratively. So using Java we can call a pega activity. 
We need to follow these steps in order to call the activity from java:-

1. Create a map of parameter name-value pair  :-

 HashStringMap  parameters = new HashStringMap();

parameters .putString(“pxObjClass”, “Rule-Obj-Activity”);
parameters .putString(“pyClassName”, <class_name>);
parameters .putString(“pyActivityName”, “<activity_name>” );


2. Use pega public API tools to call activity:-
tools provide many public API methods. we will use doActivity.

tools.doActivity(parameters , workpage, tools.getParameterPage() );



Sunday, 8 July 2018

Some Important Pega PRPC database tables

Following are some general pega rules database tables which are used to store different objects :-

pc_assign_worklist:
 
It is used to store worklist related assignments

pc_assign_workbasket:

Work basket related assignments are stored in this table.

pc_work:


It is a default table in pega to store work objects. This behavior can be customized to use a user defined table to store work objects.
Steps to follow for customization:-
1. Copy the pc_work table schema  and modify the table name
2. Change the class group mapping (Data-Admin-DB-Table) to the newly created table.

pc_data_workattach:

Store work objects attachments i.e. files, screenshots etc.

pc_history_work:

It is used to store work objects history.

pr_data:

Default table for data instances.
 
 
pr_operators:

Store the Data-Admin-Operator-ID instances
 

p.s.:- All the PegaRULES database tables have two very important common columns, pxObjClass and pzInskey

pzInsKey:

pzInsKey is called the handle for an instance because it is a unique column for each instance which store the key with exact modified date.

pxObjClass:

The pxObjClass column, present in every table, identifies the Process Commander class of the row. When committing an instance of a concrete class to the PegaRULES database, the system uses the pattern inheritance algorithm to find the table name.

Reference: Pega Community

Difference between Page-Validate and Property-Validate methods in Pega Activity

Page-Validate and Property-Validate are some of the mostly used methods in Pega activity. Here is the difference in both the methods:-

Page-validate:
Page-Validate method is used on a page property to validate all the embedded properties which are present on a page. If a page has embedded pages i.e. Page-List, this method works recursively to validate all the properties for each Page. This method consumes a lot of system resources and takes more time. If you want to validate specific properties use Obj-Validate method with a Rule-Obj-Validate rule.


Property-Validate:
Use the Property-Validate method in an activity to ensure that a property value meets certain requirements including:

1. Property value should be non-null   (Select the required check box in the method)
2. Perform Rule-Edit-Validate rule on a property

A property-validate method is used to impose restrictions on a property value. We can validate multiple properties using Property-Validate method.