Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a SPWorkflow object and I want to check if this workflow is running. It's a Sandbox solution so I don't have access to SPWorkflow.SPWorkflowStatus.

I have tried the following:

if (workflow.InternalState != SPWorkflowState.Running)
{
     // the workflow is not running
}

but what I get in workflow.InternalState is a list of SPWorkflowState enum values: "Running" and "NotStarted". This doesn't make any sense to me.

It should be a pretty simple thing but just can't get it to work.

Does anyone have the solution to this?

share|improve this question
add comment

1 Answer

There should be a column on your list with the same name as the workflow association.
This column should contain a number which represents a status of your workflow. So if this column is set to 2 then your workflow is running.

share|improve this answer
    
As it's a sandbox solution I don't have access to SPWorkflowStatus link –  Høgsdal Nov 2 '12 at 4:22
    
The column I'm talking about is on the item, you should have access to it. –  eirikb Nov 2 '12 at 6:13
    
If the item is the workflow I can't see that value on the item. –  Høgsdal Nov 8 '12 at 3:12
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.