Workflow Foundation - PowerPoint PPT Presentation

1 / 39
About This Presentation
Title:

Workflow Foundation

Description:

Template design: aliciat Formatter: Event Date: Event Location: Speech Length: Audience: Key Topics: – PowerPoint PPT presentation

Number of Views:115
Avg rating:3.0/5.0
Slides: 40
Provided by: Christian313
Category:

less

Transcript and Presenter's Notes

Title: Workflow Foundation


1
Workflow Foundation
  • Christian Binder
  • Developer Platform Strategy Group
  • Microsoft Deutschland GmbH
  • cbinder_at_microsoft.com

2
Agenda
  • Was ist die Workflow Foundation?
  • Architektur Kernkonzepte
  • Workflow Engine Services

3
Worklfow Foundation
Windows Workflow Foundation ist
Programmiermodell, Engine und Werkzeug für das
einfache Erstellen Workflow-basierter
Windows-Anwendungen.
  • Zentrale Workflow-Technologie für Windows
  • Teil des .Net Framework 3.0
  • Erweiterbares Programmiermodel
  • Workflow neu definiert
  • Workflow als Mainstream-Technologie

4
Was ist ein Workflow?
Eine Zusammenstellung von Activities,
organisiert in einem Flowchart oder
Statusdiagramm
AnManagerEskalieren
CheckInventory
Beispiel Activities.
Oder einem Statusdiagramm.
Wie ein Flowchart.
5
Workflow Scenario Spektrum
  • Beteiligte Menschen, Rollen
  • Ablauf Flexibel, dynamisch
  • Daten Unstrukturiert, Dokumente
  • Beteiligte Apps, Services
  • Ablauf Vorgeschrieben
  • Daten strukturiert, transaktional

6
Software Herausforderungen
Software Herausforderung
Die echte Welt
7
Workflow und BizTalk Server
BizTalk Server
  • Premium BPM Server
  • Server product
  • Verwendent in B2B, EAI, BPM Szenarien
  • Verteilebare Lösung
  • Verwaltbarkeit, Scale-out

Business Activity Monitor And Admin Tools
Accelerators
Design Tools
Orchestration
Workflow
Messaging
Transformation
Adapters
  • Workflow Foundation
  • Bestandteil von .NET FW 3.0
  • Weites Einsatzgebiet
  • Für Eigenentwicklung
  • Ermöglicht Verwaltbarkeit und
  • Scale-out Lösung

8
Workflow und Office 2007
Outlook Benachrichtigungen empfangen
SharePoint Workflows starten, erstellen, dran
teilnehmen, anpassen
Word, PowerPoint, Excel, InfoPath SharePoint
Workflow starten, dran teilnehmen
SharePoint Designer 2007 Workflows anpassen und
erstellen
9
Agenda
  • Was ist die Workflow Foundation?
  • Architektur Kernkonzepte
  • Workflow Engine Services

10
Windows Workflow Foundation
Visual Designer
  • Kernkonzepte
  • Workflows sind ein Set von Activities

Workflow
  • Workflows laufen in einem Host Process

Activity
  • Entwickler können eigene Activity-Bibliotheken
    erstellen

Komponenten
Activity Library
  • Base Activity Library Out-of-box Activities und
    Basis für eigene Activities

Workflow Foundation
Base Activity Library
  • Runtime Engine Workflow Execution und State
    Management

WF Runtime Engine
  • Runtime Services Hosting Flexibilität und
    Kommunikation

Runtime Services
  • Visual Designer

Host
11
Workflow Basics
  • Ein Workflow ist eine Klasse

using System.Workflow.Activities public class
Workflow1 SequentialWorkflow
  • Ein Workflow kann in XML beschrieben werden

lt?Mapping XmlNamespace"Activities"
ClrNamespace"System.Workflow.Activities"
Assembly"System.Workflow.Activities"
?gt ltSequentialWorkflow xClass"MyWorkflow"
xmlns"Activities" xmlnsx"Definition"gt
lt/SequentialWorkflowgt
12
Workflow Basics
  • Workflow Constructor konfiguriert Activities

public partial class Workflow1
SequentialWorkflow public Workflow1()
InitializeComponent() public sealed
partial class Workflow1 SequentialWorkflow
private Delay delay1 private void
InitializeComponent() this.delay1
new System.Workflow.Activities.Delay() th
is.delay1.ID delay1" this.delay1.TimeoutDura
tion
System.TimeSpan.Parse("000005") this.Activiti
es.Add(this.delay1) this.ID "Workflow1"

13
Workflow Erstellungsoptionen
14
Visual Designer
  • Workflow Designers
  • Workflows erstellen
  • Visuelle und Code basierende Programmierung
  • Visuelles Debugging
  • Themes support
  • Designer re-hosting

15
Workflows erstellen
16
Was sind Activities?
  • Ein Activity ist ein Schritt im Workflow
  • Hat Properties und Events, die im Workflow Code
    programmierbar sind
  • Hat Methoden, die nur die Workflow Runtime
    aufruft
  • Vergleichbar mit Forms Controls
  • Activity Control
  • Workflow Form
  • Activities fallen unter zwei Kategorien
  • Basic
  • Composite

17
Activities Erweiterbarer Ansatz
Domain-spezifischeWorkflow Pakete
Benutzerdefinierte Activity-Libraries
Base Activity Library
Base Activity Library
Eigene Activity
18
Flexible Control Flow
19
Activities verwenden und erstellen
20
Workflow Lifecycle
  • Gesteuert via WorkflowInstanz Objekt
  • Lifecycle und Persistenz Operationen
  • Abort, Terminate, Suspend, Resume
  • Load, Unload
  • Operationen erzeugen zugerhörige Workflow Events

private void TerminateButton_Click(object sender,
EventArgs e) WorkflowInstance
workflowInstance workflowRuntime.GetWorkflow(Pro
gram.workflowInstanceId) workflowInstance.Ter
minate("Terminating Case, Problem was
resolved")
21
Workflow Runtime Events
  • Workflow Instanz Events
  • Bietet die Möglichkeit Informationen über den
    Workflow-Lifecycle der Instanz zu erhalten
    z.B.Aborted, Terminated, Started, Completed,
    usw.
  • EventArgs enthält die InstanzID der zugehörigen
    Workflow Instanz
  • Erzeugt durch Workflow-Instanz Operationen oder
    während der Ausführung
  • z.B. Die Ausführung der Terminate Activity
    erzeugt das WorkflowRuntime.WorkflowTerminated
    Event
  • Workflow Runtime Events
  • Bietet die Möglichkeit Informationen über die
    Workflow-Runtime zu erhalten
  • Started, Stopped

22
Workflow Events (I)
Workflow Event Handlers Description Event Arguments
ExceptionNotHandled Thrown when the workflow instance doesnt handle the internal exception ExceptionNotHandledEventArgs
Started Thrown when the workflow runtime is started WorkflowRuntimeEventArgs
Stopped Thrown when the workflow runtime is stopped WorkflowRuntimeEventArgs
WorkflowAborted Thrown when the workflow instance is aborted WorkflowEventArgs
WorkflowCompleted Thrown when the workflow instance is completed WorkflowCompletedEventArgs
WorkflowCreated Thrown when the workflow instance is created WorkflowEventArgs
WorkflowIdled Thrown when the workflow instance is idle (ex. Delay or EventSink) WorkflowEventArgs
WorkflowLoaded Thrown when the workflow instance is loaded into memory (i.e. re-hydrated) WorkflowEventArgs
23
Workflow Events (II)
Workflow Event Handlers Description Event Arguments
WorkflowPersisted Thrown when the workflow instance is persisted WorkflowEventArgs
WorkflowResumed Thrown when the workflow instance is resumed after being suspended. WorkflowEventArgs
WorkflowShutdown Thrown when the workflow runtime is shutdown WorkflowEventArgs
WorkflowSuspended Thrown when the workflow instance is suspended by the runtime WorkflowSuspendedEventArgs
WorkflowTerminated Thrown when the workflow instance is terminated by the runtime or internally WorkflowTerminatedEventArgs
WorkflowUnloaded Thrown when the workflow instance is un-loaded from memory (i.e. Hydrated) WorkflowEventArgs
24
Workflow Events
25
Workflow und Host Kommunikation
  • Kommunikation zwischen Workflow und Host basiert
    auf Messaging mit Methoden und Events

26
Workflow und Host Kommunikation (II)
  • ExternalDataExchange
  • public interface IApprovalService
  • void ManualApproval(int amount)
  • event EventHandlerltExternalDataEventArgsgt
    ApprovedProposal
  • event EventHandlerltExternalDataEventArgsgt
    RejectedProposal

class ApprovalService IApprovalService
//ExternalDataExchangeService in der Runtime
registrieren WorkflowRuntime workflowRuntime
new WorkflowRuntime() ExternalDataExchangeService
externalService new ExternalDataExchangeService(
) workflowRuntime.AddService(externalService) ex
ternalService.AddService(new ApprovalService())
27
Workflow Host Kommunikation
28
Agenda
  • Was ist die Workflow Foundation?
  • Architektur Kernkonzepte
  • Workflow Engine Services

29
Runtime Services
Host Application

PersistenceService lädt und speichert den Status
der Instanz
WF Runtime
Out of Box Services unterstützen SQL Server/MSDE
Services
PersistenceService
TrackingService verwaltet Profile und speichert
Tracking-Informationen
TrackingService
SchedulerService
CommitWorkBatch Service
Verwaltung von Threading und Transaktionen
30
Übersicht Persistence
  • Persistieren der Status und Timer Information
    einer Workflow Instanz
  • Instanzen bleiben so lange Zeit verfügbar und
    belegen kein Speicher
  • Instanzen sind auch nach einem System Restart
    verfügbar

Persist
Unload
Persistence Service
Workflow Instance
Load
Host Application
31
Workflow Persistence aktivieren
  • Persistence Support für Workflow Instanzen
  • Workflow Runtime erstellen
  • Connection String definieren
  • SqlPersistenceService in Runtime registrieren
  • Workflow starten
  • Laden und Entladen mit StatePersistenceService

private void StartCaseManagementProcess()
WorkflowRuntime wr new WorkflowRuntime()
string connectionstring "Initial
CatalogPersistenceDataSourcelocalhostIntegrate
d SecuritySSPI" wr.AddService(new
SqlWorkflowPersistenceService(connectionstring))
WorkflowInstance instance wr.CreateWorkflow(t
ypeof(ManageCaseCreation)) instance.Start()
32
Workflow Persistence
33
Übersicht Tracking
  • Nachhalten aller Statusänderungen und Daten im
    Workflow
  • Profile
  • APIs für die Erstellung
  • XML legt fest, was nachgehalten wird
  • Includes und Excludes, State Changes, Data
    Context,

Tracking Information
Tracking Service
Write
Activities
Profile
Workflow Instance
Host Application
Query
34
Workflow Tracking aktivieren
  • Tracking Unterstützung für Workflow Instanzen
  • Tracking Profil(e) erstellen
  • Workflow Runtime erstellen
  • Connection String festlegen
  • Ein oder mehrere Tracking-Services bei der Engine
    registrieren
  • Workflow erstellen und ausführen
  • Tracking Datenbank abfragen Instanz und
    Activity Information

private void StartCaseManagementProcess()
WorkflowRuntime wr new WorkflowRuntime()
string connectionstring "Initial
CatalogPersistenceDataSourcelocalhostIntegrate
d SecuritySSPI" wr.AddService(new
SqlTrackingService(connectionstring))
WorkflowInstance instance wr.CreateWorkflow(type
of(ManageCaseCreation)) instance.Start()
35
Workflow Tracking
36
Agenda
  • Was ist die Workflow Foundation?
  • Architektur Kernkonzepte
  • Workflow Engine Services

37
Zusammenfassung
  • Zentrale Workflow-Technologie für Windows
  • Teil des .Net Framework 3.0
  • Erweiterbares Programmiermodel
  • BizTalk Server, Office 2007, MBS andere
    Microsoft Client/Server Produkte, werden auf WF
    basieren
  • Workflow neu definiert
  • Technolgie für System Human Workflow zentrische
    Anwendungen
  • Sequentieller oder State machine Worklfow
  • Workflow als Mainstream-Technologie
  • Erweiterbare Plattform für ISVs

38
Weitere Informationen
  • MSDN Workflow Page
  • Microsoft Visual Studio Extensions
  • Download 12 Hands-on Labs
  • http//msdn.com/workflow
  • Community Site
  • RSS Feeds für News Updates
  • Beispiele, Tools und Runtime-Servicekomponenten
  • http//wf.netfx3.com
  • Foren
  • http//www.WindowsWorkflow.net/Forums

39
Fragen und Antworten
  • Vielen Dank!
  • Christian Binder
  • cbinder_at_microsoft.com
Write a Comment
User Comments (0)
About PowerShow.com