Task not finishing

Sep 2, 2010 at 3:05 PM
Edited Sep 3, 2010 at 9:32 AM

Hi.

I'm having problem with some tasks that's not finishing.

I have a CreateTask -> OnTaskChanged -> CompleteTask

After the OnTaskChanged method has been invoked, the user is redirected to TaskFormHost.aspx and then back to the workflow tasklist. The task will however not be set to "finished" (BUT the CompleteTask method is however invoked). This happends when the loading of "TaskFormHost.aspx" takes extra long time to load.

I can't see anything in the log that could help me. Im not getting any exceptions when debugging either.

Any suggestions? I'm stuck :(

EDIT: When trying to edit the task again, (since it didnt finish) i get an error message stating that the items is locked by the workflow

Sep 3, 2010 at 2:22 PM

Hi,

check your workflow design (Design Mode). I guess some properties (TaskId,...) or Correlation Token is missing or wrong.

Sep 7, 2010 at 11:10 AM
Edited Sep 7, 2010 at 11:11 AM
awaiK wrote:

Hi,

check your workflow design (Design Mode). I guess some properties (TaskId,...) or Correlation Token is missing or wrong.

 

Hi, thanks for answering awaiK. The CreateTask -> OnTaskChanged -> CompleteTask has the same taskId and CorrelationToken set. The thing is that this workflow worked as intended before. One year after, this stated to happend.

A couple of Sharepoint Cumulative Updates has been deployed over the time and alot more instances of the workflow is running now, I cant think of anything else that has changed. The code is exactly the same as it was 1 year ago.

The current version of SP is: 12.0.0.6535

Regards Jonas

Sep 20, 2010 at 7:02 AM

Any thoughts?

Here's some more error information:

Det går inte att redigera den här uppgiften eftersom den är låst av ett pågående arbetsflöde.   at Microsoft.SharePoint.SPListItem.PrepareItemForUpdate(Guid newGuidOnAdd, SPWeb web, Boolean bMigration, Boolean& bAdd, Boolean& bPublish, Object& objAttachmentNames, Object& objAttachmentContents, Int32& parentFolderId)
   at Microsoft.SharePoint.SPListItem.UpdateInternal(Boolean bSystem, Boolean bPreserveItemVersion, Guid newGuidOnAdd, Boolean bMigration, Boolean bPublish, Boolean bNoVersion, Boolean bCheckOut, Boolean bCheckin, Boolean suppressAfterEvents)
   at Microsoft.SharePoint.SPListItem.Update()
   at Microsoft.SharePoint.Workflow.SPWorkflowTask.AlterTask(SPListItem task, Hashtable htData, Boolean fSynchronous)
   at TPG.SharePoint.Workflow.TaskPage.CommitTask(TaskData data)
   at TPG.SharePoint.Workflow.TaskFormHost.OnBubbleEvent(Object source, EventArgs args)
   at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
   at System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e)
   at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Sep 23, 2010 at 8:48 AM

Could you may translate the error message into english? :)

Maybe the List Definition, which the workflow is running at, changed (column type change, column removed, etc.)?

Sep 23, 2010 at 9:25 AM
awaiK wrote:

Could you may translate the error message into english? :)

Maybe the List Definition, which the workflow is running at, changed (column type change, column removed, etc.)?

Det går inte att redigera den här uppgiften eftersom den är låst av ett pågående arbetsflöde.  

= 

This task is currently locked by a running workflow and cannot be edited

 

The workflow is actually changing the item from which the workflow is running. We're not changing the contenttype och adding/removing columnes though. We're only changing some values (like who's responsible for the item etc).

Another odd thing is that when this happends, you can always try again and it works. But this doesnt apply to the production enviorment where you can try 1000 times and it's always "locked".

Thanks for helping awaiK!

Regards
Jonas

 

Sep 24, 2010 at 7:55 AM

I guess you haven't a Visual Studio installed on the production system to debug the workflow?

A few ideas/suggestions:

1. Increase the logging level on production system
I thinks this issue is in the OnTaskChanged or CompleteTask method

2. Include special Debug/Tace Code, which can be viewed with DebugView, into your workflow to determine the exact location -> Debugging tips for SharePoint

3. Restart the whole prduction system.
In some situations (which I don't understand exactly) old assemblys are cached. The 'Windows SharePoint Services Timer' cached assemblys which are invoked by this service, for example.

Oct 7, 2010 at 9:29 AM

I think i solved it. If an exception is thrown before the AlterTask is invoked this error can occour according to several blogs. I found out that there was an exception beein thrown in TaskData.Cs -> GetProperty when a key doesnt exist.

It seems to be a bug in TaskData.cs ?

I changed the GetProperty(object key) to the following in my code and now it seems to be working.

 

 

object GetProperty(object key)

return value == null ? value : value.Value;

{

//Same code

 

}

 

Oct 8, 2010 at 3:01 PM

Great news.

May you want to contribute your changes and upload a patch?: Upload Patch