220 likes | 413 Views
Introducing Windows Workflow Foundation. Introducing Windows Workflow Foundation. Understanding Windows Workflow Foundation. Janakiram MSV Developer Evangelist Microsoft Corporation. Agenda. Architecture & Concepts Workflow Styles Summary. .Net Framework 3.0.
E N D
Introducing Windows Workflow Foundation Understanding Windows Workflow Foundation Janakiram MSV Developer Evangelist Microsoft Corporation
Agenda • Architecture & Concepts • Workflow Styles • Summary
.Net Framework 3.0 • WPF-Windows Presentation Foundation • XAML • XAMLPad, Expression Editor, VS Designer • CardSpace • WCF-Windows Communication Foundation • WF-Workflow Foundation • Orcas • .NET 3.0 Visual Studio Extensions
Power of Flow Chart • Maintainability is expensive • Code is opaque • Modules are hard-wired
Flowchart Scenarios • Document Life Cycle Management • LOB Application Workflow • Business Process Management • UI Navigation Logic
Yet Another Component…. public void PlaceNewOrder(Employee e, Product p) { if(e.FTE) switch(p.Category) { case “Computer”: if (GetManagerApproval(e,p)) { Inventory i=InventoryServiceProxy.GetInventory(P.ProductID); if(i.InStock) { PurchaseOrder PO=new PurchaseOrder(p,1); OrderAck Ack=OrderServiceProxy.SendPO(PO); SendMail( “Placed New Order”, ”Order #” + Ack.OrderNo+” Expected on ”+ ACK.ShipDate, e.EmailID ); } } ………………………………………………. ………………………………………………. }
Today’s Application Development Rules and policies Forms Workflow model Application code Data Services Application logic
What is Workflow? • Dictionary.com Definition • The flow or progress of work done by a company, industry, department, or person. • The rate at which such flow or progress takes place
Tenets of Workflow Workflows coordinate work performed by peopleand by software Workflows are long running and stateful Workflows are based on extensible models Workflows are transparent and dynamic through their lifecycle
Introducing Windows Workflow Foundation • Provide a singular engine for workflow execution for all applications built on the Windows platform • Supports a wide range of scenarios • Bring model-driven workflow development to the entire .NET development community • Enable reusable workflow component development to ensure both developers and ISVs can deeply embed this technology in their applications.
Windows Workflow Foundation Visual Designer • Workflows are a set of Activities A Workflow • Workflows run within a Host Process:any application or server Key Concepts • Developers can build their own Custom Activity Libraries An Activity Custom Activity Library Components Windows Workflow Foundation • Base Activity Library:Out-of-box activities and base for custom activities Base Activity Library • Runtime Engine:Workflow execution and state management Runtime Engine • Runtime Services:Hosting flexibility and communication Runtime Services • Visual Designer: Graphical and code-based construction Host Process
Workflow Basics using System.Workflow.Activities; public class Workflow1 : SequentialWorkflow { } • A workflow is a class • A workflow class may be defined in markup <?Mapping XmlNamespace="Activities" ClrNamespace="System.Workflow.Activities" Assembly="System.Workflow.Activities" ?> <SequentialWorkflow x:Class="MyWorkflow" xmlns="Activities" xmlns:x="Definition"> … </SequentialWorkflow>
Workflow Basics using System.Workflow.Activities; public partial class Workflow1 : SequentialWorkflow { public Workflow1() { InitializeComponent(); } } public sealed partial class Workflow1 : SequentialWorkflow { private Delay delay1; private void InitializeComponent() { this.delay1 = new System.Workflow.Activities.Delay(); this.delay1.ID = “delay1"; this.delay1.TimeoutDuration = System.TimeSpan.Parse("00:00:05"); this.Activities.Add(this.delay1); this.ID = "Workflow1"; } } • Workflow constructor configures contained activities (like forms & controls)
Demo Order Workflow
What are Activities? • An activity is a step in a workflow • Has propertiesandevents that are programmable within your workflow code • Has methods (e.g. Execute) that are only invoked by the workflow runtime • Think of Forms & Controls • Activity == Controls • Workflows == Forms • Activities fall under two broad categories • Basic – steps that “do work” • Composite – manage a set of child activities
Domain-SpecificWorkflow Packages Compliance CRM Extend activity Compose activities RosettaNet Author new activity IT Mgmt • Vertical-specificactivities & workflows • Best-practice IP &Knowledge Activities: An Extensible Approach Custom ActivityLibraries Base Activity Library Base Activity Library • OOB activities,workflow types,base types • General-purpose • Activity libraries define workflow constructs • Create/Extend/Compose activities • App-specificbuilding blocks • First-class citizens
Flexible Control Flow State1 State2 State Machine Workflow Sequential Workflow External events drive processing order Sequential structure prescribes processing order Step1 Event Step2 Event • Prescriptive, formal • Automation scenarios • Flowchart metaphor • Reactive, event-driven • Skip/re-work, exception handling • Graph metaphor Rules-driven Activities Rule1 Step1 Rules + data state drive processing order Data Step2 Rule2 • Data-driven • Simple Conditions, complex Policies • Constrained Activity Group
Summary • A single workflow technology for Windows • Platform level workflow framework for use within Microsoft products & ISV applications • Will be used by BizTalk Server, Office 2007 MBS & other Microsoft client/server products • Available to all Windows customers • Microsoft is redefining workflow • Unified technology for System & Human workflow • Multiple styles: sequential, rules-based, state machine • Supports dynamic interaction • Microsoft is taking workflow mainstream • Consistent and familiar programming model for reaching mainstream application developer • Available to millions of end-users through Office 2007 • Extensible platform for ISVs
Resources • http://wf.netfx3.com • http://msdn.microsoft.com/winfx • http://www.microsoft.com/seminar Janakiram.msv@microsoft.com
QuestionsMicrosoft Windows Vistawww.microsoft.com/windowsvista/