Getting Root Sequence of saved workflow RRS feed

  • Question

  • Hi,

    I am trying to rehost the workflow designer and add saving and loading features.  I have a function that requires the ability to get all the activities on the designer canvas.  When the user creates a new workflow, I create a pointer to the rootSequence, and can access all the activities from its children.  However, when a user saves the workflow and loads it again, my pointer to the rootSequence is lost, and hence I can no longer access the activities on the designer canvas.  Is there a way to override the workflow designer save function to save my rootSequence pointer, or is there another way to access the root?



    Friday, July 16, 2010 12:30 AM


  • Don't know if this was the best way, but these two lines seem to do the trick


                    ModelItem root = _workflowDesigner.Context.Services.GetService<ModelService>().Root;
                    rootSequence = (Sequence) (root.GetCurrentValue());

    • Proposed as answer by Andrew_Zhu Tuesday, July 20, 2010 6:26 AM
    • Marked as answer by Andrew_Zhu Friday, July 23, 2010 7:55 AM
    Friday, July 16, 2010 1:00 AM