Just upgraded to Beta 2 of Windows Workflow and opened up my beta 1.2 Host Communication Project. Ended up with 11 Errors and a missing Namespace. I went through the code and the documentation and compiled a list of changes for the Host Communications part. Here my list of changes from Beta 1.2 to Beta 2 with respect to Host Communications.

Since i am seeing a lot of problems in inserting a table into this blog, i will have the following format:

System.Runtime.Messaging changed to System.Runtime.Activities

Change Description

Messaging namespace has gone and the local communications functionality has been moved to Activities namespace.

If your code looked like this in Beta 1.2
     using System.Workflow.Runtime.Messaging;
It would look like this in Beta 2.0
     using System.Workflow.Activities;

WorkflowMessageEventArgs changed to ExternalDataEventArgs

Change Description

WorkflowMessageEventArgs has been renamed to ExternalDataEventArgs. This is just a rename and as long as you use the correct name, your code should work.

If your code looked like this in Beta 1.2
     internal class myServiceEventArgs : WorkflowMessageEventArgs
It would look like this in Beta 2.0
     internal class MyServiceEventArgs : ExternalDataEventArgs

DataExchangeService changed to ExternalDataExchange

Change Description

ExternalDataExchange is the workflow communication interface that defines the contract between a local service and a workflow.

If your code looked like this in Beta 1.2
     [DataExchangeService] internal interface IMyService
It would look like this in Beta 2.0
     [ExternalDataExchange] internal interface IMyService

ExternalDataExchangeService has been made visible to the outside world

Change Description

This class has been exposed in Beta2.0. In the current release, you will have to instantiate this class, add it to the runtime and then add your local services to this class. In Beta 1.2, you were able to add the local service directly to the runtime.

If your code looked like this in Beta 1.2
     WorkflowRuntime workflowRuntime = new WorkflowRuntime();
     LocalServiceImpl localService = new LocalServiceImpl();
     workflowRuntime.AddService(localService);
It would look like this in Beta 2.0
     WorkflowRuntime workflowRuntime = new WorkflowRuntime();
     // Create our local service and add it to the workflow runtime's list of services
     ExternalDataExchangeService dataService = new ExternalDataExchangeService();
     workflowRuntime.AddService(dataService);
     LocalServiceImpl votingService = new LocalServiceImpl();
     dataService.AddService(localService);

InvokeMethod Activity changed to CallExternalMethodActivity

Change Description

The InvokeMethod Activity has been renamed to CallExternalMethodActivity. OnMethodInvoked and onMethodInvoking Events have been added. “Verb+ED” events will fire after the action has happned and “Verb+ING” events will fire before the action has happened. So, in this case, the OnMethodInvoked event will fire after method invocation and OnMethodInvoking event will fire before method invocation.

EventSink Activity changed to HandleExternalEventActivity

Change Description

The EvenkSink has got a new name and a new event. So in place of EventSink, you will find HandleExternalEventActivity. OnInvoked Event has been added. This is will be fired after the Activity is invoked.

The Workflow Designer has got some enhancement in the property window and avoids the confusions when adding properties and accessing properties. It gives you much more information. Overall a pleasant change from the 1.2
That’s it on the Host communications, Enjoy Beta2….