DCSIMG
WF - All Your Base Are Belong To Us

All Your Base Are Belong To Us

Mostly .NET internals and other kinds of gory details

Browse by Tags

All Tags » WF (RSS)
Don’t Use Workflow Bookmarks in Transaction Scopes
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...
Are Workflows Really That Bad? (Hint: Maybe They Aren’t)
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...
Viewing Persisted Workflow State
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...
Transactional Workflows: Suspend-Enqueue-Unload-Resume Done Correctly on Second-Phase Commit
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...
SDP 2009: Building Workflow Services with WF 4.0 and WCF 4.0
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...
Workflow Savepoints
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...
Forwarding Context-ful Messages
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...
Workflow Services Limitations: Part 5 - A Couple of Updates
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...
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...
Latest Articles: Introduction to Workflow Services and Reading Unmanaged Data Into Structures
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...
Using the Workflow Rule Condition Editor for Your Own Rule Conditions
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...
Workflow Services Limitations: Part 3 - Send and Receive Race Condition
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...
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...
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...
Cross-AppDomain Workflow Local Services
I stumbled across an interesting issue today that I thought might be worth sharing.  The design of my application server requires hosting multiple workflow types, potentially of multiple versions (the workflows are exposed as Workflow Services, using the WorkflowServiceHost class).  Since the server is long-running, it is feasible that several versions of the same workflow will be deployed and active on the same server, and several instances of each version will be created. The only way...
More Posts Next page »