WPF Fan

Hi,

I have very exact problem that is explained here:

https://forums.microsoft.com/MSDN/ShowPost.aspx PostID=796006&SiteID=1

The API works, but I get just one element for a fairly complex workflow.

How can get a full xoml form of an existing workflow

Any help would be appreciated,
Alan




Re: Windows Workflow Foundation No Answer: Converting existing workflow from code based definition to xoml

aschaeffer

I did exactly what you are asking by using the following code:

private static void Serialize(string path, Activity rootActivity)
{
XmlTextWriter xmlWriter = new XmlTextWriter(path, Encoding.Default);
try
{
WorkflowMarkupSerializer xomlSerializer = new WorkflowMarkupSerializer();
xomlSerializer.Serialize(xmlWriter, rootActivity);
}
finally
{
xmlWriter.Close();
}
}





Re: Windows Workflow Foundation No Answer: Converting existing workflow from code based definition to xoml

WPF Fan

Actually, here is how it doesn't work:

You have two options for creating sequential workflow in VS2005:

  • Sequential Workflow (with code separation)
  • Sequential Workflow (Code)

Your code works fine if the workflow is created by using the 1st option. If you use other template - "Sequential Workflow (Code)" -, then all you get is an xoml file with just one tag defined in it!

I am trying to get the xoml out of a "Sequential Workflow (Code)" kind of workflow.

Any idea

Thank you for reply,
Alan





Re: Windows Workflow Foundation No Answer: Converting existing workflow from code based definition to xoml

WPF Fan

Here is the xoml that I get for a large and complex workflow:

<ns0:SeqBLWFxoml x:Name="SeqBLWFxoml"
UserName="{x:Null}" ModelDataSet1="{x:Null}"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/workflow" xmlns:ns1="clr-namespace:ActivityLib;Assembly=ActivityLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ns0="clr-namespace:WorkflowLib;Assembly=WorkflowLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />





Re: Windows Workflow Foundation No Answer: Converting existing workflow from code based definition to xoml

Saurabh Chechi - MSFT

This post might be of help to you

http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=221919&SiteID=1






Re: Windows Workflow Foundation No Answer: Converting existing workflow from code based definition to xoml

Saurabh Chechi - MSFT

Add the following code to the bottom of the InitializeComponent method in the designer.cs file:

using (XmlTextWriter xmlWriter = new XmlTextWriter(path, Encoding.Unicode))

{

WorkflowMarkupSerializer xomlSerializer = new WorkflowMarkupSerializer();

xomlSerializer.Serialize(xmlWriter, this);

}