Dot Net Tips and Tricks

Custom Search

Windows Workflow Call External Method and IClonable

Here’s a little gotcha that Microsoft put in Windows Workflow Foundation.

The CallExternalMethod activity is defined as

Defines a workflow communication activity that is used to call a method on a local service. This activity is used to send data from the workflow to the host through the local service.

You select the interface of the service where the method exists and then select the method name. The designer automatically creates properties that correspond to the parameters of the method to call. You can then double-click the little blue “Bind Property” tag in the property window. This allows you to bind the property to any member in the workflow of the same type. This all seems great, until you use it at runtime. What Microsoft fails to state is if the object you bind to impliments IClonable, at execution time, the object will be Cloned then passed to the service’s method. Noware else can I find where an object is Cloned prior to being passed.

I’m still struggling to find the reason for this one, but it’s a gotcha for sure since the documentation states nothing about it.

No comments yet. Be the first.

Leave a reply