I need to get the status of a Workflow programatically. Things i tried:
- item[workflowName] - gave me a "8" altough the workflow is completed (seems to always return 8, I don't know why) (was not helpful)
- SPFieldWorkflowStatus.GetFieldValueAsText(item[workflowName]) - returns an empty string
- SPWorfklow.InternalState - was "locked | running | notStarted" in WorkflowStarting and WorkflowStarted Event. Was "completed" in WorkflowCompleted Event. Why was it in notStarted while in the WorkflowStarted Event?
Are there other ways to get the status of a workflow?
What i need to do for a customer is to create a column in a list where the customer is able to see the status of a workflow which runs on an other list (like a lookup, which i already tried to use but couldn't select the workflow field where the status is). That's why I'm now trying to solve it with a hyperlink field but I'm not able to get the correct status from a workflow.