Wrestling with Windows Workflow Foundation Simon Thurman Jeremy Stimson
Dec 24, 2015
Objectives
• Workflow Concepts
• Impact on Application Architecture
• Demonstrate through Technology
What Is a Workflow?
A set of A set of activitiesactivities that coordinate that coordinate peoplepeople
and / or software ...and / or software ...EscalateToManagerExample activities … Example activities … CheckInventory
Like a flowchart … Like a flowchart …
……organised into a organised into a workflowworkflow..
Or a state diagram ... Or a state diagram ...
Workflow Scenario Spectrum
• Participants: people, roles
• Flow style: flexible, dynamic
• Data: unstructured, documents
• Participants: apps, services
• Flow style: prescriptive, protocols
• Data: structured, transactional
Information Worker• Document Review …Information Worker• Document Review …
System WorkflowSystem WorkflowHuman WorkflowHuman
Workflow
Windows Workflow Foundation
Business to Business• Supply Chain Mgmt …Business to Business
• Supply Chain Mgmt …
Line of Business Apps• Quote to Cash, Sales Automation …
Line of Business Apps• Quote to Cash, Sales Automation …CRM ERP
IT Management• New Hire Provisioning, Trouble Ticket …
IT Management• New Hire Provisioning, Trouble Ticket …
.NET Developer• Pageflow, Service Coordination …
.NET Developer• Pageflow, Service Coordination …
Why Workflow Technology?
Long running and stateful behaviour
Transparency
Flexible control flow
Architectural AbstractionsArchitectural Abstractions
Workflows technology provides abstractions
convenient to describe real-world workflows
Workflow Technology Value-AddWorkflow Technology Value-Add
Windows Workflow Foundation
• Single workflow technology for Microsoft products, partners and customers• A framework to build on – not a server or application
• Key features• Enables long running workflows in any application or server
• Extensible activity framework
• Unified model for human and system workflow scenarios
• Visual designer for graphical and code-based authoring
• Availability• Exposed via WinFX – powers Office ‘12’ workflow
Extensible framework and tools for building workflow into Windows applications
WF Runtime Engine and Services
Host Process
Windows Workflow Foundation
WF Base Activity Library
My custom workflow
Runtime Services: pluggable implementations with defaults
Persistence Communication Tracking …
Runtime Engine: provides intrinsic behaviours to activities
TrackingInfrastructure
State Management
WorkflowExecution
DynamicUpdate
When Do You Write Custom Activities?
• Out-of-the-box Activities get you started …
• Write custom activities for• modelling advanced control flows
• modelling various workflow styles
• integrating with technologies
• aligning with standards
• Out-of-the-box activities built using the same framework that’s available to developers
Why Rules?
Modelling PowerModelling Power
ApproachabilityApproachability
Ease of ChangeEase of Change
Workflow Rules
• Conditions on activities• If-Else
• While
• Replicator
• Conditioned Activity Group (CAG)
• <Your custom activity>
• Policy activity• Contains and executes a RuleSet
• RuleSet execution provides priority-based, forward-chaining semantics
Model-driven development
Model-driven developmentRules and Application Development
FormsForms
DataData
ApplicationApplicationlogiclogic
Rules andRules andpoliciespolicies
ApplicationApplicationcodecode
Workflow Workflow modelmodel
ServiceServicess
Flexible Control Flow
Rules-driven Activities
Step2
Step1Rule1Rule1
Rule2Rule2
DataRules + data statedrive processing order
•Data-driven•Simple conditions, complex policies •Constrained Activity Group
State Machine Workflow
State2
State1EventEvent
EventEvent
External events drive processingorder
•Reactive, event-driven•Skip/re-work, exception handling•Graph metaphor
Sequential WorkflowStep1
Step2
Sequentialstructure prescribesprocessing order
•Prescriptive, formal•Automation scenarios•Flowchart metaphor
WinFXWinFX
Workflow and BizTalk Server
Windows Windows Workflow Workflow
FoundationFoundation
MessagingMessagingDesigDesig
nnToolsTools
BusineBusinessss
ActivityActivityMonitoMonito
rrandand
AdminAdminToolsTools
OrchestratioOrchestrationn
TransformatiTransformationon
AdaptersAdapters
BizTalk ServerAcceleratorsAccelerators
• Premium BPM serverPremium BPM server• Distinct server productDistinct server product• Use in B2B, EAI, BPM scenariosUse in B2B, EAI, BPM scenarios• Deployable solutionsDeployable solutions• Manageability, scale-outManageability, scale-out
• Workflow frameworkWorkflow framework• Exposed via WinFX Exposed via WinFX • Broad set of scenarios Broad set of scenarios • Used to build solutionsUsed to build solutions• Enables manageabilityEnables manageabilityand scale-out in solutionsand scale-out in solutions• Use for building workflow Use for building workflow into apps or workflow-enabled into apps or workflow-enabled serversservers
Visual Studio DesignerVisual Studio Designer
• Future version will migrate to Future version will migrate to Windows Workflow Foundation Windows Workflow Foundation for orchestrationfor orchestration
WorkflowWorkflow
Office Workflow Vision
Facilitate human processes by attaching business logic to items and documents in Windows SharePoint Services, while providing
context and tracking progress
Empower information workers using Office Server with out-of-the-box solutions and self-service tools to support a broad range of
routing & tracking scenarios without IT involvement
Empower organisations to build a broad range of sophisticated workflow solutions that take advantage of the full functionality of
the Windows Workflow Foundation (WWF) platform and integrate into the SharePoint and Office experiences
Visual Studio & Workflow SDKVisual Studio & Workflow SDK
Out-of-the-BoxOut-of-the-BoxSolutionsSolutions
(with customisation)(with customisation)
FrontPage FrontPage WorkflowWorkflow
Routing & ApprovalRouting & Approval
Tracking ApplicationsTracking Applications
List ModerationList Moderation
Document ExpirationDocument Expiration
Pro
fessio
nal D
evelo
per
Pro
fessio
nal D
evelo
per
En
d U
ser
En
d U
ser
Custom Tracking AppsCustom Tracking Apps
Document ProcessesDocument Processes
Custom Form ActionsCustom Form Actions
LOB LOB IntegrationIntegration
Industry-specific Industry-specific ProcessesProcesses
Authoring Scenario Pyramid