Pega
Class related facts
https://www.youtube.com/watch?v=hA7lTYaDroQ&ab_channel=TechRidewithPK
Concrete vs Abstract classes
What is a class
group?
As the name suggests it’s a group of classes. There may be
multiple work classes inherited from Org-App-Work class such as
Org-App-Work-ABC and Org-App-Work-XYZ.
There are 3 options to select from in the drop down
·
Belongs
to a class group – Will be mapped to an existing parent class. For example,
Org-App-Work-ABC class can be mapped to Org-App-Work class group.
·
Is a
class group – If we select this option a new class group instance will be
created in the name of the particular class. Which can be viewed from the
records > Sysadmin > Class Group. Use this option if there is a large
number of class instances created for the particular case time.
·
Does not
belong to a class group – Usually this option is selected for data classes
so that we can have a dedicated table. But we cannot select this option for
Work classes.
(Make sure you define key in the
class group)
Test Connection
We find the mapped database table
in the Records > SysAdmiin > Database Table
External Mapping
We don’t need to explicitly map properties in the external
mapping table. If the property name does not change PRPC will automatically map
the columns in the table. This mapping will automatically be handled by PRPC
when property optimization is done for a page property, where additional
property will be made in the class and will be assigned to it.
How to map a class to
a different database table?
1. 1. Create
a database table from sql
2. 2. Create
menu > SysAdmin > database table à
Provide the class name for both the fields and create and open.
3. 3. Specify
the Table name and save
4. 4. Save
the class instance
Obj- Refresh-And-Lock method
https://pegalearnings.blogspot.com/2019/06/obj-refresh-and-lock-method-in-pega.html?sc=1679545569985#c4148323625021409945
summary
Obj-Open method can be executed with or without acquiring
lock. For example, if we just want to read the record we can open the object
without acquiring a lock.
But if we want to Update the record we must acquire the
lock. Here, the WO we are trying to acquire the lock may be already acquired by
someone else. In this case if we just use the Obj-Open method with lock option
checked it will fail the step as the lock cannot be acquired.
Here is where the Obj-Refresh-And-Lock method comes into
picture. As a solution to this problem we can,
1.
Open the object using the Obj-Open method
without acquiring the lock
2.
Call Obj-Refresh-And-Lock method and acquire
lock (This method will not do anything if the lock is already acquired)
3.
Do the necessary changes to the opened page
4.
Commit the page
Note that some of the steps are commented in the above
screenshot. This is only to refer the methods used in the explanation.
Important
considerations
·
Obj-Refresh-And-Lock method has a check box “ReleaseOnCommit” which has to be
checked. Otherwise lock will be there forever. And make sure to commit after using this method.
·
We can view the records of instances which are
locked using the class instances of System-Locks.
·
If we want to explicitly release the lock that
has been acquired we can call the method Page-Unlock
·
When tracing the locks make sure to enable
“Locking” check box in the tracer
---------------------------------------------------------------------
Forward Chaining and Backward
Chaining
This concept is used in Declare Expressions
A+B = C
We can configure the DE to execute in two different ways in
the Change
Tracking tab
1. Whenever
the input value changes – Forward
Chaining
2.
Whenever Used – Backward Chaining
Assignment | Worklist | Workbasket |
Routing
Assignment is an instance of a class derived from Assign- base class. Assignments record
a temporary condition of an open work object within an executing flow. In
laymen terms Assignment is a Task.
Assignments are created by a flow operating on work object,
but assignments are not themselves part of the work object. The system save
data recording an assignment in instances of the Assign-Workbasket (pc_assign_workbasket) or Assign-Worklist (pc_assign_worklist)
(When an operator
submits the assignment FinishAssignment activity will be executed)
Important properties
of the Assign-Worklist/ Assign-Workbasket classes
1. pxRefObjectKey (Key) – This property keeps the
mapping to the corresponding WO of the Assignment. i.e. pxRefObjectKey =
pzInsKey of the WO
2.
pxFlowName (Key)
3. pxAssignedOperatorID
Where can you find the Assignment information in the
clipboard?
newAssignPage –
which comes under user pages
How to configure the UI when there is
a delay in data loading? – Defer Load Content
This can be configured for dynamic layouts, repeating
layouts, Table layouts or dropdowns
Enabling this will introduce a delay in loading or wait for
user intervention like scrolling/ hovering to load data to the portal/ harness
This can be combined with pagination for more optimal
performance.
Check in the General and Presentation tabs for the
configurations
Access Control Mechanism
- 1. Role Based Access Control
- Attribute Based Access Control
Attribute Based
Access Control
It provides more granular control on application more on
security perspective
Example
I want to show all cases of my class to all users – use RBAC
Now if I want to hide few properties or mask few properties
we use ABAC
Two rules we implement
- Access control policy
- Access control policy condition/ Access When
Actions
·
Read
– user can open a case that meets policy conditions or view data for cases in
the lists/reports or so on
·
Update
– User can create case that meets policy conditions or update data for such a
case
·
Delete
– User can delete a case that meets policy conditioins
·
Discover
– Can see limited information about a case that doesn’t meet read conditions
but does satisfy discover policy conditions.
·
Property
Read – User has restricted visibility to property values including property
values with read and update access.
·
Property
Encrypt – Property is encrypted in database, clipboard, logs and indexes if
no property read policy obfuscates the property, the decrypted value is visible
to user UI control
Enforcement Exceptions
1.
Can only be defined on instances of Assign- ,
Data-, Work- classes
2.
ACP defined on Data- are not enforced in search
queries
3.
Only read policies are enforced in custom SQL
Prerequisites
pzCanManageSecurityPolicies previllege should be available.
We must checkIn the rule to apply the changes
MaskIdentity is Access Policy Condition in which there are
when conditions to evaluate. In the property section define the properties
along with what needs to be done.