Developing Event Driven State Machine Workflows S1 S2 S3 S4 Adam Calderon Principal Engineer - Interknowlogy Microsoft MVP – C#

Slides:



Advertisements
Similar presentations
Event Driven Architecture
Advertisements

The Microsoft Technical Roadshow 2006 Windows Workflow Foundation Mike Taulty Developer & Platform Group Microsoft Ltd
DIGIDOC A web based tool to Manage Documents. System Overview DigiDoc is a web-based customizable, integrated solution for Business Process Management.
Microsoft Office SharePoint Portal Server 2007 Introduction to InfoPath Forms Services Daryl L. Rudolph.
Request Management Mirror-. A random three day sample of Incidents revealed that about 86% of the registered Incidents were legitimate Requests Many other.
Designing, Deploying and Managing Workflow in SharePoint Sites Steve Heaney Product Development Manager OBS
Global States.
SSIS Field Notes Darren Green Konesans Ltd. SSIS Field Notes After years of careful observation and recording of the Species SSIS, Genus ETL, in both.
Overview of the Composite Application Guidance for WPF Adam Calderon Application Development Practice Lead.
OFC 317 使用 WinWF 构建 Microsoft Office SharePoint Server 2007 中的工作流应用.
Visual Web Information Extraction With Lixto Robert Baumgartner Sergio Flesca Georg Gottlob.
Business Process Orchestration
Mark Rees Microsoft Consulting Services OFC409 Windows Workflow Foundation (WF) Primer Creating WF programs in Visual Studio Creating workflow templates.
OFC312 Developing Workflows for the 2007 Microsoft Office System and Windows SharePoint Services (version 3) Adam Calderon Principal Engineer - Interknowlogy.
THE OBJECT-ORIENTED DESIGN WORKFLOW Statechart Diagrams.
Hands-On Microsoft Windows Server 2003 Administration Chapter 3 Administering Active Directory.
Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN) Dynamic and generic workflows in.NET Bart De Smet.
---Confidential 1 Order Management Training. ---Confidential 2 Introduction Three cycles in Oracle Applications Plan to make. Order to cash Procure to.
Chapter 11 ASP.NET JavaScript, Third Edition. 2 Objectives Learn about client/server architecture Study server-side scripting Create ASP.NET applications.
Introducing Windows Workflow Foundation. Understanding Windows Workflow Foundation Janakiram MSV Developer Evangelist Microsoft Corporation Introducing.
SharePoint Collaboration Features & Workflow
It’s always better live. MSDN Events Developer Productivity Improvements with Visual Studio 2008 and Office Business Applications.
Workflow API and workflow services A case study of biodiversity analysis using Windows Workflow Foundation Boris Milašinović Faculty of Electrical Engineering.
Using Microsoft SharePoint to Develop Workflow and Business Process Automation Ted Perrotte National Practice Manager, Quilogy, Microsoft Office SharePoint.
Workflows in SharePoint Brian Russo RJB Technical Consulting July 2009.
TIBCO Designer TIBCO BusinessWorks is a scalable, extensible, and easy to use integration platform that allows you to develop, deploy, and run integration.
UNIT-V The MVC architecture and Struts Framework.
IBM Proof of Technology Discovering the Value of SOA with WebSphere Process Integration © 2005 IBM Corporation SOA on your terms and our expertise WebSphere.
1 Developing Rules Driven Workflows in Windows Workflow Foundation Jurgen Willis COM318 Program Manager Microsoft Corporation.
Wrestling with Windows Workflow Foundation Simon Thurman Jeremy Stimson.
Sage CRM Developers Course
Introduction to the Enterprise Library. Sounds familiar? Writing a component to encapsulate data access Building a component that allows you to log errors.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Chapter 10 State Machine Diagrams
WMS systems manage and coordinate several independent subtasks. The coordination problems get even more serious when the subtasks are performed on separate.
Workflow and SharePoint Presented by Ben Geers. Overview What is workflow? Windows Workflow Foundation How does workflow apply to SharePoint? WSS v3 vs.
Developing Workflows with SharePoint Designer David Coe Application Development Consultant Microsoft Corporation.
5.1 © 2004 Pearson Education, Inc. Lesson 5: Administering User Accounts Exam Microsoft® Windows® 2000 Directory Services Infrastructure Goals 
Domain-Driven Design Tim McCarthy Principal Engineer, InterKnowlogy
©2004 Deloitte Drop Shipment and Back to Back Order Processes in Oracle 11i July 19, 2004.
WEB 304 An Overview of ASP.NET and Windows Workflow Foundation Kashif Alam Program Manager Developer Division Microsoft Corporation.
Copyright 2002 Prentice-Hall, Inc. Chapter 2 Object-Oriented Analysis and Design Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey.
Office Business Applications Workshop Defining Business Process and Workflows.
Adam Calderon – C# MVP Application Development Practice Lead Interknowlogy.
Pulse for TM1 Version 4 New features, improvements and lots more.
Copyright ©2004 Virtusa Corporation | CONFIDENTIAL Windows Workflow Foundation Ruwan Wijesinghe.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 13. Review Shared Data Software Architectures – Black board Style architecture.
Introduction to C# 2.0 An Advanced Look Adam Calderon Principal Engineer - Interknowlogy Microsoft MVP – C#
Session 1 Module 1: Introduction to Data Integrity
Slide 1. Agenda  Introduction to Windows Workflow What is it? What are activities? Hosting  Out of the box Activities  Custom Activities and Dependency.
Building Custom Controls with ASP.NET and the Microsoft ®.NET Framework Rames Gantanant Microsoft Regional Director, Thailand
Workflow in Microsoft Office SharePoint Server Jessica Gruber Consultant Microsoft Corporation.
SharePoint Fest 2013 Chicago What’s New and Exciting (and not so great) in SharePoint Designer 2013 Workflows Ira Fuchs – SharePoint Technical Specialist,
Windows Workflow Foundation Guy Burstein Senior Consultant Advantech – Microsoft Division
Template Package  Presented by G.Nagaraju.  What is Template Package?  Why we use Template Package?  Where we use Template Package?  How we create.
Enterprise Library 3.0 Memi Lavi Solution Architect Microsoft Consulting Services Guy Burstein Senior Consultant Advantech – Microsoft Division.
Business Processes A business process describes a set of activities that are necessary to complete a response to a stimulus applied to an organization.
oracle apps order management training
Joy Rathnayake Senior Architect – Virtusa Pvt. Ltd.
Identifying & Creating Use Cases – Part 2
Project Management: Messages
Object-Oriented Analysis and Design
Self Healing and Dynamic Construction Framework:
MGB 2003 Adam Calderon – C# MVP Principal Engineer Interknowlogy
States.
Technology in Action! Windows Workflow Foundation Advanced Techniques
Building event-driven, long-running apps with Windows workflow
States.
Web Development Using ASP .NET
Server & Tools Business
Presentation transcript:

Developing Event Driven State Machine Workflows S1 S2 S3 S4 Adam Calderon Principal Engineer - Interknowlogy Microsoft MVP – C#

Session Objectives And Key Takeaways Objectives What is Windows Workflow Foundation Why State Machine Workflows State Machine Workflow Structure The State Activity The Event Driven Activity The Set State Activity Skip and Rework Patterns Dynamic Updates to State Machines Key Takeaways State machine as a powerful modeling paradigm

Agenda State Machine Workflow Introduction Building State Machine Workflows Recursive Composition Skip and Rework Pattern Additional State Machine Patterns SummaryQ&A

Types of Business Processes Control flow processes Are self driven once they are initiated The set of events that may happen are highly predictable Mostly sequential in nature Highly suitable for process automation Event Driven processes Are driven by external events Must be able to respond to any high priority event even if the some other work is in process The sequence of events may not be predictable The process can jump to any step in the process Highly suitable for processes where human actions are involved

What Do State Machines Workflows Offer Provide an effective modeling paradigm for Event driven processes Provide a natural paradigm for the business users to express business intent Business users always think in terms of logical states of the process, possible events in those states and actions in response to the events Provide an easy way to query and visualize the process The current state of the process is the current state of the state machine The set of possible transitions from the current state can be easily obtained Provide very powerful business exception handling State Machines are a familiar paradigm for IT professionals

When to Use State Machine Workflow State Machine workflow provides a very powerful design paradigm Not all processes can be modeled using State Machines Use it when there is a lot of human interactions with the process Use it when the workflow is driven by external events Use it when there is a lot of out of band events that can be received in the workflow Use it when it is hard to wire all the possible paths within the process in a sequential workflow

Basic Concepts of State Machine Workflows The basic elements of a state machine workflow StatesEventsActionsTransitions A state machine workflow is composed of a set of states In a given state a set of events can be received Based on the event received an action is performed at the end of which a state transition may or may not be made

Example : A Simple PO Process On Order CreatedOn Order Approved Order Created Order Approved Order Shipped On Order Shipped On Order Completed On Order Completed Waiting to Create Order On Order Completed On Order Shipped Order Completed

A Purchase Order State Machine Workflow Developing Event Driven State Machine Workflows

Agenda State Machine Workflow Introduction Building State Machine Workflows Recursive Composition Skip and Rework Pattern Additional State Machine Patterns SummaryQ&A

State Machine Implementation in WinWF The state machine workflow is a root activity like the sequential workflow There are 4 activities which work in the state machine workflow State -- Represents the state of the state machine Event Driven – Used to handle an event in a given state Set State – Used to transition from one state to another State Initialization – Used for default action on entering a state Event Driven State Machine Workflow Event Driven State Initialization State Set State State

State Machine Workflow Activities The State Activity The state activity represents a logical state of the state machine It can contain a collection of event driven activities To be in a particular state in the state machine means to execute that state activity The state activity can also contain the State Initialization activity The state initialization activity is optional and if present is executed by default Event Driven State Initialization State Set State State

How to Design a State The State is the logical state of the process E.g. Order Shipped, Document Approved The State is similar to a milestone in a process Is a natural fit as a tracking point for a process The state machine workflow can only be in one logical state at any point in time In a given state the process may receive only a valid set of events E.g. publish document event in the document approved state

Initial State and Completed State A state machine workflow must have a start state This is the state in which the state machine will be when the state machine instance is created A state machine workflow can have a completed state When the workflow reaches the completed state the workflow instance stops executing The Start state and completed state can be specified as properties on the root state machine workflow activity

State Machine Workflow Activities: The Event Driven Activity The event driven activity is used to handle an event received in a particular state The event driven activity is common to State machine and sequential workflows An event driven activity is a composite activity which behaves like a sequence with some additional attributes Must have the first activity as an activity that receives an event or a delay activity Cannot contain any other activity that receives an event Event Driven Set State Receive Event / Delay Action

Non Blocking Execution of the Event Driven Activity The event driven activity execution in a state machine workflow must be non blocking If the event driven execution is blocked other event may happen which may invalidate the current state and hence the execution of the event handler The state machine workflow enforces this pattern by allowing only one event receive activity

State Machine Workflow Activities The Set State Activity The set state activity causes the actual transition from one state to another The set state activity must be used inside an event driven activity The set state activity must be the last executing activity in the event handler The pattern enforced here is that an event is handled any needed actions performed and then a transition is made There can be multiple set state activities (For e.g. in an if/else activity) but each one of them must be the last one to execute in the event handler

Purchase Order State Machine Workflow a Deeper Look Developing Event Driven State Machine Workflows

Agenda State Machine Workflow Introduction Building State Machine Workflows Recursive Composition Skip and Rework Pattern Additional State Machine Patterns SummaryQ&A

Recursive Composition of States in a State Machine States activities can be recursively composed When a state activity contains other states then that state cannot be transitioned to Transition is only allowed to a leaf level state Recursive composition provides a very powerful design pattern Help in business exception handling Help in reuse of event handlers where the same event needs to be handled in multiple states

PO Process Revisited On Order Changed Order Changed On Order CreatedOn Order Approved Order Created Order Approved Order Shipped On Order Shipped On Order Completed On Order Completed Waiting to Create Order On Order Completed On Order Shipped Order Completed

Recursive State Composition Developing Event Driven State Machine Workflows

Agenda State Machine Workflow Introduction Building State Machine Workflows Recursive Composition Skip and Rework Pattern Additional State Machine Patterns SummaryQ&A

Ability to query the workflow model The ability to query the model is a very crucial is creating effective workflow visualizations State machine workflow offers a robust infrastructure to query and interact with a workflow instance You can answer queries like What is the current state of the workflow? What transitions are possible from the current state? Enumerate all the states in the workflow?

Skip and Rework Patterns Workflow involves ad hoc steps that may not be modeled in advance E.g. In the PO process the PO creator may want to skip the approval action E.g. The PO creator may want to send the PO through an extra approval; The State machine workflow has a built in mechanism to reset the state of the state machine to desired state

On Order Changed Order Changed On Order CreatedOn Order Approved Order Created Order Approved Order Shipped On Order Shipped On Order Completed On Order Completed Waiting to Create Order On Order Completed On Order Shipped Order Completed PO Process – Skip & Rework Set State Event

Skip and Rework Pattern Developing Event Driven State Machine Workflows

Agenda State Machine Workflow Introduction Building State Machine Workflows Recursive Composition Skip and Rework Pattern Additional State Machine Patterns SummaryQ&A

Dynamic Change Patterns Dynamic change is the ability to make structural changes to the process In the state machine dynamic change can be introduced at several levels Add a new state to the state machine Handle a new event in a particular state Rewire the state transitions The dynamic update to the state machine follows the same steps as for a sequential workflow

Multiple State Machines in an application An application is hardly made up of one workflow Multiple workflows work in tandem within an application These workflows can be autonomous but cooperating with each other They synchronize their states but not necessarily control the lifetimes of other workflows Order Fulfillment Application S1 S2 S3 S4 S1 S2 S3 S4 S1 S2 S3 S4 Order Approval Order Shipment WarehouseProcesses

Summary State Machine workflows are a key innovation in WinWF State machine workflows provide a very powerful tool for modeling business applications Use it when the process to be implemented has a lot of human interaction in it The state machine is very easy to query and visualize The state machine model and sequential model and complimentary

Adam Calderon More info on InterKnowlogy More info on InterKnowlogy Contact Information Contact Information Phone: x274 Blog: About Adam Calderon Microsoft ® MVP – C# Microsoft ® ASP.NET (UI Server Frameworks) Advisory Council Developer / Author / Speaker