200 likes | 353 Views
Exploring Windows Workflow Foundation. Farzin Faramarzi Synergetics. What is a Workflow?. A Workflow is a set of activities executed, in a predefined order, or following predefined rules, to coordinate people and/or systems in the fulfilment of a task/goal. What is a Workflow? contd.
E N D
Exploring Windows Workflow Foundation Farzin Faramarzi Synergetics
What is a Workflow? • A Workflow is a set of activities executed, in a predefined order, or following predefined rules, to coordinate people and/or systems in the fulfilment of a task/goal.
What is a Workflow? contd. • A Workflow is made up of a set of activities. • The activities in a Workflow are executed in a coordinated fashion.
What is a Workflow? Contd. • A Workflow is like a Windows Form, and each activity in the workflow is like a control on the form. • Just as controls can be composed into one Composite Control, activities can be composed into one Composite Activity.
What is the Windows Workflow Foundation? • The Windows Workflow Foundation (WF) is an engine and a framework for building workflow into .NET applications. • It is not a product, but a set of services which is bundled with WinFX (now called the .NET Framework 3.0).
Why do we need it? • Other Microsoft products like Content Management Server, BizTalk Server, Exchange Server use workflow, but in different ways. • WF is a single workflow technology that exposes a uniform way (API) of integrating workflow into .NET applications. • It can be used to create System Workflows (Flowchart style), as well as Human Workflows (State Machine style).
Why is it a Framework? • It is a single workflow technology on Windows for building products centered on workflow. • It is a programming model, along with a Base Activity Library. • It also comes with a runtime engine, associated services, and tools for development. • It is extensible, and can be used for both, System and Human Workflow.
Windows Workflow Foundation Concepts • The Visual Designer is used to design Workflows. It comes packaged with WF, and is integrated into Visual Studio. • Workflows are made up of activities, where each activity completes a specific task/sub-task. • Activities can be selected from • The Base Activity Library • Custom-built Activity Libraries
Windows Workflow Foundation Concepts • Every workflow executes within a Host Process. • The Host Process hosts • the Workflow Runtime executes workflows and manages state • Workflow Services Tracking, Persistence, Transactions, Threading, Communications, Timer • An activity is a unit of execution within a workflow.
Visual Designer Host Process A Workflow An Activity Custom Activity Library Windows Workflow Foundation Base Activity Library Base Activity Library Base Activity Library Runtime Services Runtime Services Runtime Engine Runtime Engine Runtime Services Windows Workflow Foundation Architecture • Visual Designer • Workflow • Custom Activity Library • Base Activity Library • Runtime Engine • Runtime Services • Host Process (to host the above)
Creating a Workflow • A WF workflow can be created using • XAML • Code (.NET) • XAML and Code (code beside) • A Workflow is a .NET class that inherits from either • SequentialWorkflowActivity (for a System Workflow), or • StateMachineWorkflowActivity (for a Human Workflow)
Creating a Workflow contd. • An activity is a class that has properties and events that can be programmed to. • An activity also has methods that can only be called by the Workflow Runtime.
Workflow Demo – Sequential Workflow Host Process Create & Start Workflow Runtime Create & Start
Passing Data into a Workflow using Parameters • Declare properties in the Workflow class • The object sending the data declares a Dictionary<string parameter_name, object parameter_value> object populated with the data to pass. • The sending object then invokes CreateWorkflow() on the runtime, passing the dictionary object as an argument.
Demo – StateMachine Workflow • A StateMachine Workflow will have an Initial State and a Final State. • A StateMachine Workflow is Event Driven, and would subscribe to events that would cause it to exhibit behaviour and/or change State.
Extensibility options • Custom Activities • Composite Activities • Custom Services • Visual Designer
Microsoft Products built on WF • Microsoft Office Sharepoint Server 2007 • Next version of BizTalk Server • Microsoft Speech Server 2007 • Microsoft Identity Integration Server
Resources • Visit http://www.microsoft.com/downloads and search for ‘Workflow Foundation Hands-On-Labs’ • Virtual Labs athttp://msdn.microsoft.com/virtuallabs/windowsworkflow