Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Windows Workflow Foundation (WF)

Similar presentations


Presentation on theme: "Introduction to Windows Workflow Foundation (WF)"— Presentation transcript:

1 Introduction to Windows Workflow Foundation (WF)
Keith Elder Microsoft MVP Blog: Quicken Loans –

2 Agenda Hello World in Workflow What is Workflow? Architecture
Understanding the Runtime WF Extensibility Rules Engine Scenarios for WF Versioning Hosting WF in a SOA

3 DEMO HELLO WORLD

4 What is Workflow? The workflow framework and tools for Microsoft products and partner/customer ecosystem Single workflow technology for Microsoft® Windows® A framework for building workflow, not an application or server Make declarative workflow a mainstream development paradigm At the end of the day workflow is a new namespace and supporting APIs developers can use to declaratively express business logic and long running processes. Single workflow technology for Microsoft® Windows® Base for Microsoft products and independent software vendor (ISV)/customer solutions One technology for human and system workflow scenarios A framework for building workflow into applications A framework to build on - not an application or server Exposed to developers via WinFX® Brings workflow to mainstream Microsoft® .NET development Transform workflow from niche to mainstream paradigm Build strong partner and solution ecosystem

5 Architecture A Workflow An Activity Windows Workflow Foundation
Host Process Windows Workflow Foundation Runtime Engine A Workflow An Activity Runtime Services Base Activity Library Custom Activity Library Visual Designer Key Concepts Workflows are a set of Activities Workflows run within a Host Process: any application or server Developers can build their own Custom Activity Libraries Components Base Activity Library: Out-of-box activities and base for custom activities Runtime Engine: Workflow execution and state management Runtime Services: Hosting flexibility and communication Visual Designer: Graphical and code-based construction

6 Understanding the Runtime
Host Application App Domain Runtime Services Out of Box Services are provided that support SQL Server 2000 & 2005 Services PersistenceService stores and retrieves instance state. SQL PersistenceService TrackingService TrackingService manages profiles and stores tracked information. SchedulerService TransactionService Common resource services for managing threading, timers and creating transactions

7 Activites: An Extensible Approach
Vertical-specific activities and workflows Best-practice intellectual property (IP) and knowledge Domain-Specific Workflow Packages Compliance RosettaNet CRM IT Mgmt Base Activity Library Custom Activity Libraries Compose activities Extend activity Author new activity Out-of-Box Activities Theme you’re going to see throughout WF Activities are completely extensible. All of the activities that ship in WF are built the same way, so you have access to all of that extensibility, designers, look and feel, etc OOB activities, workflow types, base types General-purpose Activity libraries define workflow constructs Create/Extend/ Compose activities App-specific building blocks First-class citizens

8 WF Extensibility Designer Rehosting

9 DEMO CUSTOM ACTIVITIES

10 Workflow Rules Conditions on activities Policy activity
12/9/ :11 AM Workflow Rules Conditions on activities If-Else While Replicator Conditioned Activity Group (CAG) <Your custom activity> Policy activity Contains and executes a RuleSet RuleSet execution provides priority-based, forward-chaining semantics Rules can be used outside workflow © 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

11 Forward Chaining RuleSet Execution Sequence Amount = $25 Total = $80
Rule 1 (P0) If Total > $50 & < $100 Then Discount = 10% Rule 2 (P0) If Total >= $100 Then Discount = 15% Rule 3 (P0) If Amount > $0 Then Total = Total + Amount Amount = $25 Total = $80 Discount $105 = 10% 15%

12 12/9/ :11 AM Policy Overview Policy activity references a RuleSet in the workflow.rules file RuleSet class contains a collection of Rules Rules are If-Then-Else expressions that evaluate and operate on workflow members © 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

13 CAG - Overview Child activity executes CAG executes
12/9/ :11 AM CAG - Overview Child activities Child activity executes When(Condition1) CAG executes Until(Condition2) Default execution is a parallel When Executes activity once Until “All children quiescent” Executing children complete and all When conditions == false Conceptually, an activity executes: IF When && !(Until) © 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

14 DEMO RULES ENGINE

15 Versioning in WF – Where?
Workflow Activity Tracking Profile Rules Host and runtime services Exposed as a web service The highly extensible design of the runtime, activities and services enable opportunities for versioning in a number of different places.

16 Workflow Versioning Compiled Declarative
Standard .NET versioning story Strong Names, GAC, etc. What I’m not going to dive into the details of Declarative This is what we call XAML-only workflows Versioning here takes place in the host, when deciding what XAML to grab But wait, my workflows are already running! DynamicUpdate API address how to change these Declarative There’s going to be some repository you will need to enable an effective declarative approach (otherwise you’re loading a string, which is kind of boring) In this repository, you are going to need to track some kind of version (or maybe you only have the most recent available in a text file on a file share somewhere) This text file outlines the arrangement of your activities, and their individual configuration, so if you introduce a new activity, you need to make sure that assembly is available to the host when it comes time to initialize that activity. Also, have the XAML v. XOML talk

17 Cluster of Workflow Runtimes accessing the same persistence store
Scaling? Cluster of Workflow Runtimes accessing the same persistence store Host* 1 Host 2 Host 3 Host N Workflow Runtime 1 Workflow Runtime 2 Workflow Runtime 3 Workflow Runtime N SQL Persistence Service SQL Persistence Service SQL Persistence Service SQL Persistence Service The persistence service will take care of ensuring that an instance doesn’t get spun up on multple hosts? But I want a sophisticated app provisioning capabilty built off the same persitence store…. Write your own persistence service! The out-of-box SQL Workflow Persistence Service allows multiple workflow runtimes to use the same persistence store Locks workflow instances when used by workflow runtime Lock timeout interval Avoids locking of workflow instances by serially retrieving them when service is initiated Delivers all timer events when service is initiated SQL * The host could be IIS

18 WF in a SOA WF Orchestrating Services WF As Service Implementation

19 DEMO Calling Workflows via services

20 Introduction to Windows Workflow Foundation (WF)
Keith Elder Microsoft MVP Blog: Quicken Loans –


Download ppt "Introduction to Windows Workflow Foundation (WF)"

Similar presentations


Ads by Google