ASP.NET: Integrating Windows Workflow Foundation and marshalling controls

by Stephen Horsfield 18. April 2008 15:19

Overview

I've been playing around a bit with the idea of integrating Windows Workflow Foundation into custom web server controls.  I've had some success but also hit something of a wall.  If you have any experience with any of these issues, I'd love to hear from you.

Context

I've started with the following hypothesis:

In my experience, developers often make mistakes developing custom controls therefore it is beneficial for controls to be modelled rather than 'coded' and Windows Workflow Foundation is a perfect tool for the job.

In practice

Using a workflow to take the place of aspects of the code is straightforward.  I started by providing multiple workflows, each run synchronously to handle a distinct control event.  This worked well, but suffered in that each workflow was separated and the code ran synchronously.  I desired a better solution.

Next, I updated the code to use the default scheduling service, redeveloped the server control to use a single workflow and created a communication service to handle event passing to the workflow.  I also added a HandleExternalEvent activity to the workflow to catch the event.

All looked good, until I threw the event.  The event attempted to pass the web server control to the workflow but the control was not marked as Serializable and was also not derived from MarshallByRefObject.  This meant that the event could not be raised and ultimately killed this solution.

I'm a bit surprised that you can't marshall web controls across process boundaries.  This has implications for interactions with any separated service, not just WWF.

Has anyone else had this issue?  Any solutions?  It is not practical to create a custom marshalling object for every web control type.

Still, it was good experience to use WWF and a successful attempt at integrating WWF activities into a control's life-cycle.

Versions

  • .NET Framework 3.5

Metadata

Tags:

ASP.NET | Software Development

Powered by BlogEngine.NET 1.5.0.7
Theme by Interakting

Interakting

A full service digital agency offering online strategy, design and usability, systems integration and online marketing services that deliver real business benefits and ensure your online objectives are met.

Calendar

<<  February 2012  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
2728291234
567891011

View posts in large calendar