25
Windows Workflow Windows Workflow Foundation Foundation Workflow in jouw Workflow in jouw applicatie applicatie Dennis Mulder – Avanade Dennis Mulder – Avanade [email protected]

Windows Workflow Foundation Workflow in jouw applicatie Dennis Mulder – Avanade [email protected]

Embed Size (px)

Citation preview

Page 1: Windows Workflow Foundation Workflow in jouw applicatie Dennis Mulder – Avanade dennism@avanade.com

Windows Workflow FoundationWindows Workflow Foundation Workflow in jouw applicatieWorkflow in jouw applicatie

Dennis Mulder – AvanadeDennis Mulder – Avanade

[email protected]

Page 2: Windows Workflow Foundation Workflow in jouw applicatie Dennis Mulder – Avanade dennism@avanade.com

Agenda

Hoe werkt het?

Waarom workflow?

Workflow features

Beschikbaarheid & samenvatting

Page 3: Windows Workflow Foundation Workflow in jouw applicatie Dennis Mulder – Avanade dennism@avanade.com

geeft inzicht in de business

geeft mogelijkheden tot monitoring

Workflow ondersteunt ons om eenvoudiger workflow toe te voegen

Workflow Technologie voegt waarde en…Workflow Technologie voegt waarde en…

ProductiviteitProductiviteit

geeft mogelijkheden tot verbetering

Waarom Workflow?

Page 4: Windows Workflow Foundation Workflow in jouw applicatie Dennis Mulder – Avanade dennism@avanade.com

Waarom workflow technologie?

““Bestellingen worden Bestellingen worden bevestigd binnen 48 bevestigd binnen 48

uur en verstuurd uur en verstuurd binnen 5 dagen.”binnen 5 dagen.”

““De meeste De meeste toeleveranciers toeleveranciers

bevestigen bestelling bevestigen bestelling en vergeten te en vergeten te

leveren.”leveren.”““Wat zijn de Wat zijn de

volgende stappen in volgende stappen in deze workflow?”deze workflow?”

Business voorbeeldenBusiness voorbeelden

Long Running en StatefulLong Running en StatefulWorkflows Workflows draaien draaien tot wel 5 tot wel 5 dagen en houden hun status dagen en houden hun status vast gedurende deze periodevast gedurende deze periode

Flexibele Control FlowFlexibele Control FlowFlexibiliteit voor mensen om Flexibiliteit voor mensen om stappen in de workflow stappen in de workflow handmatig aan te passenhandmatig aan te passen

TransparantieTransparantieVisueel de stappen in een Visueel de stappen in een workflow laten zien.workflow laten zien.

Toegevoegde waardeToegevoegde waarde

Page 5: Windows Workflow Foundation Workflow in jouw applicatie Dennis Mulder – Avanade dennism@avanade.com

Voorbeeld Workflow

Page 6: Windows Workflow Foundation Workflow in jouw applicatie Dennis Mulder – Avanade dennism@avanade.com

Wat lost workflow op?

• We weten heel goed “Wat” we moeten doen en “Hoe”, maar “Wanneer” is een uitdaging.

Page 7: Windows Workflow Foundation Workflow in jouw applicatie Dennis Mulder – Avanade dennism@avanade.com

WinFX

Workflow and BizTalk Server

Windows Workflow

Foundation

MessagingDesig

nTools

Business

ActivityMonitor

AndAdminTools

Orchestration

Transformation

Adapters

BizTalk ServerAccelerators

Visual Studio Designer

Workflow

Page 8: Windows Workflow Foundation Workflow in jouw applicatie Dennis Mulder – Avanade dennism@avanade.com

Windows Workflow Foundation is het Windows Workflow Foundation is het programmeermodel, de motor en biedt de tools om programmeermodel, de motor en biedt de tools om

snel workflow in te bouwen in jouw applicatiessnel workflow in te bouwen in jouw applicaties

• Eén workflow technologie voor Windows– Beschikbaar voor iedereen die Windows gebruikt– Generiek voor toepassing in een brede reeks van scenario’s

• Evolutie van workflow– Uitbreidbaar framework & API om workflow in te bouwen in jouw

applicaties– Eén technologie voor zowel human als system workflow

• Workflow wordt een gegeven– .NET developer kan workflow zich snel eigen maken– Fundamenteel onderdeel van Microsoft Office 2007

Windows Workflow Foundation Visie

Page 9: Windows Workflow Foundation Workflow in jouw applicatie Dennis Mulder – Avanade dennism@avanade.com

Host Process

WindowsWorkflow Foundation

Runtime Engine

Workflow

Activity

Runtime Services

Base Activity Library

Custom Activity Library

Visual Designer

• Visual Designer: Grafisch en code gebaseerde bouw van workflows

• Workflows zijn een opeenvolging van activiteiten

• Workflows draaien binnen een Host Process: een applicatie of server

• Ontwikkelaars kunnen hun eigen activiteiten bouwen

Components• Base Activity Library: Out-of-box

activiteiten en basis voor eigen activiteiten• Runtime Engine: Workflow execution en

state management• Runtime Services: Hosting, Persistence,

Tracking, Communicatie

Workflow Concepten

Page 10: Windows Workflow Foundation Workflow in jouw applicatie Dennis Mulder – Avanade dennism@avanade.com

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…

Page 11: Windows Workflow Foundation Workflow in jouw applicatie Dennis Mulder – Avanade dennism@avanade.com

Kostendeclaraties

Demo

Activities and the Activity Toolbox

Workflow Designer

Page 12: Windows Workflow Foundation Workflow in jouw applicatie Dennis Mulder – Avanade dennism@avanade.com

Een workflow is een class

Een workflow class gedefinieerd in markup<SequentialWorkflowActivity x:Class="XAMLWorkflow.Workflow1" x:Name="Workflow1" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/workflow"> <IfElseActivity x:Name="ifElseActivity1">… </IfElseActivity></SequentialWorkflowActivity>

using System.Workflow.Activities;

public sealed partial class Workflow1: SequentialWorkflow{}

Workflow Basics

Page 13: Windows Workflow Foundation Workflow in jouw applicatie Dennis Mulder – Avanade dennism@avanade.com

using System.Workflow.Activities;public partial class Workflow1 : SequentialWorkflowActivity {

public Workflow1() {

InitializeComponent();}

}

public sealed partial class Workflow1 : SequentialWorkflowActivity {private DelayActivity delay1;private void InitializeComponent()

{this.delay1 = new System.Workflow.Activities.DelayActivity();this.delay1.Name = “delay1";this.delay1.TimeoutDuration =

System.TimeSpan.Parse("00:00:05");this.Activities.Add(this.delay1);this.Name = "Workflow1";

}}

Workflow Basics

De Workflow constructor configureert de activiteiten die deze bevat (vergelijkbaar met Winforms & controls)

Page 14: Windows Workflow Foundation Workflow in jouw applicatie Dennis Mulder – Avanade dennism@avanade.com

Nieuwe Sequential Workflow

Debugging

Demo

Tracking

Workflow Designer

Page 15: Windows Workflow Foundation Workflow in jouw applicatie Dennis Mulder – Avanade dennism@avanade.com

.NET assembly

Alleen MarkupAlleen Markup““Declaratief”Declaratief”

XAMLXAML

Markup enMarkup enCodeCode

C#/C#/VBVB

Code OnlyCode Only ApplicatieApplicatiegegenereerdgegenereerd

XAMLXAML C#/C#/VBVB

• XML definieert XML definieert de workflow de workflow structuur, logica structuur, logica en datastromenen datastromen

• XML definieert XML definieert de workflowde workflow• Code-beside Code-beside definieert extra definieert extra logicalogica

• Code maaktCode maaktworkflowworkflowin constructorin constructor XAMLXAML C#/C#/

VBVB

App maakt App maakt activiteiten en activiteiten en serialiseertserialiseert

Workflow Compilerwfc.exe

C#/VB Compiler

Workflow maken

Page 16: Windows Workflow Foundation Workflow in jouw applicatie Dennis Mulder – Avanade dennism@avanade.com

Activiteiten

• Een activiteit is een stap in een workflow– Heeft properties en events die programmeerbaar zijn in jouw

workflow code– Heeft methods (b.v. Execute) die uitgevoerd worden door de

workflow runtime

• Vergelijkbaar met Forms & Controls– Activiteit == Controls– Custom Activiteit == UserControl– Workflows == Forms

• Activiteiten vallen in verschillende categorieën– Basic – stappen die de logica “doen”– Composite – groeperen van andere activiteiten– Rules – data gedreven, simpele condities die de ‘flow’ bepalen

Page 17: Windows Workflow Foundation Workflow in jouw applicatie Dennis Mulder – Avanade dennism@avanade.com

Custom Activiteiten• Activiteit is:

– Hergebruik– Samenvoeging van logica

• Waarom custom activiteiten?– Uitvoeren eigen business logica– Modelleren van geavanceerde

flow– Integratie met andere

technologie• Activiteiten kunnen generiek zijn

of domein specifiek• Voorbeelden:

– SendEmail, FileSystemEvent, PurchaseOrderCreated, AssignTask, ForEach, ChargeCreditcard, CheckInventory etc.

SimplicitySimplicity

FlexibilityFlexibility

Code Code ActiviteitActiviteit

CallExternalMethod CallExternalMethod &&HandleExternalEveHandleExternalEventntEigen Eigen ActiviteitenActiviteiten

InvokeWebService InvokeWebService ActiviteitActiviteit

Workflow Execution LogicWorkflow Execution Logic

Page 18: Windows Workflow Foundation Workflow in jouw applicatie Dennis Mulder – Avanade dennism@avanade.com

Custom Activity

Demo

Page 19: Windows Workflow Foundation Workflow in jouw applicatie Dennis Mulder – Avanade dennism@avanade.com

Local Communication ServiceExisting Application

Communication Contract (Interface Implementation)

Workflow Runtime Workflow

Method Invoke

Event Sink

App Input

App Output

[ExternalDataExchange] internal interface IVotingService { event EventHandler<VotingEventArgs> ApproveProposal; event EventHandler<VotingEventArgs> RejectProposal;

void CreateBallot(string alias); }

Page 20: Windows Workflow Foundation Workflow in jouw applicatie Dennis Mulder – Avanade dennism@avanade.com

Local Communication Service

• Implementeer de interface– Definieer in je implementatie de code die uitgevoerd

moet worden wanneer de host jouw workflow aanroept

• Registeer jouw implementatie bij de runtime

WorkflowRuntime workflowRuntime = new WorkflowRuntime();votingService = new VotingService();ExternalDataExchangeService dataService = new ExternalDataExchangeService();workflowRuntime.AddService(dataService);dataService.AddService(votingService);

internal class VotingService : IVotingService{…}

Page 21: Windows Workflow Foundation Workflow in jouw applicatie Dennis Mulder – Avanade dennism@avanade.com

Runtime Services

Local Communication Services

Hosting

Demo

Page 22: Windows Workflow Foundation Workflow in jouw applicatie Dennis Mulder – Avanade dennism@avanade.com

• Derde ‘foundation’ van WinFX technologie voor Vista– Windows Communication Foundation (“Indigo”)– Windows Presentation Foundation (“Avalon”)– Windows Workflow Foundation (“WF”)

• Ondersteuning voor Windows XP & Windows Server 2003• Gratis Onderdeel van Windows• Aangekondigd op de PDC in September 2005• Beta 2 in Januari 2006 en uitgebracht in de 2e helft van 2006

20072005 2006

Final featuremilestone

V1V1RTMRTMB1B1 B2B2

Q1 Q2 Q3 Q1 Q2Q4

Beschikbaarheid

Page 23: Windows Workflow Foundation Workflow in jouw applicatie Dennis Mulder – Avanade dennism@avanade.com

Samenvatting

• Workflow functionaliteit is nodig in veel soorten applicaties

• Workflow toevoegen in applicaties is zo simpel als enkele regels code

• Door Workflows te tekenen in de designer begrijpen niet-developers de code ook beter

• Workflow foundation is een basis waarmee je workflow in je applicatie kan opnemen, voor geavanceerdere functionaliteit is het uitbreiden van Workflow niet complex

Page 24: Windows Workflow Foundation Workflow in jouw applicatie Dennis Mulder – Avanade dennism@avanade.com

• MSDN® Workflow Page– Microsoft® Visual Studio® Extensions– Download Hands-on Labs– http://msdn.microsoft.com/workflow

• Community Site– RSS feed voor nieuws & updates– Vind, download, & registeer Activiteiten– Blogs, screencasts, whitepapers, en andere

informatie– Download voorbeelden, tools, en runtime service

componenten– http://www.WindowsWorkflow.net

• Forums– Stel vragen in de forums– http://www.WindowsWorkflow.net/Forums

Windows Workflow Foundation Resources

Page 25: Windows Workflow Foundation Workflow in jouw applicatie Dennis Mulder – Avanade dennism@avanade.com