Table of Contents
- Workflow Foundation 4.0
- Building a WCF service using WF4.0
- Lets get started
- Start New Project
- Rename service operation name and contract name:
- Add top level variables
- Receive Activity Configuration
- Parameter to workflow variable mapping
- Send Activity Configuration
- Steps to build a custom code activity
- Switch Activity Configuration
- WCF Web Service Test (using WCFTestClient)
The goal of this article is to help developers get familiar with Worflow Foundation 4.0.
It provides a programming model, in-process workflow engine and rehostable designer to implement long-running processes as workflows within .NET applications.MSDN
This article will provide a step-by-step guide to build and test a simple calculator web service in WF4.0. I will be using mostly built-in WF activities to build workflow. In addition, I will build a simple custom code activity to go over the custom activities.
So the task of the service will be to take three parameters, two for operand and one for operation name and return the result back to the client after applying the operation. The diagram below explains the complete flow that we are going to implement during this exercise and our workflow will look like this flow chart at the end.
Building workflow application will be similar to building this flow chart. Each box in the above diagram will be called activity and all the activities will be contained in a larger activity called Main Activity. Most of the activities needed to build this application will be provided by the Visual Studio 2010 and we will add a new custom activity to log the data into a file to track the application.