Obtaining workflow status in code

Obtaining workflow status in code

I recently wrote a console application which looped through the workflows running on my SharePoint site and showed the status of each one. When I refer to status I mean the same status that is displayed under the workflow column e.g. In Progress, Error occurred etc

To get the workflow status in code you need to use the enumeration ‘SPWorkflowStatus’, which will return one of the following numeric values:

[code lang="csharp"]

public enum SPWorkflowStatus
NotStarted = 0,
FailedOnStart = 1,
InProgress = 2,
ErrorOccurred = 3,
StoppedByUser = 4,
Completed = 5,
Max = 15,

Hope this helps!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">