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?