How do I get last persisted workflow instance Id to reload it?

519 Views Asked by At

Lets say I have persisted self-hosted workflows (running locally IIS express) that use WorkflowApplication programmatically by using the SqlWorkflowInstanceStore object model.

app.PersistableIdle = delegate(WorkflowApplicationIdleEventArgs e)
{
    return PersistableIdleAction.Unload;
};

Then, I accidentally / deliberately stopped my web application, restarted my visual studio (local development).

My questions:

  1. Restarted my application, How would I retrieve last persisted application instance from database and load it for later bookmark resumption?
  2. How would i get ID of last persisted workflow instance Id and reload it using Reload method?
1

There are 1 best solutions below

1
Richard210363 On

In every instance of workflow I've seen, the Workflow Instance IDs are stored in a separate database so that the system can decide, based on criteria stored with the ID, which workflow to restart from the persistence database.