Trying to figure out where workflow information like status and participants are stored in a Sharepoint database. There is a table called workflow but i cant seem to find the connection between the document and the data in the worflow data. Anyone?
SharePoint workflows are based on Windows Workflow Foundation 3.5, so whatever information you will find about that will most probably be applicable to SharePoint workflows. One of these things is hydrating and dehydrating workflows which essentially saves the current state of the workflow in serialized form into the database (or anywhere else).
SharePoint workflows rely on four mechanisms:
The workflow template is what you would create in SharePoint Designer / Visual Studio. With SharePoint designer this will generate a declarative *.XOML file, with Visual Studio a *.DLL - all your logic of the workflow, who it will be assigned to, who your participants are is stored in there.
This workflow template you associate with e.g. a list, a content type or a site in SharePoint as well as with a (hidden) workflow history list and a workflow task list - even if you don't use it. With this association you can also have an association form which is executed once you associate your workflow.
A workflow instance is the actual instance running on e.g. a list item (in instantiation a form could be presented as well). This instance does actually stuff you told it to do in the template.
Now, on to your question: "Where is workflow information like status and participants stored in the database?"
Short answer: It isn't.
Longer answer: The table WorkflowAssociation stores associations. So I could see that the workflow with he BaseID XYZ is associated with the SiteId xyz with the ListId and so on (this is the connection between the document and the data). The Workflow table in the database stores information about running and past workflows. So you know which ItemGUID the workflow instance is running on,l when it was created and what InternalState it is in. This internal state doesn't help you though as it doesn't map the states you desigend in SP Designer it is simply the state like "running/not running/error" internal to SharePoint. However there is the column InstanceData. I'm not sure, but it could be possible that once the workflow is dehydrated the current state could be saved in there. In what encoding/form - no idea. You will not be able to find out the information yous eek (current participants) on a running workflow in the database.
Most importantly: You shouldn't have to look into the database anyways.
The information like status and participants you can only find out via code, even better you could debug your workflow to see all the information there is. You could also create fields for this information and simply display the "participants".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With