Windows Workflow Foundation

40
Introduction to Windows Workflow Foundation Andrei Oros

Transcript of Windows Workflow Foundation

Page 1: Windows Workflow Foundation

Introduction to Windows Workflow FoundationAndrei Oros

Page 2: Windows Workflow Foundation

Andrei OrosCTO - Flowster Solutions [email protected]

Computer Science EngineerMaster - Strategic Management

Page 3: Windows Workflow Foundation

Agenda

OverviewScenariosTechnologyDemo

Page 4: Windows Workflow Foundation

What is Windows Workflow Foundation ?

Page 5: Windows Workflow Foundation

• Human Workflows• Application Workflows• Enterprise Integration Work-

flows• Data Integration Workflows...

Windows Workflow Foundation (WWF).NET technology for defining, designing, host-ing & running processes as workflows

.NET 4.5

.NET 3.5

.NET 3

.NET 4.6

.NET 4

WF 3x

WF 4, interop 3x

major improve-ments

minor updates

Page 6: Windows Workflow Foundation

.NET 4• Re-Architecture of Core Model,

Runtime, Hosting, Integration, Tool-ing

• Great Performance improvements• Designer rehosting made easier• Limited Compatibility with WF 3x

(Interop)

WWF 4x highlights.NET 4.5Designer improvements • Usability - designing, naviga-

tion• Annotations - activities, vars,

args• C# expressions supportNew ActivitiesState MachineWorkflow ServicesVersioning• Workflow Identity• Dynamic Update

.NET 4.6• small update - resume timeout in-

terval for non-protocol bookmarks

Page 7: Windows Workflow Foundation

History2006 - present

Page 8: Windows Workflow Foundation

WWF vs BizTalk ServerVisual Studio

Windows WorkflowFoundation

.NET 3

WWF <-> .NET 3

BTS R2 - WWF & WCFInterceptors

BTS Extensions WWF SDK (2007)btsSend & btsRe-ceive

BizTalk Server 2006

Orchestration

Design Tools

Messaging

WF SDK & Intercep-tors

...

Page 9: Windows Workflow Foundation

WF 4x, interop 3.5, 3

WF 3.5, 3

WF 3

Page 10: Windows Workflow Foundation

When should we use WWF ?Scenarios• Long Running Business Logic• Stateful Processes• Often Changing Logic• Transparency of Process & Execution• Business Process Management Engines• Integration - Middleware Layer• Automation *...

Examples• Banking - credit req. • HR - on/off boarding• Purchasing - Orders• Document Management• IT Operations & Infrastruc-

ture Management...

Page 11: Windows Workflow Foundation

Technology

Page 12: Windows Workflow Foundation

Windows Workflow FoundationWorkflow

Runtime

Hosting

Tooling

Activity LibraryActivi-tiesWF Logic

Visual Studio Rehosted Designer PS Script Editors

Ext.TrackingPersis-

tence

...

WorkflowService-Host

* WF Man-ager

WorkflowApplica-tion

WF In-vokerPersistence

Definitions

Data Stores

Logs

WF App WF Svc

...

Page 13: Windows Workflow Foundation

Workflow Types

Page 14: Windows Workflow Foundation

Sequential Workflow• intuitive• linear logic• loops (while, foreach)• no "goto"

Page 15: Windows Workflow Foundation

Flowchart Workflow• very intuitive• flow chart logic• loops• "goto" possible

Page 16: Windows Workflow Foundation

State Machine Workflow• easy to model• state transitions + events • triggers

Page 17: Windows Workflow Foundation

Workflow Authorship

Page 18: Windows Workflow Foundation

Visual Studio

Page 19: Windows Workflow Foundation

Rehosted Workflow DesignerEasy to Implement

• Designer• Activities Toolbox• Activity Properties• Runtime• Output• Custom Tracking...

Page 20: Windows Workflow Foundation

Code

Page 21: Windows Workflow Foundation

Declarative XAMLSystem.Activities.XamlInte-gration

contains classes that provide support for the serialization of activities into XAML

Page 22: Windows Workflow Foundation

Declarative XAML <-> Code

Page 23: Windows Workflow Foundation

Powershell WFPS v3Workflow

Parallel

Foreach –parallel

Sequence

InlineScript

Checkpoint-workflow

Suspend-workflow

Page 24: Windows Workflow Foundation

Powershell WF - Azure AutomationRunbooks - SMA

Powershell Workflow Windows PS Workflow text runbook

GraphicalPowershell Workflow based - managed exclusively in Azure Portal GUI.

Powershell Windows PS Script text runbook

TechNet Gallery 130+ ex-amples

Page 25: Windows Workflow Foundation

Workflow Activities & Activity Libraries

Page 26: Windows Workflow Foundation

WWF Activity LibrariesCustom

Activity base classCodeActivity execute, tracking, variables &

argsNativeActivity + abort/cancel exec, bookmarks,

..DynamicActivity DOM like -

IcustomTypeDescriptor

Page 27: Windows Workflow Foundation

WWF Custom Activity

Page 28: Windows Workflow Foundation

WF Runtime & HostingWorkflow ManagerAzure Logic Apps*nix

Page 29: Windows Workflow Foundation

Workflow Runtime & HostingWorkflowIn-

vokerWorkflowAppli-

cationWorkflowSer-

vicesSimple ScenariosNo HostingShort Lived WFs

No Instance Con-trolNo PersistenceNo Bookmarks

Long Running WFsSingle InstanceHosting

Instance ControlPersistenceBookmarks(Un)Loading

Long Running WFsMultiple InstancesWorkflowService-Host

Instance ControlPersistenceBookmarksService Messaging

.NETFrame-

work

Page 30: Windows Workflow Foundation

Workflow Execution Logs & Output

Tracking RecordsCustom tracking participant Result - Output(s)

Page 31: Windows Workflow Foundation

Workflow PersistencyData Stores

WorkflowIdentityDefinition <-> In-stance

ScalabilityVerticalHorizontal*Persistence

Page 32: Windows Workflow Foundation

Workflow Manager Authoring, Hosting & Management• Azure & On Premise• REST Endpoint & Client API• Multi-tenancy (Scopes) & Scaling• Management (DB Stores)• Tracking and Monitoring• Instance Management• Fully Declarative Authoring

Custom Solution

Page 33: Windows Workflow Foundation

WWF & Azure Logic Apps• 2015 Q1• JSON Definition

Language• Visual Designer

in Web Browser• Azure only, no

On-Premise version

Page 34: Windows Workflow Foundation

What about *nix ?

OLIVE - experimental / incubation moduleWF 3.5 - inactive | WF4 - no timeline

HostRuntimeWorkflowActivity

SSH SVC

Page 35: Windows Workflow Foundation

Demo. Rehosted Workflow Designer

Page 36: Windows Workflow Foundation
Page 37: Windows Workflow Foundation

Conclusions

Page 38: Windows Workflow Foundation

* Powerful Workflow Platform* Enterprise Level* Full Featured, Flexible* Easy to Integrate & Extend* Supported

Questions ?

Page 39: Windows Workflow Foundation

Reference / LinksWindows Workflow Foundationhttps://msdn.microsoft.com/en-us/vstudio/jj684582.aspx

What's new in WF 4.5https://msdn.microsoft.com/en-us/library/hh305677.aspx

A Developer's Introduction to WWFhttps://msdn.microsoft.com/en-us/library/ee342461.aspx

Workflow Managerhttps://msdn.microsoft.com/en-us/library/jj193504(v=azure.10).aspx

Powershell Workflows & Azure Automationhttps://azure.microsoft.com/en-us/documentation/articles/automation-graphical-authoring-intro/

WF 4x Code Sampleshttp://www.microsoft.com/en-us/download/details.aspx?id=21459

Rehosting the Workflow Designerhttps://github.com/orosandrei/Rehosted-Workflow-Designer

Page 40: Windows Workflow Foundation

Thank you.Andrei Oros

[email protected]/in/orosandrei@orosandrei