Question
3
Replies
5493
Views
Capgemini
Posted: November 1, 2016
Last activity: January 18, 2017
Closed
Solved
Obj-refresh-and-lock
can anybody clearly explain me the use of obj-refresh-and-lock with real time example.
Thanks in Advance
***Updated by Moderator: Marissa to update categories***
This method to assure that the contents of the step page are current and a lock is held on the corresponding object.This is useful if you are not certain whether the contents of the step page are current or whether your requestor session already holds a lock on the page.
The system checks whether the object on the step page is locked and the lock has not expired. If the lock is held, the method creates the results page as specified in the LockInfoPage parameter, but no further processing occurs.
If the step page does not exist, the system creates a new page.
If no lock is held, the system:
Assembles the key to the object instance using information in the class instance.
Acquires a lock on the object.
Determines whether the current clipboard page is stale, meaning that the PegaRULES database row is newer. To make this determination, it:
Compares the last update timestamp of the instance on the step page on the clipboard (property pxUpdateDateTime) with the pxUpdateDateTime timestamp of the instance on the database. If the times are the same, the clipboard copy is not stale; if they differ, the clipboard copy is stale.
If the pxUpdateDateTime property has no value in both cases, it performs a similar comparison is based on the pxCreateDateTime properties.
If the instance was saved recently but not yet committed, the comparisons are made with the pxUpdateDateTime or pxCreateDateTime in the saved copy, not the database row.
If the clipboard copy is stale, it reloads the step page from the current database instance.
To see how it works, please refer this activity ActionAddToCover under Work- class. This activity is called through the local action 'AddToCover'. The activity basically associates the work item to the specified cover object. The Cover Id is picked from pyCoverOverride property on the current work object page.It has Obj-Refresh and lock method in step 6.