This may assist:

SPWorkflowManager.CountWorkflows Method (SPWorkflowTemplate, SPSite) 
(Microsoft.SharePoint.Workflow)

 

http://msdn.microsoft.com/en-us/library/ms438664.aspx

 

However this counts the number of instances for a specified SPWorkflowTemplate, 
so maybe you could pull a collection of those for your site collection and add 
the total.

 

 

Kind regards,

 

Chris Milne

 

 

 

From: [email protected] [mailto:[email protected]] On Behalf Of Bill Williamson
Sent: Wednesday, 3 June 2009 7:47 PM
To: [email protected]
Subject: Re: Diagnostics on running workflows

 

I appreciate the advice, but this won't help with our current audit of running 
workflows... It also woudln't find workflows that had hit an errored state 
before setting that column, and you could only have 1 workflow per list item. :(

On Wed, Jun 3, 2009 at 6:45 PM, Jeremy Thake <[email protected]> wrote:

You could create a base content type and derive all your List Items from it by 
associating your List with it. This base content type could have a Site Column 
which you could set as part of your workflow. Then you can use CAML to filter 
by the Site Column across the Content Type (e.g. across all lists in the Site 
Collection) to report out on the Workflows.

I must admit I don’t do much with SPD workflows, you may be able to get it from 
CAML direct, but I haven’t got a VM up to check. U2U CamlBuilder pointing at a 
list with the workflow on it would tell you straight away in the UI.

From: [email protected] [mailto:[email protected]] On Behalf Of Bill Williamson
Sent: Wednesday, 3 June 2009 4:24 PM


To: [email protected]
Subject: Re: Diagnostics on running workflows

Mostly SPD workflows attached to individual lists.

On Wed, Jun 3, 2009 at 6:15 PM, Jeremy Thake <[email protected]> wrote:

Just to get some more context on this. Are these your own custom workflows in 
Visual Studio or SPD OR are they just out of the box workflows such as Approval 
workflow?

From: [email protected] [mailto:[email protected]] On Behalf Of Bill Williamson
Sent: Wednesday, 3 June 2009 3:27 PM
To: [email protected]
Subject: Re: Diagnostics on running workflows

But there's no list property that says "I have a workflow active"... Or is 
there?

CAML querying would be super easy, I just don't think a filter exists.

On Wed, Jun 3, 2009 at 4:48 PM, Jeremy Thake <[email protected]> wrote:

You could use CAML and filter by a particular property...not seen any sample 
code of this though.

From: [email protected] [mailto:[email protected]] On Behalf Of Bill Williamson
Sent: Wednesday, 3 June 2009 12:08 PM


To: [email protected]
Subject: Diagnostics on running workflows

We have a few runaway workflows, and would generally like to know what 
workflows are currently running in our system.

>From what I have read, the only way to do this is (using the api, pseudocode):
foreach(site in sites)
{
foreach(list in site.lists)
{
foreach(item in list.items)
{
CheckActiveWorkflowsForItem(item);
}
}
}


Is there REALLY no way to do this apart from iterating on every single freaking 
item in the entire site collection?

________________________________

Support procedure: https://www.codify.com/lists/support
List address: [email protected]

Subscribe: [email protected]

Unsubscribe: [email protected]

List FAQ: http://www.codify.com/lists/ozmoss 
<http://www.codify.com/lists/ozmoss> 

Other lists you might want to join: http://www.codify.com/lists 
<http://www.codify.com/lists> 

________________________________

Support procedure: https://www.codify.com/lists/support
List address: [email protected]

Subscribe: [email protected]

Unsubscribe: [email protected]

List FAQ: http://www.codify.com/lists/ozmoss 
<http://www.codify.com/lists/ozmoss> 

Other lists you might want to join: http://www.codify.com/lists 
<http://www.codify.com/lists> 

________________________________

Support procedure: https://www.codify.com/lists/support
List address: [email protected]

Subscribe: [email protected]

Unsubscribe: [email protected]

List FAQ: http://www.codify.com/lists/ozmoss 
<http://www.codify.com/lists/ozmoss> 

Other lists you might want to join: http://www.codify.com/lists 
<http://www.codify.com/lists> 

________________________________

Support procedure: https://www.codify.com/lists/support
List address: [email protected]

Subscribe: [email protected]

Unsubscribe: [email protected]

List FAQ: http://www.codify.com/lists/ozmoss 
<http://www.codify.com/lists/ozmoss> 

Other lists you might want to join: http://www.codify.com/lists 
<http://www.codify.com/lists> 

________________________________

Support procedure: https://www.codify.com/lists/support
List address: [email protected]

Subscribe: [email protected]

Unsubscribe: [email protected]

List FAQ: http://www.codify.com/lists/ozmoss 
<http://www.codify.com/lists/ozmoss> 

Other lists you might want to join: http://www.codify.com/lists 
<http://www.codify.com/lists> 

________________________________

Support procedure: https://www.codify.com/lists/support
List address: [email protected]

Subscribe: [email protected]

Unsubscribe: [email protected]

List FAQ: http://www.codify.com/lists/ozmoss 
<http://www.codify.com/lists/ozmoss> 

Other lists you might want to join: http://www.codify.com/lists 
<http://www.codify.com/lists> 

 

________________________________

Support procedure: https://www.codify.com/lists/support
List address: [email protected]

Subscribe: [email protected]

Unsubscribe: [email protected]

List FAQ: http://www.codify.com/lists/ozmoss 
<http://www.codify.com/lists/ozmoss> 

Other lists you might want to join: http://www.codify.com/lists 
<http://www.codify.com/lists> 

--------------------------------------------------------------------------------
Support procedure: http://www.codify.com/lists/support
List address: [email protected]
Subscribe: [email protected]
Unsubscribe: [email protected]
List FAQ: http://www.codify.com/lists/ozmoss
Other lists you might want to join: http://www.codify.com/lists

Reply via email to