1 / 27

Developing Rules Driven Workflows in Windows Workflow Foundation

Developing Rules Driven Workflows in Windows Workflow Foundation. Jurgen Willis COM318 Program Manager Microsoft Corporation. Agenda. Why Rules? Activity Conditions + Dynamic Update Conditioned Activity Group Policy. Windows Workflow Foundation.

shaun
Télécharger la présentation

Developing Rules Driven Workflows in Windows Workflow Foundation

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. Developing Rules Driven Workflows in Windows Workflow Foundation Jurgen Willis COM318 Program Manager Microsoft Corporation

  2. Agenda • Why Rules? • Activity Conditions + Dynamic Update • Conditioned Activity Group • Policy

  3. Windows Workflow Foundation Extensible framework and tools for building workflow into Windows applications • Single workflow technology for Microsoft products, partners and customers • A framework to build on – not a server or application • Key features • Enables long running workflows in any application or server • Extensible activity framework • Unified model for human and system workflow scenarios • Visual designer for graphical and code-based authoring • Availability • Exposed via WinFX – powers Office “12” workflow

  4. Windows Workflow Foundation Visual Designer Workflows are a set of Activities Key Concepts AWorkflow Workflows run within a Host Process: any application or server Developers can build their own Custom Activity Libraries AnActivity 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

  5. Modeling Power Approachability Ease of Change Why Rules?

  6. Rules and policies Forms Workflow model Application code Data Services Rules and Application Development Model-driven development Application logic

  7. Rules and Workflow Policy applied to validate order Condition determines how to handle errors Rules determine order routing

  8. Terminology • Condition • Expression that evaluates to True or False • Rule • Modeled as: IF<Condition> THEN<Action(s)> ELSE<Action(s)> • RuleSet • Collection of Rules with a set of execution semantics

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

  10. Rule Conditions

  11. Dynamic Update • Add / remove activities • Modify rule conditions on running workflow instances • Performed from code-beside or the host • Can be disabled for a workflow instance

  12. Dynamic Update

  13. Conditioned Activity Group (CAG) Flexible, rule-driven activity execution Modeling of activity sets with numerous sequencing permutations Motivation Stage-Gate pattern Collaborative tasks Scenarios

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

  15. CAG - Overview • Reevaluation • When immediate child moves to completed state • Define custom Until condition to short-circuit CAG execution • No new activities executed • Blocked activities cancelled

  16. Conditioned Activity Group

  17. Policy Separation of business logic from application sequencing Declarative statements of business intent Execution semantics to support rich sets of business logic Motivation Order validation Warranty claims management Discount calculation Scenarios

  18. What about the BizTalk BRE? BizTalk Business Rules Engine • The next major version of BizTalk (post-BizTalk 2006) will be built on Windows Workflow Foundation • Windows Workflow Foundation will provide the core rules engine evaluator and developer tools • BizTalk will provide premium tooling and server infrastructure, e.g.: • Business analyst tools • RuleSet storage and management • RuleSet analysis

  19. Policy Overview • “Policy” activity used as base type for custom activity • RuleSet class contains a collection of Rules • Rules are If-Then-Else expressions that evaluate and operate on activity properties • Expressions are CodeDom based • Priority value can be used to order rule evaluation

  20. Policy

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

  22. RuleSet Chaining • Chaining Mechanisms • Implicit based on property usage • Explicit using Update statement • “Partially explicit” using method attributes • Additional Points • Maximum execution count property • Halt statement

  23. Policy Extensibility

  24. Summary • Integrated workflow and rules capability • Flexible forward chaining rules engine • Rules + dynamic update => flexible workflow definition and control

  25. Hands-on Labs! Workflow Sessions Introduction to Workflow in Windows Applications (COM210) Wed 1:45 – 150/151 Hall E My Workflows My Custom Activity Library Extending Workflow Capabilities With Custom Activities (COM328) Wed 3:15 – 150/151 Hall E Windows Workflow Foundation Developing Rules-Driven Workflows (COM318) Wed 5:00 – 152/153 Hall F Base Activity Library State Machine Workflows Windows SharePoint Services: Developing Custom Workflows (OFF415) Thurs 11:30 – 408 AB Rules-Driven Activities Communication Activities Developing Event-Driven State Machine Workflows (COM322) Thurs 2:15 – 515 AB Runtime Engine Runtime Services Workflow + Messaging + Services - Developing Dist’d Apps (COM325) Thurs 3:45 – 150/151 Hall E Windows Communication Foundation Hosting and Communications in Workflow Scenarios (COM327) Thurs 5:15 – 402 AB Host Process

  26. More Community Resources • At PDC • 12 Labs: COMHOL01-12 • “Ask The Experts” tables – 4 tables and lots of experts • COM Track Lounge • Get your copy of the “Presenting Windows Workflow Foundation” book • Keep your voucher from today’s keynote and redeem at the PDC bookstore • After PDC • If you missed a related session, watch it on the DVD • MSDN dev center: http://msdn.microsoft.com/workflow • Windows Workflow Foundation community site http://www.windowsworkflow.net • Channel 9 tag: http://channel9.msdn.com/tags/workflow

  27. © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

More Related