Download presentation
Presentation is loading. Please wait.
Published byÏΓάϊος Ἰωακείμ Δοξαράς Modified over 6 years ago
1
Building event-driven, long-running apps with Windows workflow
12/5/2018 9:47 PM TOOL-801T Building event-driven, long-running apps with Windows workflow Ron Jacobs Sr. Program Manager Microsoft Corporation © 2010 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.
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
Query database and return status
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 to HR Wait… No response Send another mail Wait… HR responds to Save in database and return status Send to applicant Complete
6
Windows Workflow Foundation provides a programming model to support long running event driven work
7
Workflow Windows Server AppFabric
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 public class DebugTrace : CodeActivity {
public InArgument<string> Text { get; set; } protected override void Execute( CodeActivityContext context) { Debug.WriteLine(Text.Get(context)); } © 2010 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.
10
Control Flow Which one should I use? Control React State Machine
Flowchart Sequence
11
A Lap Around WF 4.5 Key new features
Ask Feature Expressions in the language of the project C# expressions Create workflow services based on an existing contract Contract-First Better experience with Flowchart / State Machine designer Auto-connect, auto-insert, pan Add comments to activities in the designer surface Annotations (designer) Search integration in the workflow designer Search (designer) Invalid workflows should cause build errors Validation errors break build Authoring Improvements Basic building blocks for a versioning story WorkflowIdentity Host several versions of a service side by side WFSH versioning support Update running instances to a new definition Dynamic Update Versioning Run my workflows in Partial Trust Partial Trust Be able to plug my own expressions story Expressions Extensibility Better runtime performance VB expressions performance Runtime Enhancements
12
Application Process AppFabric Cache HR Data Persistence Applicant 1
Service 2 3 Education Service 6 4 5 Reviewer
13
demo Job Application 12/5/2018 9:47 PM
© 2010 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
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) Instance Data
Instance Store
17
WF 4 Persistence Workflow Definition (XAML) Instance Data
Instance Store
18
WF 4 Persistence Exception (?) Workflow Definition Workflow (v2)
(XAML) Workflow (v2) Instance Data (v?) Instance Data Instance Store
19
WF 4 Persistence Workflow (v2) Instance Data (v?) Instance Store
20
Workflow Identity “My Workflow” 1.0.0.0 Instance Data for
Instance Store
21
Workflow Identity Exception (Version Mismatch) “My Workflow” 1.0.0.0
Instance Data for “My Workflow” Instance Data ( ) Instance Store
22
WorkflowIdentity var identity = new WorkflowIdentity("My Workflow", new Version(1, 0, 0, 0)); var workflow = new WorkflowApplication( new Activity1(), identity); workflow.Run(); © 2010 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.
23
WorkflowApplicationInstance
// get the instance data but do not bind to definition var instance = WorkflowApplication.GetInstance( instanceId, instanceStore); // get the definition associated to the identity var definition = definitions[instance.DefinitionIdentity]; © 2010 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.
24
Demo Workflow Identity
25
Create Update Map “My Workflow” “My Workflow”
26
Apply Update Map Instance Data for “My Workflow” 1.0.0.0
27
Dynamic Update // Create the update map
DynamicUpdateMap map = DynamicUpdateServices.CreateUpdateMap(definition); © 2010 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.
28
Dynamic Update instance = WorkflowApplication.GetInstance(id, CreateInstanceStore()); application = new WorkflowApplication(targetActivity, targetIdentity); // apply the update to the instance application.Load(instance, this.currentUpdateMap); application.Unload(); © 2010 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.
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
35
For more information RELATED SESSIONS DOCUMENTATION & ARTICLES
Workflow and Windows Azure What's New with Workflow 4.5 Activities, Extensions, Tools available at
36
thank you Feedback and questions http://forums.dev.windows.com
Session feedback
37
12/5/2018 9:47 PM © 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. © 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.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.