Question

3
Replies
37
Views
Richard Munie (RichardM3864)
Centene Corporation

Centene Corporation
US
RichardM3864 Member since 2019 3 posts
Centene Corporation
Posted: 1 week ago
Last activity: 4 days 22 hours ago
Posted: 7 Jun 2021 14:01 EDT
Last activity: 10 Jun 2021 12:47 EDT
Solved

Testing for locks using isPageLocked(tools, pagename)

I have been struggling with coming up with a solution for disabling a button when the case viewed in recap mode has it's lock held by another. My research thus far has drawn me to the page https://community.pega.com/knowledgebase/articles/application-development/85/object-locking

and the suggestion I see that looks to be what I want is "To test whether a lock is held on a page already on your own clipboard, call the function rule isPageLocked(tools, pagename)."

I have tested this function and the return value has been false even when the lock is definitely held by another operator. 

I also noticed that the method used in the function is (tools.getDatabase().getLockManager().isLocked(aPage, info) == true) however in the resources>API Engine>Database>LockManager documentation it is indicated that isLocked is a deprecated method.

There is a suggestion to use  lockExists(String, StringMap) instead. is there an OOTB function that uses this method instead? How does one call such a method outside of using a function if that is possible.

***Edited by Moderator: Pooja Gadige to add platform capability tags***
Pega Platform 8.5 Decision Management Case Management User Experience Insurance Data Scientist