- Describing Workflow and Workflow Systems
- .NET Framework 3.0 and 3.5
- Overview of WF
- Standard Modeling Activities
- Multiple Workflow Styles
- Hosting
- Tracking
- Rule Capabilities
- Custom Activities
- XAML Workflows and Serialization
- Dynamic Update
- WF and WCF
- SharePoint Workflow
- Designer Rehosting and External Modeling
- Summary
- Installation Instructions
Designer Rehosting and External Modeling
At times you may need to graphically create workflows outside of Visual Studio and graphically monitor and interact with them at runtime. The most common reason to author workflows outside of Visual Studio is to allow nondevelopers to author workflows. There will almost always be a need for a collection of domain-specific custom activities in addition to the custom authoring experience if business users are to create workflows. There are two ways workflows can be authored outside of Visual Studio. The first, referred to as designer rehosting, permits the design tools used to create workflows in Visual Studio to be rehosted in another application. The second is to use an external modeling tool to produce a workflow model that can be executed by the WF runtime.
Figure 1.26 shows the workflow designer hosted in a Windows Forms application. If the current designer is sufficient and you want the authoring performed outside of Visual Studio, rehosting the designer is likely appropriate. The design experience consists of a combination of the designer and the activities used in the designer. For instance, moving the Code activity to a custom designer does not eliminate the need to write code to support its execution. You should therefore use or create activities appropriate for those targeted to use the rehosted designer. You can even create custom control flow activities if you think the configuration requirements of the OOB ones are not appropriate to your target audience. The WorkflowMonitor application (looked at in the "Tracking" section) demonstrates rehosting the designer for monitoring and interacting with running and previously executed workflows.
Figure 1.26 Workflow designer rehosted in a Windows Forms application.
If there is a need for an entirely difference experience, then using a different tool altogether is probably more appropriate than rehosting the designer. Maybe Visio has the required authoring tools because that is what the business people know. Maybe a rules-driven designer, such as the SharePoint Designer, is called for.
When rehosting the designer, you can also include its serialization tools to create the XAML or code, depending on which format you choose. When using external tools, it is up to you to serialize the information, which will almost always be to XAML.
Designer rehosting and using an external modeling tool are not covered in this book. They are included in this hour because they are important to WF's overall vision, but they are advanced topics, especially external modeling. By the end of this book, you will have experience in custom activity authoring (to create your domain activities) and WF in general, readying you for one of these two alternative authoring options. I will post a sample of external modeling that I have worked on some on my blog at www.reassociates.net and will try to do the same for designer rehosting. You can also see http://msdn.microsoft.com/en-us/library/aa480213.aspx for an example of designer rehosting.