Welcome!

.NET Authors: Hovhannes Avoyan, Bruce Armstrong, Pat Romanski, Liz McMillan, Yeshim Deniz

Related Topics: .NET, Java

.NET: Article

What Is Windows Workflow Foundation?

Take control of your processes with WF

Communications between workflows and their outside environment take place in three different ways, as shown in Figue 6: parameters, inbound events, and outbound method invocation. Parameters provide a mechanism for initiating the workflow instance with information from outside the workflow and for accessing data after the workflow completes. Inbound events provide a mechanism for passing information from the host application to the workflow instance while the workflow is executing. Inbound events are processed by the workflow instance in an asynchronous fashion. The processing pattern for inbound events is queues. Outbound method invocation provides a mechanism for the workflow to send data from the host application. The host application registers a service that is accessed by the workflow instance to invoke methods on it. Through this method invocation, host applications gain access to information coming from the workflow. Method invocations take place in a synchronous fashion.

Development Environment
Let us take a look at the environment as shown in Figure 7. As you can see from Figure 8, Microsoft Visual Studio provides a set of project templates that can be used to develop workflow applications. These project templates provide a graphical workflow designer that can be rehosted outside of Visual Studio to create your own design environment. In the Visual Studio Workflow Designer you will find workflow activities in the toolbar. These activities can be dragged and dropped into the design surface to compose workflows. Once an activity is selected, its properties can be configured using the Visual Studio property window. Activities can be copied, pasted, and commented to enhance the development experience. Commented activities are visible in the design surface but are not executed during run time.

Developers can construct new activities in Visual Studio by creating a Workflow Activity Library project. This is supported using Visual Studio templates, which provide a graphical environment for defining sub-workflows as composite activities. Activities are compiled into activity libraries. Once built, these activities are displayed on the Visual Studio toolbar alongside of the default activity libraries.

Workflow libraries can be debugged using the Visual Studio environment as shown in Figure 8. This allows developers to define breakpoints on workflow activities inside the Workflow Designer. Once a breakpoint is reached inside the designer, developers are able to drill down on the code separation by pressing the F11 key. F11 navigates developers to the code separation associated with the executing activity. This is feasible if there is code separation associated with the activity, otherwise an Intermediate Language (IL) view is displayed. Graphical debugging of the workflow allows developers to see the execution flow of the workflow and query the data used to influence the execution.

One of the other cool features of the framework is the ability to rehost the workflow designer inside WinForm applications. The control reads a workflow object that is constructed using the Workflow Application Programming Interfaces (API). This capability increases the productivity of developers who are interested in developing other workflow designer applications. These designer environments normally target system analysts or line-of-business users.

Conclusion
Microsoft Windows Workflow Foundation (WF) provides a framework for developing workflows using the .NET Framework. The framework is intended to improve the productivity of developers who need to create, incorporate the power of workflows, and, more specifically, long-running application semantics, to their applications. The characteristics of these long-running processes make it difficult for developers to build the required infrastructure to support complex processes. Using WF, developers are able to build complex business process applications that support concepts like transactions, concurrency, compensation, tracking, and communications without having to worry about the plumbing. With WF, Microsoft is making workflow available to everyone.

For additional resources about Windows Workflow Foundation, please visit http://WindowsWorkflow.net and www.microsoft.com/workflow.

More Stories By Israel Hilerio

Israel Hilerio is a program manager at Microsoft in the Windows Workflow Foundation team. He has 15+ years of development experience doing business applications and has a PhD in Computer Science.

Comments (3) View Comments

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


Most Recent Comments
CopyEditor 02/01/06 04:11:46 PM EST

Interesting and informative article..but oh, the errors in English. Pretty bad, guys.

..discreet pieces of functionality.." Oh, we have tactful functions? DISCRETE.

"..the life cycle...are managed by the workflow runtime." The cycle IS managed.

Also, usually runtime is one word, not two - you try both, just for fun, I guess.

"Application developers...can overwrite these services." Well, maybe - but I suspect you meant OVERRIDE, no?

(i.e. SqlStatePersistenceServiceClass) - I am not sure if you really meant "i.e." - meaning, that is the ONLY relevant class - or if you meant "such as," "for example" - if so, of course, the term is "e.g." They are from Latin, after all: id est = "that is." Exemplis gratia = "for the sake of example".

Same applies a little later with SqlTimerServiceClass. But if that is the only class involved, why not just say "using" - "i.e." seems unnecessary.

"can be rehosted outside of Visual Studio" - aargh, this perpetual "outside of" and "inside of." Drop the "of"!

Ok, that's my groan for the day! But it really was a good article!

SYS-CON Germany News Desk 12/17/05 02:00:46 PM EST

Java Product Review: What Is Windows Workflow Foundation? Most businesses require processes to function properly. There are different types of processes. Some processes are human-intensive, others machine-intensive, and the last type is a combination of the first two. Some examples of business processes are payroll, new product introductions, new employee hiring, etc. In most cases, these business processes require intervention from multiple entities and thus, are normally long running.

SYS-CON Netherlands News Desk 12/17/05 01:12:14 PM EST

Java Product Review: What Is Windows Workflow Foundation? Most businesses require processes to function properly. There are different types of processes. Some processes are human-intensive, others machine-intensive, and the last type is a combination of the first two. Some examples of business processes are payroll, new product introductions, new employee hiring, etc. In most cases, these business processes require intervention from multiple entities and thus, are normally long running.