Loading Instances

WorkflowInstance exhibits the two unload methods—Unload and TryUnload—but it has only a single Load method. It doesn’t matter how the workflow instance was stored in the database. Once it is stored, you use WorkflowInstance.Load to bring it back into executing status again. We’ll now add the appropriate code to our WorkflowPersister application to make this happen.

Load a persisted workflow

  1. With the WorkflowPersister application open for editing in Visual Studio, open the source code file for the main application form for editing and locate the button3_Click event handler.

  2. Add this code to the button3_Click event handler:

    button3.Enabled = false; try { _instance.Load(); } // try catch (Exception ex) { MessageBox.Show(String.Format("Exception ...

Get Microsoft® Windows® Workflow Foundation Step by Step now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.