Rehosted Workflow designer and State machine designer layout

If you wondered why all your states were stacked on each other when rehosting the workflow designer, here is what you need to do.

The workflow designer saves the layout information in a .layout file corresponding to the workflow file. ( StateMachineWorkflow1.xoml or StateMachineWorkflow1.cs will have a StateMachineWorkflow1.layout generated by the VS workflow designer).

When rehosting the state machine workflow, in your rehosting app, use a derived WorfklowDesignerLoader instead of the base and inside PerformLoad() call LoadDesignerLayout() and point the xml reader to your layout file.

LoadDesignerLayout(XmlReader layoutReader, out IList layoutLoadErrors)

alternatively if you are loading the workflow from a compiled assembly you could use this method

LoadDesignerLayoutFromResource(Type type, string manifestResourceName, out IList errors)

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s