38

Ten Architectural Opportunities for Workflow John Evdemon Architect Microsoft Corporation

Embed Size (px)

DESCRIPTION

Session Objectives And Key Takeaways Session Objective: Awareness of workflow’s role in common architectural challenges Provide some tool-specific guidance Key Takeaways: Workflow improves agility WF and BizTalk Server WF and WCF BPEL Strategy

Citation preview

Page 1: Ten Architectural Opportunities for Workflow John Evdemon Architect Microsoft Corporation
Page 2: Ten Architectural Opportunities for Workflow John Evdemon Architect Microsoft Corporation

Ten Architectural Opportunities for Workflow

John EvdemonArchitectMicrosoft Corporation

Page 3: Ten Architectural Opportunities for Workflow John Evdemon Architect Microsoft Corporation

Session Objectives And Key Takeaways

Session Objective: Awareness of workflow’s role in common architectural challengesProvide some tool-specific guidance

Key Takeaways:Workflow improves agilityWF and BizTalk ServerWF and WCFBPEL Strategy

Page 4: Ten Architectural Opportunities for Workflow John Evdemon Architect Microsoft Corporation

AssumptionsFamiliarity with Windows Workflow Foundation

Familiarity with BizTalk Server

Page 5: Ten Architectural Opportunities for Workflow John Evdemon Architect Microsoft Corporation

FactMyth

WF and BizTalk are not competing technologies

Clarification: WF and BizTalk

WF and BizTalk are complementary technologies that serve different needs:

WF is a developer framework, workflow within an application

BizTalk Server is a product, implement workflow across disparate applications

WF is a replacement for BizTalk

Page 6: Ten Architectural Opportunities for Workflow John Evdemon Architect Microsoft Corporation

Ten Architectural OpportunitiesIn no special order…1. Transactions

2. High frequency of change3. Business Rules4. Large data set in flow5. Web services6. Process Externalization7. Long Running Processes8. Auditing and analytics9. Human intervention 10. UI Flow

Page 7: Ten Architectural Opportunities for Workflow John Evdemon Architect Microsoft Corporation

1. TransactionsBizTalk

Three Transaction TypesNoneAtomic (Short-Lived)Long-Running

Transaction Type defined within

Entire orchestration (global)Scope shape

Orchestration to be long running or atomicException handling and compensation blocks

Long-Running

Scope

Loan application received

Request Credit Report

Order Appraisal

Sign Documents

Page 8: Ten Architectural Opportunities for Workflow John Evdemon Architect Microsoft Corporation

1. TransactionsWF

Scope properties:Atomic TransactionLong-Running

Atomic transactions Persistence at end of Commit Roll back to last known state of workflowCannot be nestedException handlers not permitted

Long-Running Processes May contain atomic or other Long-Running ProcessesMay be nested to arbitrary depths

Long-Running

Atomic Transaction

Loan application received

Request Credit Report

Order Appraisal

Sign Documents

Page 9: Ten Architectural Opportunities for Workflow John Evdemon Architect Microsoft Corporation

Ten Architectural OpportunitiesIn no special order…1. Transactions

2. High frequency of change3. Business Rules4. Large data set in flow5. Web services6. Process Externalization7. Long Running Processes8. Auditing and analytics9. Human intervention 10. UI Flow

Page 10: Ten Architectural Opportunities for Workflow John Evdemon Architect Microsoft Corporation

2. High Frequency of ChangeBizTalkBusiness RulesBizTalk Server 2006 Orchestration Designer for Business Analysts (Visio)

Windows Workflow FoundationBusiness RulesEmbeddable design surface

Business process analysts need a different class of modeling tools

PartnersStandalone DSL toolkits for business process design

Page 11: Ten Architectural Opportunities for Workflow John Evdemon Architect Microsoft Corporation

Ten Architectural OpportunitiesIn no special order…1. Transactions

2. High frequency of change3. Business Rules4. Large data set in flow5. Web services6. Process Externalization7. Long Running Processes8. Auditing and analytics9. Human intervention 10. UI Flow

Page 12: Ten Architectural Opportunities for Workflow John Evdemon Architect Microsoft Corporation

BizTalk Rules and Orchestration Patterns

Call Rules Engine to execute logic, instead of burying it in code

Call Rules Engine and determine path

Call Rules Engine to dynamically populate messaging routing information

Use the Rules Engine for dynamic or variable delays

3. Business Rules

Page 13: Ten Architectural Opportunities for Workflow John Evdemon Architect Microsoft Corporation

WF: Two CategoriesConditions on activities

If-ElseWhileReplicator (for-each)Conditioned Activity Group (CAG)<custom activity>

Policy activityContains and executes a RuleSetRuleSet execution provides priority-based, forward-chaining semantics RuleSet execution outside of a workflow

3. Business Rules

Page 14: Ten Architectural Opportunities for Workflow John Evdemon Architect Microsoft Corporation

3. Business RulesWindows Workflow Foundation will provide the core rules engine evaluator and developer tools in BizTalk v.Next

BizTalk will continue to provide premium tooling and server infrastructure, e.g.:

Business analyst toolsRuleSet storage and managementRuleSet analysis

Page 15: Ten Architectural Opportunities for Workflow John Evdemon Architect Microsoft Corporation

Ten Architectural OpportunitiesIn no special order…1. Transactions

2. High frequency of change3. Business Rules4. Large data set in flow5. Web services6. Process Externalization7. Long Running Processes8. Auditing and analytics9. Human intervention 10. UI Flow

Page 16: Ten Architectural Opportunities for Workflow John Evdemon Architect Microsoft Corporation

Beware of CDATA wrappers!BizTalk Disassembler and Assembler stream data using XmlReader

Entire string must be read into memory to process it

Recommendations:Keep your messages small, if possibleBTS 2004: Avoid the mapper for large XML messages or flat files BTS 2006: Large Message Transformation engineAvoid large message scenarios that require anything more than routing

4. Large data set in flowBizTalk

Page 17: Ten Architectural Opportunities for Workflow John Evdemon Architect Microsoft Corporation

4. Large data set in flowWF

WF is far less complex

Keep pointers to messages stored in a database or filesystem for messages larger than what you would want to keep in RAM

Page 18: Ten Architectural Opportunities for Workflow John Evdemon Architect Microsoft Corporation

Ten Architectural OpportunitiesIn no special order…1. Transactions

2. High frequency of change3. Business Rules4. Large data set in flow5. Web services6. Process Externalization7. Long Running Processes8. Auditing and analytics9. Human intervention 10. UI Flow

Page 19: Ten Architectural Opportunities for Workflow John Evdemon Architect Microsoft Corporation

5. Web ServicesCoordinating ServicesCoordinating Services

Message

Message

Workflows exposedWorkflows exposedthrough servicesthrough services

Message

WorkflowWorkflow

Message

Message

Message

Page 20: Ten Architectural Opportunities for Workflow John Evdemon Architect Microsoft Corporation

WF and ASMX Web Services

WF and WCF (prototype)

Page 21: Ten Architectural Opportunities for Workflow John Evdemon Architect Microsoft Corporation

Worth a look…Service Activity Generator

http://www.gotdotnet.com/workspaces/workspace.aspx?id=dd88e6eb-e889-4ed5-bc98-2e4e62953629Easier to remember:

http://tinyurl.com/ffq2z

Reads in a WCF service contact and generates a set of custom activities to consume the service.  

It does not support receiving messages in workflows

Page 22: Ten Architectural Opportunities for Workflow John Evdemon Architect Microsoft Corporation

Ten Architectural OpportunitiesIn no special order…1. Transactions

2. High frequency of change3. Business Rules4. Large data set in flow5. Web services6. Process Externalization7. Long Running Processes8. Auditing and analytics9. Human intervention 10. UI Flow

Page 23: Ten Architectural Opportunities for Workflow John Evdemon Architect Microsoft Corporation

6. Process ExternalizationWorkflow Interop

Businesses orchestrate their private processesChoreography represents publicly observable behavior Organization B

Private Processes(Executable)

Public Process(Abstract)

Organization A

Private Processes(Executable)

Send PO

AckPO

POAccepted

POResponse

Page 24: Ten Architectural Opportunities for Workflow John Evdemon Architect Microsoft Corporation

Import/export support in BizTalk 2004 and BizTalk 2006

BPEL 1.1 activities under development for Windows Workflow Foundation

Multiple workflow industry standards can be supported by WF

BPEL, XPDL, BPMN, others…

6. Process ExternalizationWorkflow Interop: BPEL

Page 25: Ten Architectural Opportunities for Workflow John Evdemon Architect Microsoft Corporation

Ten Architectural OpportunitiesIn no special order…1. Transactions

2. High frequency of change3. Business Rules4. Large data set in flow5. Web services6. Process Externalization7. Long Running Processes8. Auditing and analytics9. Human intervention 10. UI Flow

Page 26: Ten Architectural Opportunities for Workflow John Evdemon Architect Microsoft Corporation

7. Long Running ProcessesWF

Runtime services dehydrate/rehydrate the workflow

Set UnloadOnIdle prior to starting the workflowCode or config

WF does not impose a specific persistence service.

Define/customize your persistence architecture for specific types of hosts

Other runtime services:TrackingTransactionsThreading

Host Process

WindowsWorkflow Foundation

Runtime Engine

WorkflowActivity

Runtime Services

Base Activity Library

Custom Activity Library

Visual Designer

Page 27: Ten Architectural Opportunities for Workflow John Evdemon Architect Microsoft Corporation

Ten Architectural OpportunitiesIn no special order…1. Transactions

2. High frequency of change3. Business Rules4. Large data set in flow5. Web services6. Process Externalization7. Long Running Processes8. Auditing and analytics9. Human intervention 10. UI Flow

Page 28: Ten Architectural Opportunities for Workflow John Evdemon Architect Microsoft Corporation

How many units are waiting to be shipped right now?

What is the total value of my finished goods inventory today?

How much does it cost to produce one unit today?

What is the average throughput time for special orders right now? BizTalk Server

2004/2006 Engine

Tracking

Monitored Events and Messages

Excel Other Clients

Business Activity Monitoring (BAM)

8. Auditing and analyticsBizTalk

Page 29: Ten Architectural Opportunities for Workflow John Evdemon Architect Microsoft Corporation

No BAM components here

Roll your own via WF TrackingTrack history of instance execution (running/suspended/terminated)Predict execution paths of future instancesCounters for KPI calculationsLog data, events and instances

Recognize limitations

8. Auditing and analyticsWF

Page 30: Ten Architectural Opportunities for Workflow John Evdemon Architect Microsoft Corporation

Ten Architectural OpportunitiesIn no special order…1. Transactions

2. High frequency of change3. Business Rules4. Large data set in flow5. Web services6. Process Externalization7. Long Running Processes8. Auditing and analytics9. Human intervention 10. UI Flow

Page 31: Ten Architectural Opportunities for Workflow John Evdemon Architect Microsoft Corporation

9. Human InterventionBizTalk

BTS2004: Human Workflow Services (HWS)HWS is deprecated in BTS2006

Use BizTalk with WF instead

Partners

Office 2007 Windows SPS Adapter for SharePoint

Page 32: Ten Architectural Opportunities for Workflow John Evdemon Architect Microsoft Corporation

Ten Architectural OpportunitiesIn no special order…1. Transactions

2. High frequency of change3. Business Rules4. Large data set in flow5. Web services6. Process Externalization7. Long Running Processes8. Auditing and analytics9. Human intervention 10. UI Flow

Page 33: Ten Architectural Opportunities for Workflow John Evdemon Architect Microsoft Corporation

Workflow traps UI events Workflow state drives the user experience

See WF State Machine sample

10.UI FlowWinForms (control flow)

Page 34: Ten Architectural Opportunities for Workflow John Evdemon Architect Microsoft Corporation

“Smart Parts”

10.UI FlowComposite UI Application Block

Page 35: Ten Architectural Opportunities for Workflow John Evdemon Architect Microsoft Corporation

10.UI Flow Page Flow in ASP.NET

Determine which page to serve up based upon state of the workflow Configure WorkflowWebHostingModule (HTTP Module) in Web.Config

Start workflow runtime and instanceCommunications between workflow and controller

Samples at www.windowsworkflow.netASP.NET team working on integration of WF into web projects

Page 36: Ten Architectural Opportunities for Workflow John Evdemon Architect Microsoft Corporation

Ten Architectural Opportunities1. Transactions

2. High frequency of change3. Business Rules4. Large data set in flow5. Web services6. Process Externalization7. Long Running Processes8. Auditing and analytics9. Human intervention 10.UI Flow

Page 37: Ten Architectural Opportunities for Workflow John Evdemon Architect Microsoft Corporation

A Workflow ManifestoWorkflow is everywhere

Workflow is expressive

Workflow is fluid

Workflow is inclusive

Workflow is transparent

Page 38: Ten Architectural Opportunities for Workflow John Evdemon Architect Microsoft Corporation

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