Tuesday, February 16, 2010

Workflows in SharePoint 2010

I thought of sharing what I found with workflows in SharePoint 2010 today as all the others using the object model to associate the workflows to lists or list items will face the same night mare.

The main problem may be a bug in beta and hopfully MS will fix this in the final release. The problem is, we can get the workflow template collection using the workflow manager in 2007 using WorkflowManager.GetWorkflowTemplatesByCategory(). but this does not return the workflow template collection in 2010.

The work around I found is, in 2010, SPWeb.WorkflowTemplates is working and which is returning the workflow template collection for the given web. So we can use this property and get the workflow template collection for the root web of the site or any web as it does in WorkflowManager.GetWorkflowTemplatedByCategory().

I hope this will be fixed in the final release so that we can use the workflow manager to get the workflow template collection but certainly I do not see any difference in using SPWeb property also. I hope MS will have some kind of a better explaination for this behaviour.

1 comment:

Anonymous said...

THANK YOU!