What you will learn in this course

Essential Windows Workflow Foundation 4 teaches best practices for developing Windows Workflow Foundation applications. Learn why Windows Workflow Foundation 4 was created and discover how to support human and system activities by organizing them into workflows. Learn how to host Windows Workflow Foundation 4, either in your own application or using Windows Server AppFabric. Learn how to create custom activities, and develop workflows in Windows Workflow Foundation 4.

Course highlights

    • Gain understanding of the strengths and weaknesses of Windows Workflow Foundation 4.
    • Understand how workflow activities work and what their role is.
    • Discover what part of your application is best suited to use Windows Workflow Foundation and why.
    • Learn how you can empower your end users to create new, or change existing, workflows to adapt to the changing business environment.
    • Understand what the best way is to host your workflows in the various execution environments .NET is found like Windows Server AppFabric.
    • Find out how your workflows can interact with other business processes.

Course outline and topics

Day 1
Introduction and Architecture

There is a gap between the types of problems that businesses require solving and the problems developers solve with software. This gap requires the "orchestration" of the technical building blocks of software development to solve the business problem. Often this orchestration is performed on an ad-hoc basis but some parts of the business problem (for example long running business processes) require complex plumbing to solve. Windows Workflow Foundation (WF) is a framework that provides the glue to plug the business / technical mismatch and in this module we look at the main players in a workflow based solution.

A Workflow is a set of coordinated units of work called activities. This set of activities is called a workflow. In this module we look at how you build a workflow and how you can flow data from one activity to another.

Standard Activities
Windows Workflow Foundation ships with a large number of standard activities. In this module we will take a closer look at most of the standard activities that ship as part of the .NET framework and how we can use these in our workflows. Some of the more specialized activities, like WCF and transactions activities, will be covered in a module specific on that subject.

Day 2

There are a number of options for hosting your services (providing processes in which your services run). This module looks at the options for both standard and workflow services and examines the pros and cons of each. We also introduce Windows Server AppFabric, a new extension to the Windows Application Service Role that provides a robust, manageable hosting environment for your services with extended functionality for those build with WF.

Workflows don't work in an isolated environment but have to communicate with other SOAP services or can be exposed as a SOAP service to other applications. In this module we will be taking a closer look at the Windows Workflow Foundation and Windows Communications Foundation activities that let is expose a workflow as a service or consume another WCF service inside of our workflows.

Tracking & Tracing
Being able to execute a workflow is nice but often now enough. In most cases we also have to track what a workflow is doing during its execution. The standard .NET tracing infrastructure allows us to see what is going on. The workflow tracking capabilities give us far more insight into what a workflow is doing. When we use workflow tracking we can also create tracking profiles allowing us very fine control over what information is provided.

Day 3
Long Running/Persistence
One of the core requirements of a distributed system is resilience. If a server goes offline can we continue processing relatively unaffected? This is even more crucial then the processing is long running and stateful. In this module we look at the built in WF persistence infrastructure and how it solves, not only the problem of service resilience but also aids scalability. Along the way we will look at message correlation - a vital tool for long running service execution.

Developing Basic Activities/Unit Testing
The workflow team has created a set of activities called the standard activity library. However, these activities are of a technical and infrastructure nature - they do not model the business problems that you have to solve. Therefore, creating your own activities is one of the most important skills that a workflow developer has and in this module we look at the core infrastructure for building your own activities including providing designer support.

Error Handling
Error can and will occur, either in our workflows or in the code we call from our workflows. In this module we will take a closer look at how we can detect and handle errors as part of our workflow. We will also see what our options are when an error is not handled inside of the workflow and escalates to the execution environment.

Transactions allow us to treat a set of interactions as a single atomic operation. In this module you will learn how create transacted regions in workflows. However, traditional atomic transactions don't work for long running execution and so workflow also has a framework for compensation, a technique that allows us to perform manual "rollback" of already committed work. Both atomic transactions and compensation are powerful techniques but also have limitations in the context of distributed system and this module examines the technologies and challenges of transacted systems.

Day 4
Developing Advanced and Asynchronous Activities

There is some core plumbing required for a custom activity but there are also more advanced features that will often be required: coordinating child activities; modeling long running asynchronous tasks. In this module we look at more advanced scenarios and how you build powerful, expressive activities.

Rehosting the Designer
The workflow designer we use in Visual Studio 2010 is part of the standard .NET framework. This means we can use this same designer in our own applications allowing end users to view or change workflows. In this module we will see how we can add this workflow designer to our applications and change workflows while informing the end user if the workflow is valid or not.

AppFabric Hosting
Both Windows Server AppFabric and Windows Azure AppFabric are new and capable ways of hosting your workflow services. In this module you will learn how these two instances of the AppFabric differ and how you can use each one. You will learn how to configure and control Windows Server AppFabric both through the user interface as well as through PowerShell commandlets.