Need to forcefully release lock which hold by other requestor.
ABC operator login and opened I-93 WO. Now XYZ operator need this WO .
We are showing section for Unlock where XYZ will enter I-93 and click Unlock button, SO now what are the things we need to do on click of this button to Release Lock.
The immediate question comes to our mind is ABC Changes will lost thats fine even it get lost.
**Moderation Team has archived post**
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
You can look into the ReleaseLock activity from Work- class. This activity release the lock on the work item.
This is called from the stream Work- DisplayLockInfo. The lock on the work item should be released when the user closes or hits submit on the work form. The activity unlocks the work object and displays the work object in Review mode.
We have to understand that pxForceCaseClose is an API that is to be used to resolve the case and not close the opened work in the UI. So this API will not help in releasing other users lock.
And regarding the actual problem of how to release other users lock. There is no OOTB api available to release another users lock and this is not provided as this is a security violation that the other users data is being lost. If the actual reason of the second user getting into this situation is parallel work may be Optimistic locking feature where two people can open work at the same time and who ever submits first will get the lock is an option. This feature is available in 7.1 based on your PRPC version this can be considered.
I always remind users that you should indicate the version of Pega Platform on which you are working. This topic is particularly sensitive to that, as the behavior has changed dramatically from release to release.
Whatever scheme you come up with, be aware that although it may work when the lock is being held by a requestor running on the same node as the user releasing the lock, there may be huge time delays if requesting a lock to be released on another node. Pega guarantees no SLA for releasing the lock.
Behavior is also different if the lock is held by the same u
ser but on another node, and therefore another Requestor. In that situation, if done correctly (sorry, I don't know details), the Requestor on the other node holding the lock will be shut down.
And, whatever you do, if the lock is held by a user who is no longer on the system and whose Requestor is gone, then you won't be able to release that lock by any "ordinary" methods.
So you are actually dealing with a very complex topic.
Were you able to implement this functionality? If yes, can you please share how this was implemented? We have the exact same requirement and ReleaseLock activity doesn't release lock on a WO that is already locked by a different requestor.
Thank you for posting your query in the PSC. This looks like an inactive post and hence, we suggest you create a new post for your query. Click on the Write a Post button that’s available on the top right pane of this page. Once created, please reply back here with the URL of the new post.
You may also refer this discussion link as a reference in the new thread.