Geeks With Blogs
Adrian Hara Working through the .NET maze August 2008 Entries
How to check if a sharepoint 2007 workflow is running
Searching for a way to check if a workflow is running on a list item (useful, for example, in an item event handler), I found some code like this: public static bool IsWorkflowRunning(SPListItem listItem, Guid workflowId) { foreach (SPWorkflow workflow in listItem.Workflows) { if (workflow.ParentAssociation... == workflowId && workflow.InternalState == SPWorkflowState.Running) { return true; } } return false; } What this code does is iterate the workflows list for the item (point ......

Posted On Wednesday, August 13, 2008 5:00 PM

Refresh SPWorkflowActivationProperties Item
If you're developing workflows for SharePoint 2007, you are probably familiar with the Item property of the SPWorkflowActivationProperties class. Usually your workflow gets an instance of SPWorkflowActivationProperties when the OnWorkflowActivated activity executes, which is bound to a public field on the workflow class so you can hang on to it for the lifetime of the workflow. Perhaps one of the more useful properties of this class is Item, which returns an instance of SPListItem, representing the ......

Posted On Friday, August 8, 2008 11:28 AM

Copyright © Adrian Hara | Powered by: