Sharepoint workflows : when are your tasks created ?

Several Sharepointers notice that using the CreateTask activity alone in a Sharepoint workflow doesn’t really create a Sharepoint Task: To have the task created (in the task list) you need to have an activity that will move the workflow in waiting state ; any activity implementing the IEventActivity interface will do the job; that is the case of all sharepoint activities having name starting with “On” (OnTaskCreated, OnTaskChanged,OnTaskDeleted,…), and also the Delay activity.

The Sharepoint activities modifying the Sharepoint content database are enrolled in a transaction which is committed when the workflow persists.

 

image

 

 

The following setting in the web.config file specifies the Transaction timeout duration:

 

<configuration>

  <system.transactions>

    <defaultSettings timeout="00:05:00"/>

  </system.transactions>

</configuration>

By default the value is set to 1 minute.  You can increase the value to 5 minutes if you face the following error, which can happen if yoy create several hundreds of tasks :

 

Workflow Infrastructure             72fg     High    Error in persisting workflow: System.Transactions.TransactionAbortedException: The transaction has aborted. —> System.TimeoutException: Transaction Timeout     — End of inner exception stack trace —     at System.Transactions.TransactionStateAborted.CreateAbortingClone(InternalTransaction tx).

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s