Presentation is loading. Please wait.

Presentation is loading. Please wait.

COM210 Introduction to Workflow in Windows Applications

Similar presentations


Presentation on theme: "COM210 Introduction to Workflow in Windows Applications"— Presentation transcript:

1 COM210 Introduction to Workflow in Windows Applications
7/23/2018 1:38 PM COM210 Introduction to Workflow in Windows Applications Bill Devlin Group Program Manager Windows Workflow Foundation Microsoft Corporation Paul Andrew Technical Product Manager Windows Workflow Foundation Microsoft Corporation © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

2 Windows Workflow Foundation
7/23/2018 1:38 PM Windows Workflow Foundation Bringing workflow technology to the Windows platform © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

3 Agenda Introduction to Windows Workflow Foundation Workflow basics
7/23/2018 1:38 PM Agenda Introduction to Windows Workflow Foundation Workflow basics Demo: building “hello world” Activities: the building blocks of workflows Demo: building custom activities More workflow features Demo: a state machine workflow app Wrap-up and questions © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

4 Windows Workflow Foundation
7/23/2018 1:38 PM Windows Workflow Foundation The workflow framework & tools for Microsoft products and partner/customer ecosystem Single workflow technology for Windows Base for Microsoft products and ISV/customer solutions One technology for human and system workflow scenarios A framework for building workflow into applications A framework to build on - not an application or server Exposed to developers via WinFX Brings workflow to mainstream .NET development Transform workflow from niche to mainstream paradigm Build strong partner & solution ecosystem © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

5 What is a workflow? A set of activities that coordinate people
7/23/2018 1:38 PM What is a workflow? A set of activities that coordinate people and / or software... Example activities…. EscalateToManager CheckInventory Like a flowchart…. …organized into a workflow. Or a state diagram…. © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

6 Workflow Scenario Spectrum
7/23/2018 1:38 PM Workflow Scenario Spectrum System Workflow Human Workflow Participants: people, roles Flow style: flexible, dynamic Data: unstructured, documents Participants: apps, services Flow style: prescriptive, protocols Data: structured, transactional Business to Business Supply Chain Mgmt… Information Worker Document Review… Line of Business Apps Quote to Cash, Sales Automation… CRM ERP IT Management New Hire Provisioning, Trouble Ticket,… .NET Developer Pageflow, Service Coordination… Windows Workflow Foundation © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

7 Why Workflow Technology?
7/23/2018 1:38 PM Why Workflow Technology? Developer Productivity Workflows technology provides abstractions convenient to describe real world workflows Workflow Technology Value-Add Long running and stateful behavior Flexible control flow Transparency © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

8 Why Workflow Technology?
7/23/2018 1:38 PM Why Workflow Technology? Real World Examples Workflow Value-Add Long Running and Stateful Workflows run for up to 30 days and maintain state throughout “Orders are confirmed in 48 hours and shipped within 30 days.” “Most suppliers confirm our orders but some forget and we need to followup.” Flexible Control Flow Flexibility for people to override or skip steps in the workflow Transparency Rendering a visualization of next steps based on defined control flow “What are the next steps in handling this order?” © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

9 Workflow and BizTalk Server
7/23/2018 1:38 PM BizTalk Server Premium BPM server Distinct server product Use in B2B, EAI, BPM scenarios Deployable solutions Manageability, Scale-out Design Tools Accelerators Business Activity Monitor And Admin Tools Workflow Orchestration Messaging Transformation Future version will migrate to Windows Workflow Foundation for orchestration Adapters Workflow framework Exposed via WinFX Broad set of scenarios Used to build solutions Enables manageability and scale-out in solutions Use for building workflow into apps or workflow-enabled servers Visual Studio Designer WinFX Windows Workflow Foundation © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

10 Windows Workflow Foundation
7/23/2018 1:38 PM Windows Workflow Foundation Visual Designer Key Concepts Workflows are a set of Activities A Workflow Workflows run within a Host Process: any application or server Developers can build their own Custom Activity Libraries An Activity Custom Activity Library Components Windows Workflow Foundation Base Activity Library: Out-of-box activities and base for custom activities Base Activity Library Runtime Engine: Workflow execution and state management Runtime Engine Runtime Services: Hosting flexibility and communication Runtime Services Visual Designer: Graphical and code-based construction Host Process © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

11 Workflow Basics A workflow is a class
7/23/2018 1:38 PM Workflow Basics A workflow is a class Imports System.Workflow.Activities Public Class MyWorkflow Inherits SequentialWorkflow End Class A workflow class may be defined in markup <?Mapping XmlNamespace="Activities" ClrNamespace="System.Workflow.Activities" Assembly="System.Workflow.Activities" ?> <SequentialWorkflow x:Class="MyWorkflow" xmlns="Activities" xmlns:x="Definition"> </SequentialWorkflow> © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

12 7/23/2018 1:38 PM Workflow Basics Workflow constructor configures contained activities (like forms & controls) Imports System.Workflow.Activities Partial Public Class MyWorkflow Inherits SequentialWorkflow Public Sub New() MyBase.New() InitializeComponent() End Sub End Class Partial Public Class MyWorkflow REM designer generated Private Sub InitializeComponent() Me.delay1 = New System.Workflow.Activities.Delay Me.delay1.ID = "delay1" Me.delay1.TimeoutDuration = System.TimeSpan.Parse("00:00:05") Me.Activities.Add(Me.delay1) Me.ID = "MyWorkflow" Private WithEvents delay1 As System.Workflow.Activities.Delay © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

13 Paul Andrew Technical Product Manager Windows Workflow Foundation
7/23/2018 1:38 PM Building a Workflow Paul Andrew Technical Product Manager Windows Workflow Foundation © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

14 Workflow Authoring Modes
7/23/2018 1:38 PM Workflow Authoring Modes Markup Only “Declarative” Markup and Code Code Only Application Generated C#/VB C#/VB App creates activity tree and serializes XAML XAML XML defines workflow structure logic and data flow XML defines workflow Code-beside defines extra logic Code creates workflow in constructor C#/VB XAML Workflow Compiler wfc.exe .NET assembly ctor defines workflow C#/VB Compiler © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

15 Activity Basics Activities are the building blocks of workflows
7/23/2018 1:38 PM Activity Basics Activities are the building blocks of workflows The unit of execution, re-use and composition Basic activities are steps within a workflow Composite activities contains other activities EG: Sequence Base Activity Library provides out-of-the-box activity set Partners and customers author custom activities EG: “ApproveOrder” © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

16 Activity Basics Activities are classes:
7/23/2018 1:38 PM Activity Basics Activities are classes: Properties and events are defined by the activity author and programmable from workflows Has methods that are coded by the activity author but invoked by the workflow runtime (EG: Execute) or designer Can be built into workflow assemblies or deployed as re-usable libraries Lets look at the code for a simple activity… © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

17 Example: A SendMail Activity
7/23/2018 1:38 PM using System.Workflow.ComponentModel; public partial class SendMail : System.Workflow.ComponentModel.Activity { public SendMail() { InitializeComponent(); } protected override Status Execute(ActivityExecutionContext context) // my logic here to send the return Status.Closed; } public partial class SendMail public string subject; public string Subject { get { return subject; } set { this.subject = value; } } private void InitializeComponent() // designer generated this.ID = "SendMail"; © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

18 Activities: Optional Features
7/23/2018 1:38 PM Activities: Optional Features Companion Classes [Designer(typeof(MyDesigner))] [Validator(typeof(MyValidator))] [CodeGenerator(typeof(MyCodeGen))] [Serializer(typeof(MySerializer))] [ToolboxItem(typeof(MyToolboxItem))] Designer Validator Serializer Code Generator ToolboxItem Behaviors [SupportsTransaction] [SupportsExceptionHandlers] Transactions public class MyActivity: Activity { ... } © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

19 Paul Andrew Technical Product Manager Windows Workflow Foundation
7/23/2018 1:38 PM Building an Activity Paul Andrew Technical Product Manager Windows Workflow Foundation © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

20 Activities: An Extensible Approach
7/23/2018 1:38 PM Activities: An Extensible Approach Vertical-specific activities & workflows Best-practice IP & Knowledge Domain-Specific Workflow Packages Compliance RosettaNet CRM IT Mgmt Base Activity Library Custom Activity Libraries Compose activities Extend activity Author new activity Out-of-Box Activities OOB activities, workflow types, base types General-purpose Activity libraries define workflow constructs Create/Extend/ Compose activities App-specific building blocks First-class citizens © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

21 Workflow Execution My Application Create instance Execute until idle
7/23/2018 1:38 PM Workflow Execution My Application Create instance rt.StartWorkflow(typeof(WF1)); Invoke1 WF1 Instance 1 App calls StartWorkflow(…) Sequence 2 Instance Manager: Loads workflow type Creates instance Enqueues WF1 with Scheduler WF1 OnEvent1 Execute MyWF.dll Execute until idle 3 Scheduler dequeues WF1 and calls Executor (SequentialWorkflow base) which enqueues Sequence SequentialWorkflow Execute Base Activity Library Sequence Execute 4 Dequeue Sequence and call Executor which enqueues OnEvent1 Activity Save Dequeue OnEvent1 and call Executor which subscribes to event 5 Instance Manager Persist to disk Runtime Engine InstanceMgr calls Save() on WF1 (Activity base class) to serialize instance and gets back stream 6 Scheduler WF1 Sequence OnEvent1 Instance Mgr call Persistence service passing serialized stream - Persistence service saves to disk 7 Runtime Services WF1 Persistence © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

22 Base Classes and Behaviors Dynamic Update Exceptions Transactions
7/23/2018 1:38 PM Base Activity Library System Workflow Human Workflow Base Activity Library Workflow Styles State Machine Workflow Sequential Workflow Sequential Control Rules-Driven Transactions Out-of-box Activities Communications Local and Web Services Activity Framework Base Classes and Behaviors Dynamic Update Exceptions Transactions © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

23 Flexible Control Flow Sequential Workflow State Machine Workflow
7/23/2018 1:38 PM Flexible Control Flow Sequential Workflow State Machine Workflow Sequential structure prescribes processing order External events drive processing order Step1 State1 Event State2 Step2 Event Prescriptive, formal Automation scenarios Flowchart metaphor Reactive, event-driven Skip/re-work, exception handling Graph metaphor Rules-driven Activities Rule1 Step1 Rules + data state drive processing order Data Rule2 Step2 Data-driven Simple Conditions, complex Policies Constrained Activity Group © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

24 Transparency at Runtime
7/23/2018 1:38 PM Transparency at Runtime WorkflowInstance instance = Runtime.GetWorkflowInstance(…); Accessing a running Instance (pull model) WorkflowInstance class Use to determine status, activity structure for an instance Runtime Engine Scheduler Instance Mgr Runtime Services Tracking Profile Capturing tracking data (push model): Tracking profile, service Use to record data about instances as they execute Use default tracking service or supply your own Tracking Service Tracking Store © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

25 A State Machine Workflow
7/23/2018 1:38 PM A State Machine Workflow Paul Andrew Technical Product Manager Windows Workflow Foundation © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

26 Summary 7/23/2018 1:38 PM Windows Workflow Foundation delivers an extensible framework and tools for building workflow into Windows applications 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 Flexible control flow: human and system workflow scenarios Transparency at runtime Visual designer for graphical and code-based authoring Availability Exposed via WinFX – powers Office “12” workflow © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

27 Windows Workflow Foundation
7/23/2018 1:38 PM Call To Action Windows Workflow Foundation Learn it… Use it… Build workflow into your applications Make you applications more flexible and configurable Build workflow enabled servers for other developers to target Build custom activity libraries for others to re-use Build solutions on top of workflow enabled products like Office “12” © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

28 Workflow Sessions Hands-on Labs! My Workflows
7/23/2018 1:38 PM Hands-on Labs! Introduction to Workflow in Windows Applications (COM210) Wed 1:45 – 150/151 Hall E My Workflows My Custom Activity Library Extending Workflow Capabilities With Custom Activities (COM328) Wed 3:15 – 150/151 Hall E Windows Workflow Foundation Developing Rules-Driven Workflows (COM318) Wed 5:00 – 152/153 Hall F Base Activity Library State Machine Workflows Windows SharePoint Services: Developing Custom Workflows (OFF415) Thurs 11:30 – 408 AB Rules-Driven Activities Communication Activities Developing Event-Driven State Machine Workflows (COM322) Thurs 2:15 – 515 AB Runtime Engine Runtime Services Workflow + Messaging + Services - Developing Dist’d Apps (COM325) Thurs 3:45 – 150/151 Hall E Windows Communication Foundation Hosting and Communications in Workflow Scenarios (COM327) Thurs 5:15 – 402 AB Windows SharePoint Services Host Process © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

29 More Community Resources
7/23/2018 1:38 PM More Community Resources At PDC 12 Labs: COMHOL01-12 “Ask The Experts” tables – 4 tables and lots of experts COM Track Lounge After PDC If you missed this related session, watch it on the DVD MSDN dev center: Windows Workflow Foundation community site Channel 9 tag: © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

30 © 2005 Microsoft Corporation. All rights reserved.
7/23/2018 1:38 PM © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.


Download ppt "COM210 Introduction to Workflow in Windows Applications"

Similar presentations


Ads by Google