I am facing this situation, when
1. I try to approve a task and the workflow takes long time to get it approved.
2. And after a while, the screen comes out of the approval screen and when I check the status of the task it is still in pending. So when I try to approve it again this famous error "this task is currently locked by a running workflow and cannot be edited" pops up. And the workflow stays there forever.
I am really struck!!
Do you have a workflow running on the Workflow Task List?
Nope
I've noticed that sometimes it can take a few minutes from switching from pending to approved, even after you click on the approve button. Give it a few minutes, then hit refresh to see if it changes over.
If you are not able to get your task approved after all trouble shooting, I would say the workflow is already broken you need to look at the log files for the actual reason and it might happened a while ago. So you need to restart your workflow and recreate the tasks. Unfortunately, the workflows that have broken cannot be recovered.
Hi Kesava,
While there can be many causes for this error, one of them can be when you have too many tasks in parallel in a single workflow. This often means that multiple processes are attempting to access a workflow task at the same time. A large workflow has more tasks and more updates in the single workflow, so more chance of causing a lock. Also if a lock does occur, a larger workflow can make it difficult to determine the point at which the lock happened while a smaller workflow will always be easier to diagnose.
Other causes of this error are explained in the following Nintex Connect article:
Task Lock - Task is locked by a running workflow and cannot be edited
Thanks
Arun
I would suggest you to check your ULS, sometimes it will take few minutes to complete, but most of time it hit some exceptions while completing the task. And you will get "This task is currently locked by a running workflow and cannot be edited" message if you try to approve again.
Hi Andrew,
I have the same issue as explained by Kesava. But I have a workflow attached to the Workflow Task list.
After we migrated the Nintex content database from SharePoint 2010 to SharePoint 2013, I performed the claims migration for the content database using MigrateDomaininContentDB Stored Procedure in the Nintex Content database.
Do you have a solution with my case for the Task locked issue?
Is there a way I can unlock the Task ?
This PowerShell script worked really fine on my case:
[system.reflection.assembly]::LoadWithPartialName("Microsoft.SharePoint")
$siteUrl="https://yourSubSiteURL"
$site=new-object Microsoft.SharePoint.SPSite($siteUrl)
$web=$site.OpenWeb()
$web.url
$i=0
write-host $web.lists
foreach($list in $web.lists){
foreach($item in $list.items | where {$_[[Microsoft.SharePoint.SPBuiltInFieldId]::WorkFlowVersion] -ne 1}){
if($item["Status"] -eq "Not Started")
{
Try
{
Write-Host Unlocking workflow on $item.name
$item[[Microsoft.SharePoint.SPBuiltInFieldId]::WorkFlowVersion]=1;
$item.SystemUpdate()
$i++
}
Catch [System.Exception]
{
Write-Host Caught error trying to unlock workflow -ForegroundColor Red
}
}
}
}
Write-Host Unlocked $i workflows within $web.url
$web.dispose()
$site.dispose()
Hi Ignasi Tebé, does that code only unlocks tasks that are in "Not Started" status? I have a situation where the task status is actually "Completed", but the internal status is still "Pending". I'm hoping by unlocking the specific task, the user would be able to resubmit.