Skip to main content

Posts

Showing posts from August, 2014

Simultaneously start multiple Sharepoint 2007 workflows using C# for a List

 Its known that we can start SharePoint 2007 workflows  programmatically .  Here is the code that loops through all items in a list and starts the workflow for each item: foreach(SPListItem item in list.Items) { SPListItem wrkItem =list.GetItemById(item.ID); wrkflowmgr.StartWorkflow(wrkItem,wflassociation, wflassociation.AssociationData); } However the SharePoint Paradox here is that you can start only one workflow at a time , and have to wait for it to take its sweet time to finish, before you start the workflow for next item in list.  So what do you do if you have ( like i had ) a requirement to start a workflow on multiple items in a list simultaneously ?  Obviously you post a question shouting for help in  stackoverflow . I was told: there is no  simultaneous  method to start workflows for multiple list items at the same time. But  i eventually figured out, that  Multi Threading is the solution. Steps Create a Class “startWorkflow” that starts the workflow for a l