Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. WorkflowMarkupSerializer doesn’t keep positions in a state machine workflow

WorkflowMarkupSerializer doesn’t keep positions in a state machine workflow

Scheduled Pinned Locked Moved C#
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    Win8128
    wrote on last edited by
    #1

    I am using WorkflowMarkupSerializer to save a statemachine workflow - it saves the states OK, but does not keep their positions. The code to write the workflow is here:

    using (XmlWriter xmlWriter = XmlWriter.Create(fileName))
    {
    WorkflowMarkupSerializer markupSerializer
    = new WorkflowMarkupSerializer();
    markupSerializer.Serialize(xmlWriter, workflow);
    }

    The code to read the workflow is:

            DesignerSerializationManager dsm
            = new DesignerSerializationManager();
        using (dsm.CreateSession())
        {
            using (XmlReader xmlReader
                = XmlReader.Create(fileName))
            {
                //deserialize the workflow from the XmlReader
                WorkflowMarkupSerializer markupSerializer
                    = new WorkflowMarkupSerializer();
                workflow = markupSerializer.Deserialize(
                    dsm, xmlReader) as Activity;
    
                if (dsm.Errors.Count > 0)
                {
                    WorkflowMarkupSerializationException error
                        = dsm.Errors\[0\]
                          as WorkflowMarkupSerializationException;
                    throw error;
                }
            }
         }
    

    Does anyone know how to save the positions of the states?

    W 1 Reply Last reply
    0
    • W Win8128

      I am using WorkflowMarkupSerializer to save a statemachine workflow - it saves the states OK, but does not keep their positions. The code to write the workflow is here:

      using (XmlWriter xmlWriter = XmlWriter.Create(fileName))
      {
      WorkflowMarkupSerializer markupSerializer
      = new WorkflowMarkupSerializer();
      markupSerializer.Serialize(xmlWriter, workflow);
      }

      The code to read the workflow is:

              DesignerSerializationManager dsm
              = new DesignerSerializationManager();
          using (dsm.CreateSession())
          {
              using (XmlReader xmlReader
                  = XmlReader.Create(fileName))
              {
                  //deserialize the workflow from the XmlReader
                  WorkflowMarkupSerializer markupSerializer
                      = new WorkflowMarkupSerializer();
                  workflow = markupSerializer.Deserialize(
                      dsm, xmlReader) as Activity;
      
                  if (dsm.Errors.Count > 0)
                  {
                      WorkflowMarkupSerializationException error
                          = dsm.Errors\[0\]
                            as WorkflowMarkupSerializationException;
                      throw error;
                  }
              }
           }
      

      Does anyone know how to save the positions of the states?

      W Offline
      W Offline
      Win8128
      wrote on last edited by
      #2

      OK I have found an answer at the following link[^] Search for: .layout

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups