Don’t Use Workflow Bookmarks in Transaction Scopes

Wednesday, September 7, 2011

It’s been a while since I posted about a workflow-related bug, and it’s not because of my mad WF skillz – it had more to do with Manu’s expertise in the big WF project I’m involved in. The following bug slipped through the cracks and is worth sharing. One of our custom activities sends a query to the user and waits for a response. This can take days – a human operator is not always available to answer the question, and some questions may require escalation. In one of our recent workflows, two queries had to be sent...
no comments

Are Workflows Really That Bad? (Hint: Maybe They Aren’t)

Wednesday, August 17, 2011

I was thinking long and hard about whether Windows Workflow Foundation, or any other workflow tool for that matter, can really be used in a large production application for orchestrating large business processes. (Clarification: I’ve been writing a framework for developing such workflows using WF 3.5 and WF 4.0 for the past three years, so I’ll try to speak from experience.) Is it possible to use workflows to orchestrate large business processes without landing in a mass of spaghetti a couple of years later? I believe that the same techniques that need to be applied...
one comment

Viewing Persisted Workflow State

Friday, June 4, 2010

A few weeks ago at work I was toying around with implementing a viewer for persisted workflow instances (with WF 3.5). While there is a Microsoft sample (Workflow Monitor) that displays tracking information recorded for a workflow instance accompanied by a visual designer, there is no API or tool to view the state of a persisted workflow—the property values and object references that are serialized to the workflow persistence store. It’s always possible to write a custom persistence service that will serialize workflows in any way you deem fit, but I decided to do something simpler. I wrote...
tags:
one comment

Transactional Workflows: Suspend-Enqueue-Unload-Resume Done Correctly on Second-Phase Commit

Friday, May 21, 2010

More than two years ago I visited the subject of transactionally delivering a message to a workflow, making sure that the transaction did not commit until the message has been delivered and the workflow persisted under the same transaction. This subject has also been covered fairly well in this MSDN Forums thread. As a quick reminder, if you want to transactionally deliver a message to a workflow, you need to follow these steps: Suspend the workflow instance Enqueue the message to the workflow’s queue Unload the...
no comments

SDP 2009: Building Workflow Services with WF 4.0 and WCF 4.0

Saturday, January 2, 2010

Eran and I delivered a session titled “Building Workflow Services with WF 4.0 and WCF 4.0” at the Sela Developer Practice on Tuesday. This session was all about integrating the new features of WF 4.0 and WCF 4.0 to create a workflow application that orchestrates the execution of multiple WCF services. During the session, we showed how to use WCF 4.0’s ad-hoc discovery, how to write declarative workflows and use custom activities, how to take advantage of the built-in messaging activities in WF 4.0 and how to integrate a workflow application into Windows Server AppFabric....
tags: , , ,
one comment

Workflow Savepoints

Sunday, April 5, 2009

Transaction scopes are a natural part of Windows Workflow Foundation; they provide transactional semantics to a set of activities bound together by their enclosing scope.  The transaction scope provides ACID semantics to a group of workflow operations, ensuring that they abort as a group or succeed as a group, but not otherwise. Out-of-the-box, however, the usability of workflow transaction scopes (at least for my recent application) was fairly low.  When a transaction rolls back within a transaction scope, its owning workflow is brutally terminated by default, removing its state information from the workflow persistence service.  Effectively, when a...
tags:
no comments

Forwarding Context-ful Messages

Sunday, June 22, 2008

Workflow Services (introduced in .NET 3.5) are based on a simple convention for passing the workflow instance identifier from the client to the workflow and from the workflow to any services it invokes.  This convention revolves around the use of context-ful bindings (BasicHttpContextBinding, WSHttpContextBinding, NetTcpContextBinding and others) and a simple dictionary which contains a key called "instanceId" and a value that contains the workflow instance identifier. This information is passed out-of-band to facilitate cleaner interfaces - it's passed in a SOAP header called ContextMessageHeader (which is an internal WCF class), and can be accessed from the channel's context manager...
tags: ,
5 comments

Workflow Services Limitations: Part 5 – A Couple of Updates

Wednesday, 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

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

Thursday, 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