1 / 38

Building event-driven, long-running apps with Windows workflow

TOOL-801T. Building event-driven, long-running apps with Windows workflow. Ron Jacobs Sr. Program Manager Microsoft Corporation. www.ronjacobs.com. Agenda. Some thoughts on "event-driven" and "long-running" Two Server Scenarios Job Application Mortgage Application One Client Scenario

radwan
Download Presentation

Building event-driven, long-running apps with Windows workflow

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. TOOL-801T Building event-driven, long-running apps with Windows workflow Ron Jacobs Sr. Program Manager Microsoft Corporation www.ronjacobs.com

  2. Agenda • Some thoughts on "event-driven" and "long-running" • Two Server Scenarios • Job Application • Mortgage Application • One Client Scenario • ATM Machine

  3. Event Driven Something Happens Something Responds Work gets done

  4. Event Driven Query status for order Query database and return status Display status to user

  5. Event Driven / Long Running Submit Job Application Save in database and return ID Display ID for user Send Email to HR Wait… No response Send another mail Wait… HR responds to email Save in database and return status Send Email to applicant Complete

  6. Windows Workflow Foundation provides a programming model to support long running event driven work

  7. Windows Server AppFabric Workflow

  8. Activity • Authored in XAML • Composition of other activities • Distribution • Compiled into an assembly with generated helpers • Loaded from stream (file system, database, service etc.)

  9. Activity • publicclassDebugTrace : CodeActivity{ • publicInArgument<string> Text { get; set; } • protectedoverridevoidExecute(CodeActivityContext context)      {Debug.WriteLine(Text.Get(context));      • } • }

  10. Control Flow Which one should I use? Control React Flowchart Sequence State Machine

  11. A Lap Around WF 4.5Key new features Authoring Improvements Versioning Runtime Enhancements

  12. Application Process Education Service Applicant 1 Applicant Service HR Data 2 Persistence 3 6 4 Reviewer 5 AppFabric Cache

  13. demo Job Application

  14. Versioning and Dynamic Update

  15. To properly version long running processes both behavior and data must have a version

  16. WF 3.5 Persistence Workflow Definition (XAML) Workflow Definition (XAML) Instance Data Instance Data Instance Store

  17. WF 4 Persistence Workflow Definition (XAML) Instance Data Instance Data Instance Store

  18. WF 4 Persistence Exception (?) Workflow Definition (XAML) Workflow (v2) Instance Data (v?) Instance Data Instance Store

  19. WF 4 Persistence Workflow (v2) Instance Data (v?) Instance Data Instance Store

  20. Workflow Identity “My Workflow”1.0.0.0 Instance Data for “My Workflow” 1.0.0.0 Instance Data (1.0.0.0) Instance Store

  21. Workflow Identity Exception (Version Mismatch) “My Workflow”1.0.0.0 “My Workflow”2.0.0.0 Instance Data for “My Workflow” 1.0.0.0 Instance Data (1.0.0.0) Instance Store

  22. WorkflowIdentity • var identity = newWorkflowIdentity("My Workflow", newVersion(1, 0, 0, 0)); • var workflow = newWorkflowApplication(newActivity1(), identity); • workflow.Run();

  23. WorkflowApplicationInstance • // get the instance data but do not bind to definition • varinstance = WorkflowApplication.GetInstance(instanceId, instanceStore); • // get the definition associated to the identity • vardefinition = definitions[instance.DefinitionIdentity];

  24. Demo Workflow Identity

  25. Create Update Map “My Workflow”1.0.0.0 “My Workflow”2.0.0.0

  26. Apply Update Map Instance Data for “My Workflow” 2.0.0.0 Instance Data for “My Workflow” 1.0.0.0

  27. Dynamic Update • // Create the update map • DynamicUpdateMapmap = DynamicUpdateServices.CreateUpdateMap(definition);

  28. Dynamic Update • instance = WorkflowApplication.GetInstance(id, CreateInstanceStore()); • application = newWorkflowApplication(targetActivity, targetIdentity); • // apply the update to the instance • application.Load(instance, this.currentUpdateMap); • application.Unload();

  29. Demo Dynamic Update

  30. State Machine

  31. ATM State Machine • Model business process as a series of states and transitions • Example from State Machine Hands On Lab • WPF Application • Model / View / View Model pattern

  32. Demo State Machine

  33. HTTP Messaging and Workflow

  34. HTTP Messaging • Request / response messaging built on the WCF WebApi stack • Prototype available • http://wf.codeplex.com

  35. For more information RELATED SESSIONS DOCUMENTATION & ARTICLES • Workflow and Windows Azure • What's New with Workflow 4.5 • Activities, Extensions, Tools available at • http://wf.CodePlex.com

  36. thank you Feedback and questions http://forums.dev.windows.com Session feedbackhttp://bldw.in/SessionFeedback

  37. © 2011 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.

More Related