Windows Workflow Foundation Mike Taulty Developer & Platform Group Microsoft Ltd...

33
Windows Workflow Foundation Windows Workflow Foundation Mike Taulty Mike Taulty Developer & Platform Group Developer & Platform Group Microsoft Ltd Microsoft Ltd [email protected] [email protected] http://mtaulty.com

Transcript of Windows Workflow Foundation Mike Taulty Developer & Platform Group Microsoft Ltd...

Page 1: Windows Workflow Foundation Mike Taulty Developer & Platform Group Microsoft Ltd Mike.Taulty@microsoft.com .

Windows Workflow FoundationWindows Workflow Foundation

Mike TaultyMike Taulty

Developer & Platform GroupDeveloper & Platform Group

Microsoft LtdMicrosoft Ltd

[email protected] [email protected]

http://mtaulty.com

Page 2: Windows Workflow Foundation Mike Taulty Developer & Platform Group Microsoft Ltd Mike.Taulty@microsoft.com .

Intro: WinFXIntro: WinFX

Page 3: Windows Workflow Foundation Mike Taulty Developer & Platform Group Microsoft Ltd Mike.Taulty@microsoft.com .

What’s WinFX?What’s WinFX?What’s WinFX?What’s WinFX?

Managed API for the Windows platformManaged API for the Windows platform

Extends the .NET Framework V2.0Extends the .NET Framework V2.0

First ships at the time of Windows Vista (2006)First ships at the time of Windows Vista (2006)

Included in Windows VistaIncluded in Windows Vista

Available on Windows XP Sp 2 and Server 2003Available on Windows XP Sp 2 and Server 2003

Following a Community Technology Preview CycleFollowing a Community Technology Preview Cycle

Latest is the February CTPLatest is the February CTP

Page 4: Windows Workflow Foundation Mike Taulty Developer & Platform Group Microsoft Ltd Mike.Taulty@microsoft.com .

Intro: Windows Workflow FoundationIntro: Windows Workflow Foundation

Page 5: Windows Workflow Foundation Mike Taulty Developer & Platform Group Microsoft Ltd Mike.Taulty@microsoft.com .

Windows Workflow FoundationWindows Workflow Foundation

Single Single frameworkframework for Workflow on Windows for Workflow on Windows

ExtensibleExtensible

Both human and system WorkflowBoth human and system Workflow

Supports long-running and stateful WorkflowsSupports long-running and stateful Workflows

Page 6: Windows Workflow Foundation Mike Taulty Developer & Platform Group Microsoft Ltd Mike.Taulty@microsoft.com .

Activies – Workflow Building BlocksActivies – Workflow Building Blocks

Activities are classesActivities are classes

Basic Activities or Composite ActivitiesBasic Activities or Composite Activities

A A workflowworkflow is a composite activity is a composite activity

public string SourceFile;

public string DestFile;

override Execute()

{

File.Copy(SourceFile,

DestFile);

}

Page 7: Windows Workflow Foundation Mike Taulty Developer & Platform Group Microsoft Ltd Mike.Taulty@microsoft.com .

Styles of WorkflowStyles of Workflow

Page 8: Windows Workflow Foundation Mike Taulty Developer & Platform Group Microsoft Ltd Mike.Taulty@microsoft.com .

The Workflow FrameworkThe Workflow Framework(or “What’s in the box?”)(or “What’s in the box?”)

Runtime DesignerBase

Activities

Runtime

Services

Page 9: Windows Workflow Foundation Mike Taulty Developer & Platform Group Microsoft Ltd Mike.Taulty@microsoft.com .

Framework:Framework: Workflow Runtime Workflow Runtime

Page 10: Windows Workflow Foundation Mike Taulty Developer & Platform Group Microsoft Ltd Mike.Taulty@microsoft.com .

DemoDemo

Framework:Framework: Hosting the RuntimeHosting the Runtime

Page 11: Windows Workflow Foundation Mike Taulty Developer & Platform Group Microsoft Ltd Mike.Taulty@microsoft.com .

Framework:Framework: Workflow Designer Workflow Designer

Hosted in Visual Studio 2005Hosted in Visual Studio 2005

Hosted in your application for end-usersHosted in your application for end-users

Supports theming in both VS and non-VS Supports theming in both VS and non-VS environmentsenvironments

Page 12: Windows Workflow Foundation Mike Taulty Developer & Platform Group Microsoft Ltd Mike.Taulty@microsoft.com .

DemoDemo

Framework:Framework:Using/Hosting the DesignerUsing/Hosting the Designer

Page 13: Windows Workflow Foundation Mike Taulty Developer & Platform Group Microsoft Ltd Mike.Taulty@microsoft.com .

Framework:Framework: Base Activity Library Base Activity Library

Pre-built set of building block activitiesPre-built set of building block activities

CompositeBasic

Page 14: Windows Workflow Foundation Mike Taulty Developer & Platform Group Microsoft Ltd Mike.Taulty@microsoft.com .

DemoDemo

Framework:Framework:Using the Base Activity LibraryUsing the Base Activity Library

Page 15: Windows Workflow Foundation Mike Taulty Developer & Platform Group Microsoft Ltd Mike.Taulty@microsoft.com .

Framework:Framework: Runtime Services Runtime Services

Runtime uses servicesRuntime uses services

PersistencePersistence

SchedulingScheduling

TrackingTracking

TransactionsTransactions

Defaults in the box for Defaults in the box for most servicesmost services

Pluggable – add your Pluggable – add your ownown

Page 16: Windows Workflow Foundation Mike Taulty Developer & Platform Group Microsoft Ltd Mike.Taulty@microsoft.com .

DemoDemo

Framework:Framework:Plugging in Runtime ServicesPlugging in Runtime Services

Page 17: Windows Workflow Foundation Mike Taulty Developer & Platform Group Microsoft Ltd Mike.Taulty@microsoft.com .

Building ActivitiesBuilding Activities

Page 18: Windows Workflow Foundation Mike Taulty Developer & Platform Group Microsoft Ltd Mike.Taulty@microsoft.com .

Activities:Activities: Component Model Component Model

Activity is at the centre of a component modelActivity is at the centre of a component model

Page 19: Windows Workflow Foundation Mike Taulty Developer & Platform Group Microsoft Ltd Mike.Taulty@microsoft.com .

Activities:Activities: Lifecycle Lifecycle

Activities have a lifecycleActivities have a lifecycle

Page 20: Windows Workflow Foundation Mike Taulty Developer & Platform Group Microsoft Ltd Mike.Taulty@microsoft.com .

DemoDemo

Activities:Activities:Building custom activitiesBuilding custom activities

Page 21: Windows Workflow Foundation Mike Taulty Developer & Platform Group Microsoft Ltd Mike.Taulty@microsoft.com .

Other things to know about…Other things to know about…

Page 22: Windows Workflow Foundation Mike Taulty Developer & Platform Group Microsoft Ltd Mike.Taulty@microsoft.com .

Host/Workflow CommunicationHost/Workflow Communication

ILoanNotify{

GetLoanApproval();

event LoanApproved;

}

class Notifier

: ILoanNotify

{

}

Page 23: Windows Workflow Foundation Mike Taulty Developer & Platform Group Microsoft Ltd Mike.Taulty@microsoft.com .

DemoDemo

Host/Workflow CommunicationHost/Workflow Communication

Page 24: Windows Workflow Foundation Mike Taulty Developer & Platform Group Microsoft Ltd Mike.Taulty@microsoft.com .

State Machine WorkflowsState Machine Workflows

StateStart

Wait for X

Wait for Y

Wait for Z

State

State

Wait for A

Wait for B

Terminate

Activity

Activity

Transition

Page 25: Windows Workflow Foundation Mike Taulty Developer & Platform Group Microsoft Ltd Mike.Taulty@microsoft.com .

DemoDemo

State Machine WorkflowsState Machine Workflows

Page 26: Windows Workflow Foundation Mike Taulty Developer & Platform Group Microsoft Ltd Mike.Taulty@microsoft.com .

Applying Rule-Based PoliciesApplying Rule-Based Policies

Data

Policy (RuleSet)

Rule: If PRICE then

Rule: If … then

Rule: If … then

Rule: If … then

Rule: If … then

Priority: 1

Priority: 2

Priority: 3

Priority: 4

Priority: 5

Price: 200

Change

Page 27: Windows Workflow Foundation Mike Taulty Developer & Platform Group Microsoft Ltd Mike.Taulty@microsoft.com .

DemoDemo

Rule based policiesRule based policies

Page 28: Windows Workflow Foundation Mike Taulty Developer & Platform Group Microsoft Ltd Mike.Taulty@microsoft.com .

Transaction

Scope

Book Flight

Working with TransactionsWorking with TransactionsTransaction

Scope

Book Hotel

Error!

Commit happens here

Compensation

Cancel Hotel

Page 29: Windows Workflow Foundation Mike Taulty Developer & Platform Group Microsoft Ltd Mike.Taulty@microsoft.com .

DemoDemo

Working with TransactionsWorking with Transactions

Page 30: Windows Workflow Foundation Mike Taulty Developer & Platform Group Microsoft Ltd Mike.Taulty@microsoft.com .

Modifying Running InstancesModifying Running Instances

Running Workflow Running Workflow instance can be instance can be modifiedmodified

Logic changedLogic changed

Activities Activities added/removedadded/removed

Runtime managedRuntime managed

Change

Page 31: Windows Workflow Foundation Mike Taulty Developer & Platform Group Microsoft Ltd Mike.Taulty@microsoft.com .

DemoDemo

Modifying Workflow InstancesModifying Workflow Instances

Page 32: Windows Workflow Foundation Mike Taulty Developer & Platform Group Microsoft Ltd Mike.Taulty@microsoft.com .

ResourcesResources

MSDN Developer CentreMSDN Developer Centre

http://msdn.microsoft.com/winfxhttp://msdn.microsoft.com/winfx

Windows Workflow SiteWindows Workflow Site

http://www.windowsworkflow.nethttp://www.windowsworkflow.net

UK Community ResourcesUK Community Resources

http://www.roadtowinfx.comhttp://www.roadtowinfx.com

MSDN Nugget VideosMSDN Nugget Videos

http://www.msdn.co.uk/events/nuggets.aspxhttp://www.msdn.co.uk/events/nuggets.aspx

http://mtaulty.com/services/NuggetFeeds.ashx?query= topicshttp://mtaulty.com/services/NuggetFeeds.ashx?query= topics

Page 33: Windows Workflow Foundation Mike Taulty Developer & Platform Group Microsoft Ltd Mike.Taulty@microsoft.com .

© 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.© 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY.MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY.