PRRuntimeException occurs and a custom agent stops processing
PRRuntimeException occurs and a custom agent stops processing.
com.pega.pegarules.pub.PRRuntimeException: unable to execute agent: AgentRuleset #0: MyCo-MyOrg-Work-MyClass.MyAgentActivityCannot obtain a lock on instance TVSA-MX-TBA-WORK SAV-2114, as Requestor HAAA0AAAAAA0AA0AAAAA0GAA000A0AAA0A already has the lock
Steps to Reproduce
Start the custom agent.
An issue in the custom application code or rules.
Error Handling was not in place to account for scenarios where the agent attempted to obtain a lock on a work object, on which another requestor already had a lock.
Here’s the explanation for the reported behavior:
The error occurred because another requestor already has a lock on the object which the agent is trying to update. Hence, this causes the activity to exit and the agent to stop processing.
As a local-change, add an Error Handling for the functionality that attempts to lock the work object.