25
The Total Noob’s Guide Windows Workflow Foundation 4 Ron Jacobs Technical Evangelist Microsoft Corporation http://blogs.msdn.com/rjacobs SESSION CODE: DEV207

Ron Jacobs Technical Evangelist Microsoft Corporation SESSION CODE: DEV207

Embed Size (px)

Citation preview

Page 1: Ron Jacobs Technical Evangelist Microsoft Corporation  SESSION CODE: DEV207

The Total Noob’s Guide Windows Workflow Foundation 4 Ron JacobsTechnical EvangelistMicrosoft Corporationhttp://blogs.msdn.com/rjacobs

SESSION CODE: DEV207

Page 2: Ron Jacobs Technical Evangelist Microsoft Corporation  SESSION CODE: DEV207

Prepare To Shed Your Noob

Hello Workflow

Code Activities

Dynamic Activities

Workflow Application

Control Flow

Robustness

Activity Designers

Hosted Designer

Page 3: Ron Jacobs Technical Evangelist Microsoft Corporation  SESSION CODE: DEV207

Get Ready to Say Helloprivate static void SayHello(){ Console.WriteLine("Hello Workflow 4");}

Page 4: Ron Jacobs Technical Evangelist Microsoft Corporation  SESSION CODE: DEV207

What have we learned?A workflow is a group of activitiesWorkflows can be invoked by WorkflowInvokerExpressions are written in Visual BasicWorkflows appear as .NET objects to other parts of your code

Refactoring tools are not supported with XAMLBackground compile does not work with XAML

Workflows are usually defined in XAMLXAML is stored in the assembly by default

Page 5: Ron Jacobs Technical Evangelist Microsoft Corporation  SESSION CODE: DEV207

Prepare To Shed Your Noob

Hello Workflow

Code Activities

Dynamic Activities

Workflow Application

Control Flow

Robustness

Activity Designers

Hosted Designer

Page 6: Ron Jacobs Technical Evangelist Microsoft Corporation  SESSION CODE: DEV207

What have we learned?CodeActivity allows you to write the code to executeAsyncCodeActivity allows you to do async work safelyActivities use In/Out/InOutArgument<T> to pass dataActivities use Variable<T> to store dataYou must always access data from the contextAsync/CodeActivity<T> declares an OutArgument <T> named resultOverride CacheMetadata for better performanceOverride CacheMetadata to validate your custom activity

Page 7: Ron Jacobs Technical Evangelist Microsoft Corporation  SESSION CODE: DEV207

Prepare To Shed Your Noob

Hello Workflow

Code Activities

Dynamic Activities

Workflow Application

Control Flow

Robustness

Activity Designers

Hosted Designer

Page 8: Ron Jacobs Technical Evangelist Microsoft Corporation  SESSION CODE: DEV207

What have we learned?You can store/load workflows in XAML text streamsYou don’t have to write XAMLSomeday you will have to correct XAML manually

Page 9: Ron Jacobs Technical Evangelist Microsoft Corporation  SESSION CODE: DEV207

Prepare To Shed Your Noob

Hello Workflow

Code Activities

Dynamic Activities

Workflow Application

Control Flow

Robustness

Activity Designers

Hosted Designer

Page 10: Ron Jacobs Technical Evangelist Microsoft Corporation  SESSION CODE: DEV207

What have we learned?WorkflowApplication runs a single workflow instanceUsing WorkflowApplication you can perform the following tasks:

Create a new workflow instance, or load a workflow instance from an instance store.Provide extensions to be used by activities within a workflow instance.Control the execution of a workflow instance.Resume a bookmark created by an activity within a workflow instance.Persist or unload a workflow instance.Be notified of workflow instance lifecycle events.

Page 11: Ron Jacobs Technical Evangelist Microsoft Corporation  SESSION CODE: DEV207

Prepare To Shed Your Noob

Hello Workflow

Code Activities

Dynamic Activities

Workflow Application

Control Flow

Robustness

Activity Designers

Hosted Designer

Page 12: Ron Jacobs Technical Evangelist Microsoft Corporation  SESSION CODE: DEV207

What have we learned?You can control flowFlowChartStateMachine

Page 13: Ron Jacobs Technical Evangelist Microsoft Corporation  SESSION CODE: DEV207

Prepare To Shed Your Noob

Hello Workflow

Code Activities

Dynamic Activities

Workflow Application

Control Flow

Robustness

Activity Designers

Hosted Designer

Page 14: Ron Jacobs Technical Evangelist Microsoft Corporation  SESSION CODE: DEV207

What have we learned?TryCatch (but not Finally )TransactionsCancellationCompensation

Page 15: Ron Jacobs Technical Evangelist Microsoft Corporation  SESSION CODE: DEV207

Prepare To Shed Your Noob

Hello Workflow

Code Activities

Dynamic Activities

Workflow Application

Control Flow

Robustness

Activity Designers

Hosted Designer

Page 16: Ron Jacobs Technical Evangelist Microsoft Corporation  SESSION CODE: DEV207

What have we learned?WorkflowItemPresenterWorkflowItemsPresenterSimple DesignerComposite Designer with Collapse

Page 17: Ron Jacobs Technical Evangelist Microsoft Corporation  SESSION CODE: DEV207

Prepare To Shed Your Noob

Hello Workflow

Code Activities

Dynamic Activities

Workflow Application

Control Flow

Robustness

Activity Designers

Hosted Designer

Page 18: Ron Jacobs Technical Evangelist Microsoft Corporation  SESSION CODE: DEV207

What have we learned?You can host the designerYou can control the design experience

Page 19: Ron Jacobs Technical Evangelist Microsoft Corporation  SESSION CODE: DEV207

Related ContentASI201 | Intro to Workflow Services and Windows Server AppFabricASI203 | Understanding the Microsoft Application Server: AppFabric, WF, WCF, and MoreASI303 | Building Activities to Leverage the Power of Windows Workflow in Microsoft .NET Framework 4ASI02-INT | Real-World Microsoft .NET Framework 4: How ADERANT Expert Leverages WF 4, WCF 4 and Windows Server AppFabric

Page 20: Ron Jacobs Technical Evangelist Microsoft Corporation  SESSION CODE: DEV207

Track ResourcesVisual Studio – http://www.microsoft.com/visualstudio/en-us/Soma’s Blog – http://blogs.msdn.com/b/somasegar/ MSDN Data Developer Center – http://msdn.com/data ADO.NET Team Blog – http://blogs.msdn.com/adonet WCF Data Services Team Blog – http://blogs.msdn.com/astoriateam EF Design Blog – http://blogs.msdn.com/efdesign

Page 21: Ron Jacobs Technical Evangelist Microsoft Corporation  SESSION CODE: DEV207

Resources

www.microsoft.com/teched

Sessions On-Demand & Community Microsoft Certification & Training Resources

Resources for IT Professionals Resources for Developers

www.microsoft.com/learning

http://microsoft.com/technet http://microsoft.com/msdn

Learning

Page 22: Ron Jacobs Technical Evangelist Microsoft Corporation  SESSION CODE: DEV207

Complete an evaluation on CommNet and enter to win!

Page 23: Ron Jacobs Technical Evangelist Microsoft Corporation  SESSION CODE: DEV207

Sign up for Tech·Ed 2011 and save $500 starting June 8 – June 31st

http://northamerica.msteched.com/registration

You can also register at the

North America 2011 kiosk located at registrationJoin us in Atlanta next year

Page 24: Ron Jacobs Technical Evangelist Microsoft Corporation  SESSION CODE: DEV207

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

Page 25: Ron Jacobs Technical Evangelist Microsoft Corporation  SESSION CODE: DEV207

JUNE 7-10, 2010 | NEW ORLEANS, LA