How can I access the workflow ID in BeginOnSave / PersistenceIOParticipant? RRS feed

  • Question

  • I'm using PersistenceIOParticipant to write the workflow status to a custom db table. I need the workflow ID - any ideas how I can access it from within BeginOnSave?
    Friday, June 15, 2012 2:10 PM


  • Hi,

    WorkflowApplication instance = new WorkflowApplication(activity);

    instance.Extensions.Add(new PersistenceIOParticipant(instance.Id));
      instance.Completed = delegate(WorkflowApplicationCompletedEventArgs e)
                    Console.WriteLine("workflow instance completed, Id = " + instance.Id);

    I think you can create a class wrap the PersistenceIOParticipant , then overwrite the constructor to accept workflow ID as parameter.
    • Marked as answer by LeoTang Friday, June 22, 2012 8:21 AM
    Sunday, June 17, 2012 11:17 AM