I’m trying to create a prototype of a State Machine Workflow that is hosted within IIS. The client is a web forms application.
What I’m trying to achieve is a long running “wizard” style process that persists to the database. The State Machine Workflow basically controls the current web forms page depending on the state of the workflow.
I would like to know how I can find the current state name in order to “resume” an instance of the workflow. Imagine someone is halfway through the wizard process and then decides to stop and come back later to complete it.
I have found one solution which is to store the current state name in the database against a field that is correlated to the workflow instance; however, this does not feel like an elegant solution to me. Surely there is a simple way to determine the current state of the workflow instance using Workflow Services?
Thanks guys, your help is greatly appreciated!
There is no standard way of doing so. The basic approach is to use a TrackingParticipant and track the events. See this example for a starting point.