35

Alex Chan, Product Unit Manager Microsoft®download.microsoft.com/documents/hk/technet/techdays2009/DEV3… · Recover from host failures Scale with in-flight load-balancing OOTB

  • Upload
    others

  • View
    8

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Alex Chan, Product Unit Manager Microsoft®download.microsoft.com/documents/hk/technet/techdays2009/DEV3… · Recover from host failures Scale with in-flight load-balancing OOTB
Page 2: Alex Chan, Product Unit Manager Microsoft®download.microsoft.com/documents/hk/technet/techdays2009/DEV3… · Recover from host failures Scale with in-flight load-balancing OOTB

Alex Chan, Product Unit ManagerCongyu Li, SDEMicrosoftSession Code: DEV388

Page 3: Alex Chan, Product Unit Manager Microsoft®download.microsoft.com/documents/hk/technet/techdays2009/DEV3… · Recover from host failures Scale with in-flight load-balancing OOTB

Agenda

WF 4.0 Basics

WF 4.0 Advanced

Tracking

Messaging and Correlation

Persistence

Custom Activities and Activity DesignersSummary

Page 4: Alex Chan, Product Unit Manager Microsoft®download.microsoft.com/documents/hk/technet/techdays2009/DEV3… · Recover from host failures Scale with in-flight load-balancing OOTB

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

Page 5: Alex Chan, Product Unit Manager Microsoft®download.microsoft.com/documents/hk/technet/techdays2009/DEV3… · Recover from host failures Scale with in-flight load-balancing OOTB

Host (.exe, IIS/WAS, Dublin, TFS, …)

Runtime Extensions

Tracking

Persistence

WF consists of …

Activities

Runtime

Tooling

ToolingVS

DesignerVS

DebuggerRehostedDesigner

Activities

Activity Library

Page 6: Alex Chan, Product Unit Manager Microsoft®download.microsoft.com/documents/hk/technet/techdays2009/DEV3… · Recover from host failures Scale with in-flight load-balancing OOTB

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>

Page 7: Alex Chan, Product Unit Manager Microsoft®download.microsoft.com/documents/hk/technet/techdays2009/DEV3… · Recover from host failures Scale with in-flight load-balancing OOTB

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

Page 8: Alex Chan, Product Unit Manager Microsoft®download.microsoft.com/documents/hk/technet/techdays2009/DEV3… · Recover from host failures Scale with in-flight load-balancing OOTB

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

Page 9: Alex Chan, Product Unit Manager Microsoft®download.microsoft.com/documents/hk/technet/techdays2009/DEV3… · Recover from host failures Scale with in-flight load-balancing OOTB

Workflow Designer

Based on WPF

Rich debugging experience

Easy to rehost in other applications

Page 10: Alex Chan, Product Unit Manager Microsoft®download.microsoft.com/documents/hk/technet/techdays2009/DEV3… · Recover from host failures Scale with in-flight load-balancing OOTB

Why to Use WF

Why WFCreate scalable, long running processes

Application transparency and flexibility

Great customizable visual experience

BenefitsProductivity

Cost savings

Visibility

Page 11: Alex Chan, Product Unit Manager Microsoft®download.microsoft.com/documents/hk/technet/techdays2009/DEV3… · Recover from host failures Scale with in-flight load-balancing OOTB

WF 4.0 Basics

Page 12: Alex Chan, Product Unit Manager Microsoft®download.microsoft.com/documents/hk/technet/techdays2009/DEV3… · Recover from host failures Scale with in-flight load-balancing OOTB

Agenda

WF 4.0 Basics

WF 4.0 Advanced

Tracking

Messaging and Correlation

Persistence

Custom Activities and Activity DesignersSummary

Page 13: Alex Chan, Product Unit Manager Microsoft®download.microsoft.com/documents/hk/technet/techdays2009/DEV3… · Recover from host failures Scale with in-flight load-balancing OOTB

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

Page 14: Alex Chan, Product Unit Manager Microsoft®download.microsoft.com/documents/hk/technet/techdays2009/DEV3… · Recover from host failures Scale with in-flight load-balancing OOTB

Asynchronous Operation

InArgument<string> Query

OutArgument<DataReader> result

Execute

Completed

Bookmark Resumeyield

Receive

Page 15: Alex Chan, Product Unit Manager Microsoft®download.microsoft.com/documents/hk/technet/techdays2009/DEV3… · Recover from host failures Scale with in-flight load-balancing OOTB

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

Page 16: Alex Chan, Product Unit Manager Microsoft®download.microsoft.com/documents/hk/technet/techdays2009/DEV3… · Recover from host failures Scale with in-flight load-balancing OOTB

Workflow Service Host capabilities

Workflow Service Host

Application Endpoint

Dispatcher

InstanceStore

Channel

Workflow Service

Instance

Channel

.config

Workflow Management

Service

Management

Endpoint

Tracking Profile

Page 17: Alex Chan, Product Unit Manager Microsoft®download.microsoft.com/documents/hk/technet/techdays2009/DEV3… · Recover from host failures Scale with in-flight load-balancing OOTB

Agenda

WF 4.0 Basics

WF 4.0 Advanced

Tracking

Messaging and Correlation

Persistence

Custom Activities and Activity DesignersSummary

Page 18: Alex Chan, Product Unit Manager Microsoft®download.microsoft.com/documents/hk/technet/techdays2009/DEV3… · Recover from host failures Scale with in-flight load-balancing OOTB

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

Page 19: Alex Chan, Product Unit Manager Microsoft®download.microsoft.com/documents/hk/technet/techdays2009/DEV3… · Recover from host failures Scale with in-flight load-balancing OOTB

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

Page 20: Alex Chan, Product Unit Manager Microsoft®download.microsoft.com/documents/hk/technet/techdays2009/DEV3… · Recover from host failures Scale with in-flight load-balancing OOTB

Tracking

Types of Tracking Records Workflow instance tracking records

Activity tracking records

Bookmark resumption tracking records

Custom tracking records …

Page 21: Alex Chan, Product Unit Manager Microsoft®download.microsoft.com/documents/hk/technet/techdays2009/DEV3… · Recover from host failures Scale with in-flight load-balancing OOTB

Tracking

Page 22: Alex Chan, Product Unit Manager Microsoft®download.microsoft.com/documents/hk/technet/techdays2009/DEV3… · Recover from host failures Scale with in-flight load-balancing OOTB

Agenda

WF 4.0 Basics

WF 4.0 Advanced

Tracking

Messaging and Correlation

Persistence

Custom Activities and Activity DesignersSummary

Page 23: Alex Chan, Product Unit Manager Microsoft®download.microsoft.com/documents/hk/technet/techdays2009/DEV3… · Recover from host failures Scale with in-flight load-balancing OOTB

Messaging Activities

Activities

• Receive

• SendReply

Template

• ReceiveAndSendReply template

Activities

• Send

• ReceiveReply

Template

• SendAndReceiveReply template

Tools

• Add Service Reference for Workflow

Client Service

Page 24: Alex Chan, Product Unit Manager Microsoft®download.microsoft.com/documents/hk/technet/techdays2009/DEV3… · Recover from host failures Scale with in-flight load-balancing OOTB

Correlation

Correlation typesContent-based correlation

Protocol correlation

123

123

Page 25: Alex Chan, Product Unit Manager Microsoft®download.microsoft.com/documents/hk/technet/techdays2009/DEV3… · Recover from host failures Scale with in-flight load-balancing OOTB

Messaging and Correlation

Page 26: Alex Chan, Product Unit Manager Microsoft®download.microsoft.com/documents/hk/technet/techdays2009/DEV3… · Recover from host failures Scale with in-flight load-balancing OOTB

Agenda

WF 4.0 Basics

WF 4.0 Advanced

Tracking

Messaging and Correlation

Persistence

Custom Activities and Activity DesignersSummary

Page 27: Alex Chan, Product Unit Manager Microsoft®download.microsoft.com/documents/hk/technet/techdays2009/DEV3… · Recover from host failures Scale with in-flight load-balancing OOTB

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

Page 28: Alex Chan, Product Unit Manager Microsoft®download.microsoft.com/documents/hk/technet/techdays2009/DEV3… · Recover from host failures Scale with in-flight load-balancing OOTB

Agenda

WF 4.0 Basics

WF 4.0 Advanced

Tracking

Messaging and Correlation

Persistence

Custom Activities and Activity DesignersSummary

Page 29: Alex Chan, Product Unit Manager Microsoft®download.microsoft.com/documents/hk/technet/techdays2009/DEV3… · Recover from host failures Scale with in-flight load-balancing OOTB

Activity Hierarchy

Activity

CodeActivity

AsyncCodeActivity

ActivityWithResult

NativeActivity

DynamicActivity

Activity<TResult>

CodeActivity<TResult>

AsyncCodeActivity<TResult>

NativeActivity<TResult>

DynamicActivity<TResult>

Page 30: Alex Chan, Product Unit Manager Microsoft®download.microsoft.com/documents/hk/technet/techdays2009/DEV3… · Recover from host failures Scale with in-flight load-balancing OOTB

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

Page 31: Alex Chan, Product Unit Manager Microsoft®download.microsoft.com/documents/hk/technet/techdays2009/DEV3… · Recover from host failures Scale with in-flight load-balancing OOTB

Agenda

WF 4.0 Basics

WF 4.0 Advanced

Tracking

Messaging and Correlation

Persistence

Custom Activities and Activity DesignersSummary

Page 32: Alex Chan, Product Unit Manager Microsoft®download.microsoft.com/documents/hk/technet/techdays2009/DEV3… · Recover from host failures Scale with in-flight load-balancing OOTB

Summary

Changes in WF 4.0

XAML-only modelEnhanced baseactivity library

Simplified programming

model

Simplifieddata flow

Runtime/designer improvements

Performance improvements

Page 33: Alex Chan, Product Unit Manager Microsoft®download.microsoft.com/documents/hk/technet/techdays2009/DEV3… · Recover from host failures Scale with in-flight load-balancing OOTB

Summary

What is WF:Activities

Runtime

Tooling

Why WF:Create scalable, long running processes

Application transparency and flexibility

Great customizable visual experience

Page 34: Alex Chan, Product Unit Manager Microsoft®download.microsoft.com/documents/hk/technet/techdays2009/DEV3… · Recover from host failures Scale with in-flight load-balancing OOTB

http://microsoft.com/technet

Resources for IT Professionals

http://microsoft.com/msdn

Resources for Developers

www.microsoft.com/learning

Microsoft Certification & Training Resources

Resources

Page 35: Alex Chan, Product Unit Manager Microsoft®download.microsoft.com/documents/hk/technet/techdays2009/DEV3… · Recover from host failures Scale with in-flight load-balancing OOTB

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