1 / 20

Introduction to Windows Workflow Foundation (WF)

Introduction to Windows Workflow Foundation (WF). Keith Elder Microsoft MVP Blog: http://keithelder.net/blog/ Quicken Loans – http://www.quickenloans.com. Agenda. Hello World in Workflow What is Workflow? Architecture Understanding the Runtime WF Extensibility Rules Engine

johannes
Download Presentation

Introduction to Windows Workflow Foundation (WF)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to Windows Workflow Foundation (WF) • Keith Elder • Microsoft MVP • Blog: http://keithelder.net/blog/ • Quicken Loans – http://www.quickenloans.com

  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. DEMOHELLO WORLD

  4. What is Workflow? http://tinyurl.com/38g64k 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. http://tinyurl.com/38g64k

  5. Visual Designer A Workflow An Activity Custom Activity Library Windows Workflow Foundation Base Activity Library Runtime Engine Runtime Services Host Process Architecture 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. Understandingthe 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 http://tinyurl.com/yuwsew

  7. Domain-Specific Workflow Packages Compliance CRM Extend activity Compose activities RosettaNet Author new activity IT Mgmt • Vertical-specific activities and workflows • Best-practice intellectual property (IP) and knowledge Activites: An Extensible Approach Custom Activity Libraries Base Activity Library Out-of-Box Activities • 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 http://tinyurl.com/36vs2j

  9. DEMOCUSTOM ACTIVITIES

  10. 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

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

  12. 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

  13. 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)

  14. DEMORULES ENGINE

  15. Versioning in WF – Where? • Workflow • Activity • Tracking Profile • Rules • Host and runtime services • Exposed as a web service

  16. Workflow Versioning • Compiled • 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

  17. Scaling? Cluster of Workflow Runtimes accessing the same persistence store Host N Host 2 Host 3 Host* 1 WorkflowRuntime 1 WorkflowRuntime 2 WorkflowRuntime 3 WorkflowRuntime N SQL Persistence Service SQL Persistence Service SQL Persistence Service SQL Persistence Service SQL * The host could be IIS

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

  19. DEMOCalling Workflows via services

  20. Introduction to Windows Workflow Foundation (WF) • Keith Elder • Microsoft MVP • Blog: http://keithelder.net/blog/ • Quicken Loans – http://www.quickenloans.com

More Related