Support Article
Issue with Unlock Pega API method
SA-13418
Summary
In a multi node environment in IAC session, developer is using Unlock API method to unlock the Workobject held by same operator id in different requester session but it fails some times, that is the lock on the Work object is not released and developer sees the lock when trying to do some actions on the Work object.
Error Messages
No Error Message users sees lock screen when the work object is open.
Steps to Reproduce
1.In an IAC session, access a Work object with OperatorId A in requestor session-1.
2.Login with same operator in the requestor sesssion-2.
3.Try to access the same work object after unlocking the work object by an activity using API method unLock. Observe that the lock on the Workobject is not released.
Root Cause
An issue in the custom application code or rules.
Developer is using a batch requestor to release the lock, and inorder to release the lock developer is passing pzInskey as parameter to the unlock API.
However developer must pass UserName and Password to release the lock.
Resolution
Below is the code snippet to resolve the issue:
tools.getParameterPage().putParamValue("pzUserName","Admin@TeSE");
tools.getParameterPage().putParamValue("pzPassword","rules");
java.lang.Object obj = tools.getRequestor().queueBatchActivity("TeSE-SE-Work","UnlockWO",tools.getParameterPage(),null,null,false);
Note: According to the guard rail, it is not suggested to use a Batch Requestor or an agent to release the lock on work object.
Published August 31, 2015 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.