Upload
others
View
8
Download
0
Embed Size (px)
Citation preview
Alex Chan, Product Unit ManagerCongyu Li, SDEMicrosoftSession Code: DEV388
Agenda
WF 4.0 Basics
WF 4.0 Advanced
Tracking
Messaging and Correlation
Persistence
Custom Activities and Activity DesignersSummary
WF provides tools to create scalable, long-running applications and services.
WF is part of the .NET 4.0
WebData Presentation
Common Language Runtime
Base Class Library
CommunicationsWorkflow
Host (.exe, IIS/WAS, Dublin, TFS, …)
Runtime Extensions
Tracking
Persistence
…
WF consists of …
Activities
Runtime
Tooling
ToolingVS
DesignerVS
DebuggerRehostedDesigner
Activities
Activity Library
WF Activity Model
Activities are the primitive abstraction for behavior.
Activities are composable with other Activities
Arguments represent data that can flow into or out of an Activity
Variables store user data, can be bound to Arguments
Sequence
Send Message
Generate Order
Variables
OutArgument<Order>
InArgument<Message>
Control Flow Activities
Flowchart Sequential
Activity LibraryCustom Activities
SharePoint Dynamics Systems Center
HPCTeam Foundation
Server<YOUR CODE HERE>
Base Activity Library
WCF Messaging
Error HandlingExpressions
Interop
Utilities
WF Primitives
Declarative Workflows
Authoring experienceFocus on what not how
Developers and stakeholders speak the same (visual) language
XAML formatProgram definition is just data (XML file)
Simplifies tooling support and designers
Increases hosting and deployment flexibility
Workflow Designer
Based on WPF
Rich debugging experience
Easy to rehost in other applications
Why to Use WF
Why WFCreate scalable, long running processes
Application transparency and flexibility
Great customizable visual experience
BenefitsProductivity
Cost savings
Visibility
WF 4.0 Basics
Agenda
WF 4.0 Basics
WF 4.0 Advanced
Tracking
Messaging and Correlation
Persistence
Custom Activities and Activity DesignersSummary
Threading Model
Workflow “scheduler” continue to execute work items on one thread until either go idle or the runtime is explicitly paused by the host through ActivityRuntime.RequestPause
Extensibility for threading in WF Runtime is based on SynchronizationContext
Workflow Runtime
Scheduler I/O
Receive
Asynchronous Operation
InArgument<string> Query
OutArgument<DataReader> result
Execute
Completed
Bookmark Resumeyield
Receive
Runtime HostingWorkflowInvoker
WorkflowInstance
WorkflowApplication
WorkflowInstance
WorkflowServiceHost
WorkflowInstance
CustomHost
MyWorkflowInstance
Dublin
WorkflowServiceHost
WorkflowInstance
•“Function invocation” •Button click handler•Activity testing
•No persistence•No bookmarks•No instance control
•Host application integration•WF-driven UI
•Bookmarks•Persistence•Single instance•No integrated messaging
•Hosted workflow service•Integrated messaging•Activation / instance mgmt•Config•OOB durable timers
Workflow Service Host capabilities
Workflow Service Host
Application Endpoint
Dispatcher
InstanceStore
Channel
Workflow Service
Instance
Channel
.config
Workflow Management
Service
Management
Endpoint
Tracking Profile
Agenda
WF 4.0 Basics
WF 4.0 Advanced
Tracking
Messaging and Correlation
Persistence
Custom Activities and Activity DesignersSummary
Tracking
Gains visibility into the execution of workflowWorkflow instance state
Activity state
Variable/Argument value
…
WF 4.0 v.s WF 3.xMore customizable
Improved performance
Simplified programming model
Tracking
Tracking Record emits from Workflow Runtime
Tracking Profile to filter tracking records
Tracking Participant subscribes to tracking record
Workflow Instance
filtered TrackingRecordsaccoding
toTrackingProfile
TrackingParticipant
TrackingRecords
FilteredTrackingRecords
Workflow Runtime TrackingInformationStore
Custom
ETW
Tracking
Types of Tracking Records Workflow instance tracking records
Activity tracking records
Bookmark resumption tracking records
Custom tracking records …
Tracking
Agenda
WF 4.0 Basics
WF 4.0 Advanced
Tracking
Messaging and Correlation
Persistence
Custom Activities and Activity DesignersSummary
Messaging Activities
Activities
• Receive
• SendReply
Template
• ReceiveAndSendReply template
Activities
• Send
• ReceiveReply
Template
• SendAndReceiveReply template
Tools
• Add Service Reference for Workflow
Client Service
Correlation
Correlation typesContent-based correlation
Protocol correlation
123
123
Messaging and Correlation
Agenda
WF 4.0 Basics
WF 4.0 Advanced
Tracking
Messaging and Correlation
Persistence
Custom Activities and Activity DesignersSummary
Workflow host
Persistence
Why?Resource efficiency for long-running tasks
Recover from host failures
Scale with in-flight load-balancing
OOTB support for persistencePersist Activity
Customizable persistence store
Customizable persistence content Database
Workflow state
Durable capture of an program’s state
Agenda
WF 4.0 Basics
WF 4.0 Advanced
Tracking
Messaging and Correlation
Persistence
Custom Activities and Activity DesignersSummary
Activity Hierarchy
Activity
CodeActivity
AsyncCodeActivity
ActivityWithResult
NativeActivity
DynamicActivity
Activity<TResult>
CodeActivity<TResult>
AsyncCodeActivity<TResult>
NativeActivity<TResult>
DynamicActivity<TResult>
Workflow Designer Architecture
XAMLObject
TreeModel Item Tree
• Change notification
• Undo/redo
Workflow View Element
• Supports
• Selection
• Navigation
• Drag
• Cut/paste
Workflow Item Presenter
Workflow Items Presenter
ExpressionTextBox
Binding
Binding
Wrapped
Contains
Deserialization
Serialization
Agenda
WF 4.0 Basics
WF 4.0 Advanced
Tracking
Messaging and Correlation
Persistence
Custom Activities and Activity DesignersSummary
Summary
Changes in WF 4.0
XAML-only modelEnhanced baseactivity library
Simplified programming
model
Simplifieddata flow
Runtime/designer improvements
Performance improvements
Summary
What is WF:Activities
Runtime
Tooling
Why WF:Create scalable, long running processes
Application transparency and flexibility
Great customizable visual experience
http://microsoft.com/technet
Resources for IT Professionals
http://microsoft.com/msdn
Resources for Developers
www.microsoft.com/learning
Microsoft Certification & Training Resources
Resources
© 2009 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.