WCF Error Handling Behavior: Update

May 31, 2008

A few weeks ago I posted a preliminary version of a WCF error handling behavior which facilitated automatic translation of server-side exceptions to faults. Since then, I have reconsidered parts of my approach.  It occurred to me that the most proper way of mapping exceptions to faults is using attributes - the same way that is used to declare fault contracts in the first place. Therefore, I reworked the solution to use an attribute on the operation level - a attribute.  The attribute can be used to map an exception type to a fault detail type on a...
tags:
one comment

Programmatically Generating a Dump File

May 28, 2008

I've discussed dump analysis on several occasions, including detailed walkthroughs of native and managed issues - crashes, hangs, deadlocks and the rest of the bug zoo. (Alon has just recently been to this bug zoo and promised me pictures.) Oftentimes it's useful to generate a dump programmatically.  For example, if your application fails and you want to record the data and send it over the network or persist it to some durable storage, you can do so without relying on Windows Error Reporting or other mechanisms. ...
no comments

Workflow Services Limitations: Part 5 – A Couple of Updates

May 14, 2008

In the previous posts in this series, we have observed a couple of weird behaviors around Workflow Services, specifically: OneWay Not Always Asynchronous Send and Receive Race Condition Both of these behaviors have been confirmed. The suggested workaround for the one-way issue is to release the WCF thread on the service side (by using ThreadPool.QueueUserWorkItem or any similar API). The race condition scenario is more complicated that I thought.  The reason for the problem is that when the WCF message reaches the workflow, the WorkflowOperationInvoker ultimately uses WorkflowInstance.EnqueueItemOnIdle...
tags: ,
no comments

Workflow Services Limitations: Part 4 – Breakpoints Not Fired

I love showing people the power of declarative, designer-driven programming when I first introduce them to Workflow Foundation.  The workflow designer is a feast for the eyes: One of the first questions people always ask me is whether the workflow can be debugged just as easily as a bunch of cooperating components.  The answer, as usual, is: It Depends. Theoretically, you can always place a breakpoint on an activity and when the workflow executes then execution will stop at the breakpoint: However, this doesn't always work.  Specifically, it works in...
tags: ,
no comments

TechEd Israel 2008 Session Recordings Are Online

May 9, 2008

After a long period of anticipation, all session recordings from this year's TechEd Israel are now online!  You can choose between a streamed online WMV and a zipped download for viewing offline. My Next Generation Production Debugging session is there, and I remind you that if you've missed anything in the slides or the live recording, then you should take a look at the post series, featuring a complete walkthrough of what I've shown during the session: Demo 1 - What can be done without a debugger Demos 2-3 - Production debugging basics and memory leaks...
tags:
2 comments

Latest Articles: Introduction to Workflow Services and Reading Unmanaged Data Into Structures

May 8, 2008

Just a quick post to let you know that I've published two articles outside the blog, so if you're interested: I've written an article (in Hebrew) that serves as an introduction to Workflow Services (article direct link).  It has been published in the May 2008 edition of the MSDN Pulse, a Microsoft Israel online digest for developers.  In the article I describe what a workflow, a service and a workflow service is, mention a few design patterns and limitations, offer an overview of future directions, and wrap it up with a few pointers for you to start exploring Workflow...
no comments

Using the Workflow Rule Condition Editor for Your Own Rule Conditions

May 7, 2008

Windows Workflow Foundation has rich support for rule-driven work.  The built-in PolicyActivity, for example, features the ability to take a set of rules and execute them.  Other activities can make use of the RuleSet, Rule, RuleAction and RuleExpressionCondition types to leverage policy-making facilities inside or outside a workflow.  In a nutshell: A rule condition is a condition that can be evaluated to a boolean value.  It features validation and cloning facilities, as well as a dependency management mechanism. A rule action represents an action to be executed. A rule is a collection of conditions that is...
tags:
4 comments

Workflow Services Limitations: Part 3 – Send and Receive Race Condition

May 4, 2008

In the previous part of this open-ended series, we have looked at a strange case where asynchronous calls do not always behave asynchronously. This time, we will look into an inherent race condition that can occur in a workflow service which communicates with the outside world in a duplex fashion. If your workflow wants to communicate with an external WCF service in a duplex fashion, you'll very quickly find that you need a SendActivity to send a message to the outside world, and a ReceiveActivity to receive the reply.  Arranging these activities in your workflow, you might...
tags: ,
no comments

Workflow Services Limitations: Part 2 – OneWay Not Always Asynchronous

In the previous part of this open-ended series, we have discussed the issue of smuggling external transactions into a workflow. Today, we will look into a strange scenario where allegedly asynchronous calls are not actually executed asynchronously. The workflow services samples distributed in the MSDN and as part of the Visual Studio 2008 training kit almost always use synchronous communication.  However, it is often the case that you want fire-and-forget behavior within a workflow service calling an external operation.  In that case, you will merrily put IsOneWay=true in your attribute, and move on. However, the...
tags: ,
no comments

Workflow Services Limitations: Part 1 – External Transactions

In this open-ended series of posts, I would like to outline some limitations of the current Workflow Services implementation (.NET 3.5).  The information presented here is the result of several months' work designing, prototyping and implementing an application framework on top of Workflow Services. Please note: Some of these issues have been non-officially confirmed by Microsoft, some others are pending - so you should treat all of this with a grain of salt.  None of this substitutes the existing Microsoft documentation. If you're looking for a general overview of what Workflow Services are about, the following resources...
tags: ,
2 comments