We have had a problem with some of our workflows wherein performing a query, followed by some action on the entry (rename, move, etc.) intermittently results in an entry lock and a failure to perform the action. In the entry below, I perform both repository and DB queries as part of an automated data check / data retrieval process in a loop for a multi-value field. After the loop has completed, I rename the entry with the retrieved data:
You can see where the error occurs on the rename entry action. This causes the system to wait, then retry the rename action after 5 minutes. The problem this kind of issue is causing us is that, the way our QA system works, by the time that 5 minutes is up the file might have been approved for filing and sent to permanent records storage. When this workflow resumes after the 5-minute wait, it pulls the document back out of Records and into QA Review, because that's the status the document had at the time.
I recognize a number of workarounds: I could do yet another query before filing to find the entry's current location or status, or possibly even just move the Rename function. However, we really want to answer the larger question of getting around these intermittent entry locks. It doesn't happen every time, but it can mess up our records when it does.
Does anyone have any suggestions on getting around entry locks? Like maybe putting something in to force the Rename function to wait until the queries have completed, or making the workflow cancel if another instance with the same entry is waiting on a locked resource? This has been a problem with a couple of our workflows now, and while we are typically able to find workarounds, I would much rather find a solution to the overarching problem.