SlideShare uma empresa Scribd logo
1 de 57
Extending Workflow Foundation
With Custom Activities
            K. Meena
            Director
            SymIndia Training & Consultancy Pvt Ltd
            meena@symindia.com
Agenda
 Need
 Activity Automation
 Creating Simple Activities
    Basic Features
    Advanced Features
 Activity Component Model
 Creating Composite Activities
Objectives and Pre-requisites
 Objectives
   Understand Activity Automation
   Develop Custom activities


 Pre-requisite Knowledge
   WF Architecture
   Experience in designing/developing WF
   based applications
Agenda
 Need
 Activity Automation
 Creating Simple Activities
    Basic Features
    Advanced Features
 Activity Component Model
 Creating Composite Activities
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
Activities: An Extensible
       Approach
                                                                   Domain-Specific
             Base Activity          Custom Activity               Workflow Packages
               Library                 Libraries




                                                               Compliance
                                                                                   CRM
                                 Compose        Extend
                                 activities     activity
             Out-of-Box
Sae          Activities
Fill                                                           RosettaNet
                                       Author new
                                       activity                                   IT Mgmt

   l    General-purpose
   l    Define workflow      l   Create/Extend/
       constructs                Compose activities        l    Vertical-specific activities
                             l   App-specific building          & workflows
                                 blocks
                             l   First-class citizens
Examples
 Credit Process
    Add Customer Profile
    Get Black listed List
    Compute Credit Score



 Mortgage Processing
    Get Flood Insurance Quote
    Compute Tax
    Prioritized Processing of Tasks
WF with other Microsoft
Products
 SharePoint 2007 Designer
     Send Email with List Item Attachments
     Grant Permissions to an item
     Copy List Item
     Delete List Item Permission Assignment
 Microsoft Dynamics CRM 4.0
   Wizard based Workflow Creation
   Custom Activities
     Get the next Birthday
     Calculate Distance between Two zip codes
     Calculate Credit Score
WF with other Microsoft
Products
 Microsoft Speech Server 2007
   CheckVoicePrintExistence
   RegisterSpeakerVoicePrint
   PerformDictation
Agenda
 Need
 Activity Automation
 Basic Features
 Advanced Features
 Activity Component Model
Atomic Work

 Execute     InArgument<Int64> DecimalPlaces
                             Calculate Pi




 Completed    OutArgument<string> PiAsString
Continuation, Long Running, or
Reactive Execution
  Execute            InArgument<string> Question

                                    Prompt




            yield                                  Bookmark   Resume




                    OutArgument<string> Response
  Completed
Composite Activity
   Composite execution
                                 Schedule activity


    Execute
                                                     Authorize
                            Receive Request
                                                      Request

         yield   Process
                 Transfer
                 Request
                                                 Child completed


    Completed
Activity Scheduling Pattern




FIFO dispatch
Scheduler Work Queue
    Holds work items
Non-preemptive behavior
Activity State Model

                                                      Faulting




                                  Canceling



Initialized        Executing                        Closed



                                                             Compensating

   Transition Initiator
                  Workflow Runtime
                  Activity (dashed line if final)
                  Activity Fault
Activity Automation - Basic
   Initialized   Executing         Closed




Activity begins in Initialized state
Runtime Moves it to Executing state when its
work begins
Moves to Closed state when its work is
completed
Agenda
 Need
 Activity Automation
 Creating Simple Activities
    Basic Features
    Advanced Features
 Activity Component Model
 Creating Composite Activities
Derive From Activity Class
  Initialize
      Allocate resources
  Execute
      Do work
      Indicate whether the activity completed its work or not
  UnInitialize
      Cleanup resources allocated during Initialize
  OnClosed
      Cleanup resources allocated during the execution of the
      activity
ActivityExecutionContext
 Execution Environment
    Application State – Activity tree
    Runtime State - internal queues and data
    structures for scheduling and execution
 Selectively exposes
    Workflow runtime capabilities
    Services
Additions
 Custom properties
   Independent
   Dependent
 Custom methods
 Custom Events
Dependency Properties
 Centralized repository of a workflow's state
 Instance type
    Data Binding at runtime
    To another activity’s property
 Meta type of dependency property
    Mandatory to be set to a literal value at design
    time
    Immutable at run time
 Attached Properties
    An activity registers it
    Other activities make use of it
Simple Activity – Basic Features
 Gayathri Kumar
 Director
 SymIndia Training & Consultancy Pvt Ltd
Agenda
 Need
 Activity Automation
 Creating Simple Activities
     Basic Features
     Advanced Features
 Activity Component Model
 Creating Composite Activities
Activity State Model

                                       Faulting




Initialized        Executing         Closed



                                              Compensating

   Transition Initiator
                  Workflow Runtime
                  Activity
                  Activity Fault
Exception Handling
 In case of error
    Activity handles the exception and continues
    Activity does not handle the exception

 Unhandled Exceptions
    Immediate transition to ‘Faulting’ state
    HandleFault method enqueued
    Default implementation moves activity to Closed
    state
      Perform any cleanup work to free resources
      Indicate whether to move to Closed state or not
Exception Handling
 Propagation to parent of the fault activity
    Can be suppressed
    scheduled only when the faulting activity
    transitions to Closed state
Compensation
  Mechanism by which previously
  completed work can be undone or
  compensated
     when a subsequent failure occurs


  Using Transactions to rollback ?
     Not possible when the workflow is long
     running
Scenario
 A travel planning application
    Booking a flight
    Waiting for manager approval
    Paying for the flight

 Long running Process
    Not practical for the steps to participate in the
    same transaction.

 Compensation could be used to undo the
 booking step of the workflow
    if there is a failure later in the processing.
Compensatable Activity
 Implement ICompensatableActivity
   Compensate method
     Short-running or Long running compensation logic
     Indicate readiness to transition to Closed state




 Called when
   The ActivityExecutionState is ‘Succeeded’
   ActivityExecutionStatus to be ‘Closed’
Faulting & Compensation
 Gayathri Kumar
 Director
 SymIndia Training & Consultancy Pvt Ltd
Agenda
 Need
 Activity Automation
 Creating Simple Activities
    Basic Features
    Advanced Features
 Activity Component Model
 Creating Composite Activities
Design Time Experience
 Appearance
 Custom context menus
 Validations
 Dynamic Properties
Activity Component Model
  Each activity has an associated set of components
  Components are associated through attributes on the
  Activity Definition
                                          Designer

                                          Validator

       Services
                           Activity
                                          Serializer

[Designer(typeof(MyDesigner))]             Code
                                          Generator
[CodeGenerator(typeof(MyCodeGen))]
[Validator(typeof(MyValidator))]           Toolbox
                                            Item
public class MyActivity: Activity {...}
Design Time Features
 Gayathri Kumar
 Director
 SymIndia Training & Consultancy Pvt Ltd
Agenda
 Need
 Activity Automation
 Creating Simple Activities
     Basic Features
    Advanced Features
 Activity Component Model
 Creating Composite Activities
Typical Composite Activity Execution

Execute()
             Composite Activity
                          Child
      += OnChildClosed
                         Activity
                            ..
                            ..
                            ..
                          Child
      += OnChildClosed
                         Activity

                                    Status.Closed()
Sequence Activity – Execute()
 protected override ActivityExecutionStatus Execute(ActivityExecutionContext context)
 {
                    if (this.EnabledActivities.Count == 0)
                             return ActivityExecutionStatus.Closed;

                   Activity childActivity = this.EnabledActivities[0];
                   childActivity.Closed += OnClosed;
                   context.ExecuteActivity(childActivity);
                   return ActivityExecutionStatus.Executing;
 }
 Void OnClosed(object sender, ActivityExecutionStatusChangedEventArgs e)
 {
 ActivityExecutionContext context = sender as ActivityExecutionContext ;
 e.Activity.Closed -= this.OnClosed;
 int index = this.EnabledActivities.IndexOf(e.Activity);
 if ( index+1) == this.EnabledActivities.Count)
          context.CloseActivity();
 else
          {
          Activity child = this.EnabledActivities[index+1];
          child.Closed += this.OnClosed;
          context.ExecuteActivity();
          }
 }
Interleaving
  Start all activities in a burst
  Subscribe for Closed Event of all children
  In Closed event handler
     Call CloseActivity only if every child is in Closed
     state (completed)
Sequencing or Interleaving?



WF runtime has no knowledge
Custom Composite
 Derive from
   SequenceActivity
   CompositeActivity
     No default logic for handling child activities
     Override Execute method
Activity State Model

                                                      Faulting




                                  Canceling



Initialized        Executing                        Closed



                                                             Compensating

   Transition Initiator
                  Workflow Runtime
                  Activity (dashed line if final)
                  Activity Fault
Cancellation
 Composite Activity’s Parent invoking
 cancellation

 Faulting
    Logical error within composite activity itself
    One of the child activities has faulted

 Control Flow logic of the composite activity
 Scenario: you try to sell your house
    Thru newspaper ad, thru broker , internet ad
    ‘Any one will do’
Cancellation
 Composite should
    not request any more activities to be executed

 Composite should cancel all activities with
 status as “Executing”
      Each child activity’s Cancel method invoked
      Each Child activity performs cleanup and closes

 Only when all child activities are in either
 ‘Closed’ or in ‘Initialized’ state
    Composite moves to ‘Closed’ state from the
    cancelling state
Cancelling Child activities
 Gayathri Kumar
 Director
 SymIndia Training & Consultancy Pvt Ltd
Dependency Properties -
Attached
 Composite activity registers a property
 It is then used by child activities
 Scenarios
    ConnectionString property for each child activity
    Maximum count / Retry for each child activity
Attached Properties
 Gayathri Kumar
 Director
 SymIndia Training & Consultancy Pvt Ltd
Pegasus Activity Library
 Imaging Activities for WF and MOSS
    deskew, despeckle, border cropping, inverse text
    correction, removal of dot shading, line
    removal, character smoothing
 Scenario : Sharepoint workflow is triggered
 when users add faxed documents to a
 Sharepoint document library.
    Apply despeckle and deskew activities, convert the
    images into PDF format, and forward them to
    users.
Pegasus Activity Library
 Workflow
   Take groups of images from a large microfiche
   image collection
   Tests them for inverted display and negates them if
   needed
   Removes unsightly borders
   Positions the new images on the page
   Saves them as multi-page TIFF files
More Examples
 Repeated Execution of Child Activities
 Prioritized Execution of Child Activities
 GetApprovals
    ‘M’ of ‘N’ will do
 Activities with support for
    Event handling
    Transactions
Summary
 You can extend workflow capabilities with
 Custom Activities
   Simple / Composite
   Custom Semantics / Model domain logic

 Understanding Activity Automation is
 critical to writing custom activities
   Rich Design time Experience
   Normal Execution cycle
   Compensation, Cancellation, Fault Handling
Related Content
 Overview of .NET Framework 4.0
 Dublin: A Boon to WCF and WF Developers (for
 on-premise and cloud)
Resources
 “Essential Windows Workflow Foundation”
     Book by Dharma Shukla and Bob Schmidt


 URLs with relevant Articles
    http://msdn.microsoft.com/en-
    us/magazine/cc163504.aspx
    http://msdn.microsoft.com/en-
    us/library/aa480200.aspx
    http://msdn.microsoft.com/hi-
    in/magazine/cc163414(en-us).aspx
Track Resources
Resource 1



Resource 2



Resource 3



Resource 4
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.
The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should
 not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS,
                                                                           IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Mais conteúdo relacionado

Destaque

PV Optoion 1-Schott Poly 220 240 datasheet
PV Optoion 1-Schott Poly 220 240 datasheetPV Optoion 1-Schott Poly 220 240 datasheet
PV Optoion 1-Schott Poly 220 240 datasheetcathexis123
 
Information network why ithos
Information network  why ithosInformation network  why ithos
Information network why ithoslmljlzc002
 
Actividad Integradorea€
Actividad Integradorea€Actividad Integradorea€
Actividad Integradorea€Daniel Gpe.
 
Estadistica primera evaluación
Estadistica primera evaluaciónEstadistica primera evaluación
Estadistica primera evaluaciónTICpri
 

Destaque (7)

You Need to be Seen as the Cure
You Need to be Seen as the CureYou Need to be Seen as the Cure
You Need to be Seen as the Cure
 
Slide blog 2
Slide  blog 2Slide  blog 2
Slide blog 2
 
Tbi And Dv Facts
Tbi And Dv FactsTbi And Dv Facts
Tbi And Dv Facts
 
PV Optoion 1-Schott Poly 220 240 datasheet
PV Optoion 1-Schott Poly 220 240 datasheetPV Optoion 1-Schott Poly 220 240 datasheet
PV Optoion 1-Schott Poly 220 240 datasheet
 
Information network why ithos
Information network  why ithosInformation network  why ithos
Information network why ithos
 
Actividad Integradorea€
Actividad Integradorea€Actividad Integradorea€
Actividad Integradorea€
 
Estadistica primera evaluación
Estadistica primera evaluaciónEstadistica primera evaluación
Estadistica primera evaluación
 

Semelhante a Extending Workflow Foundation With Custom Activities

Building workflow solution with Microsoft Azure and Cloud | Integration Monday
Building workflow solution with Microsoft Azure and Cloud | Integration MondayBuilding workflow solution with Microsoft Azure and Cloud | Integration Monday
Building workflow solution with Microsoft Azure and Cloud | Integration MondayBizTalk360
 
BPM Suite 12c Launch - Focus on Developer Productivity
BPM Suite 12c Launch - Focus on Developer ProductivityBPM Suite 12c Launch - Focus on Developer Productivity
BPM Suite 12c Launch - Focus on Developer ProductivityLucas Jellema
 
Rule Based Asset Management Workflow Automation at Netflix
Rule Based Asset Management Workflow Automation at NetflixRule Based Asset Management Workflow Automation at Netflix
Rule Based Asset Management Workflow Automation at NetflixHostedbyConfluent
 
Spring batch showCase
Spring batch showCaseSpring batch showCase
Spring batch showCasetaher abdo
 
Developing for Remote Bamboo Agents, AtlasCamp US 2012
Developing for Remote Bamboo Agents, AtlasCamp US 2012Developing for Remote Bamboo Agents, AtlasCamp US 2012
Developing for Remote Bamboo Agents, AtlasCamp US 2012Atlassian
 
Дамир Тенишев Exigen Services Business Processes Storehouse
Дамир Тенишев Exigen Services Business Processes StorehouseДамир Тенишев Exigen Services Business Processes Storehouse
Дамир Тенишев Exigen Services Business Processes StorehouseТранслируем.бел
 
Spstc2011 Developing Reusable Workflow Features
Spstc2011   Developing Reusable Workflow FeaturesSpstc2011   Developing Reusable Workflow Features
Spstc2011 Developing Reusable Workflow FeaturesMichael Oryszak
 
Behavior Driven Development by Example
Behavior Driven Development by ExampleBehavior Driven Development by Example
Behavior Driven Development by ExampleNalin Goonawardana
 
[NDC 2019] Enterprise-Grade Serverless
[NDC 2019] Enterprise-Grade Serverless[NDC 2019] Enterprise-Grade Serverless
[NDC 2019] Enterprise-Grade ServerlessKatyShimizu
 
[NDC 2019] Functions 2.0: Enterprise-Grade Serverless
[NDC 2019] Functions 2.0: Enterprise-Grade Serverless[NDC 2019] Functions 2.0: Enterprise-Grade Serverless
[NDC 2019] Functions 2.0: Enterprise-Grade ServerlessKatyShimizu
 
O365Con19 - Developing Timerjob and Eventhandler Equivalents - Adis Jugo
O365Con19 - Developing Timerjob and Eventhandler Equivalents - Adis JugoO365Con19 - Developing Timerjob and Eventhandler Equivalents - Adis Jugo
O365Con19 - Developing Timerjob and Eventhandler Equivalents - Adis JugoNCCOMMS
 
The cornerstones of SAP workflow
The cornerstones of SAP workflowThe cornerstones of SAP workflow
The cornerstones of SAP workflowNorikkon, LLC.
 
Want More Out of your SharePoint Environment? Extend your SharePoint Environm...
Want More Out of your SharePoint Environment? Extend your SharePoint Environm...Want More Out of your SharePoint Environment? Extend your SharePoint Environm...
Want More Out of your SharePoint Environment? Extend your SharePoint Environm...EPM Live
 
Process State vs. Object State: Modeling Best Practices for Simple Workflows ...
Process State vs. Object State: Modeling Best Practices for Simple Workflows ...Process State vs. Object State: Modeling Best Practices for Simple Workflows ...
Process State vs. Object State: Modeling Best Practices for Simple Workflows ...Thorsten Franz
 

Semelhante a Extending Workflow Foundation With Custom Activities (20)

Building workflow solution with Microsoft Azure and Cloud | Integration Monday
Building workflow solution with Microsoft Azure and Cloud | Integration MondayBuilding workflow solution with Microsoft Azure and Cloud | Integration Monday
Building workflow solution with Microsoft Azure and Cloud | Integration Monday
 
SOA_BPM_12c_launch_event_BPM_track_developer_productivity_lucasjellema
SOA_BPM_12c_launch_event_BPM_track_developer_productivity_lucasjellemaSOA_BPM_12c_launch_event_BPM_track_developer_productivity_lucasjellema
SOA_BPM_12c_launch_event_BPM_track_developer_productivity_lucasjellema
 
BPM Suite 12c Launch - Focus on Developer Productivity
BPM Suite 12c Launch - Focus on Developer ProductivityBPM Suite 12c Launch - Focus on Developer Productivity
BPM Suite 12c Launch - Focus on Developer Productivity
 
Rule Based Asset Management Workflow Automation at Netflix
Rule Based Asset Management Workflow Automation at NetflixRule Based Asset Management Workflow Automation at Netflix
Rule Based Asset Management Workflow Automation at Netflix
 
Spring batch showCase
Spring batch showCaseSpring batch showCase
Spring batch showCase
 
Developing for Remote Bamboo Agents, AtlasCamp US 2012
Developing for Remote Bamboo Agents, AtlasCamp US 2012Developing for Remote Bamboo Agents, AtlasCamp US 2012
Developing for Remote Bamboo Agents, AtlasCamp US 2012
 
SAP workflow events
SAP workflow eventsSAP workflow events
SAP workflow events
 
Дамир Тенишев Exigen Services Business Processes Storehouse
Дамир Тенишев Exigen Services Business Processes StorehouseДамир Тенишев Exigen Services Business Processes Storehouse
Дамир Тенишев Exigen Services Business Processes Storehouse
 
Spstc2011 Developing Reusable Workflow Features
Spstc2011   Developing Reusable Workflow FeaturesSpstc2011   Developing Reusable Workflow Features
Spstc2011 Developing Reusable Workflow Features
 
Lets focus on business value
Lets focus on business valueLets focus on business value
Lets focus on business value
 
Lets focus on business value
Lets focus on business valueLets focus on business value
Lets focus on business value
 
Behavior Driven Development by Example
Behavior Driven Development by ExampleBehavior Driven Development by Example
Behavior Driven Development by Example
 
[NDC 2019] Enterprise-Grade Serverless
[NDC 2019] Enterprise-Grade Serverless[NDC 2019] Enterprise-Grade Serverless
[NDC 2019] Enterprise-Grade Serverless
 
[NDC 2019] Functions 2.0: Enterprise-Grade Serverless
[NDC 2019] Functions 2.0: Enterprise-Grade Serverless[NDC 2019] Functions 2.0: Enterprise-Grade Serverless
[NDC 2019] Functions 2.0: Enterprise-Grade Serverless
 
O365Con19 - Developing Timerjob and Eventhandler Equivalents - Adis Jugo
O365Con19 - Developing Timerjob and Eventhandler Equivalents - Adis JugoO365Con19 - Developing Timerjob and Eventhandler Equivalents - Adis Jugo
O365Con19 - Developing Timerjob and Eventhandler Equivalents - Adis Jugo
 
The cornerstones of SAP workflow
The cornerstones of SAP workflowThe cornerstones of SAP workflow
The cornerstones of SAP workflow
 
Durable functions
Durable functionsDurable functions
Durable functions
 
Shift_Left
Shift_LeftShift_Left
Shift_Left
 
Want More Out of your SharePoint Environment? Extend your SharePoint Environm...
Want More Out of your SharePoint Environment? Extend your SharePoint Environm...Want More Out of your SharePoint Environment? Extend your SharePoint Environm...
Want More Out of your SharePoint Environment? Extend your SharePoint Environm...
 
Process State vs. Object State: Modeling Best Practices for Simple Workflows ...
Process State vs. Object State: Modeling Best Practices for Simple Workflows ...Process State vs. Object State: Modeling Best Practices for Simple Workflows ...
Process State vs. Object State: Modeling Best Practices for Simple Workflows ...
 

Mais de rsnarayanan

Kevin Ms Web Platform
Kevin Ms Web PlatformKevin Ms Web Platform
Kevin Ms Web Platformrsnarayanan
 
Harish Understanding Aspnet
Harish Understanding AspnetHarish Understanding Aspnet
Harish Understanding Aspnetrsnarayanan
 
Harish Aspnet Dynamic Data
Harish Aspnet Dynamic DataHarish Aspnet Dynamic Data
Harish Aspnet Dynamic Datarsnarayanan
 
Harish Aspnet Deployment
Harish Aspnet DeploymentHarish Aspnet Deployment
Harish Aspnet Deploymentrsnarayanan
 
Whats New In Sl3
Whats New In Sl3Whats New In Sl3
Whats New In Sl3rsnarayanan
 
Silverlight And .Net Ria Services – Building Lob And Business Applications Wi...
Silverlight And .Net Ria Services – Building Lob And Business Applications Wi...Silverlight And .Net Ria Services – Building Lob And Business Applications Wi...
Silverlight And .Net Ria Services – Building Lob And Business Applications Wi...rsnarayanan
 
Advanced Silverlight
Advanced SilverlightAdvanced Silverlight
Advanced Silverlightrsnarayanan
 
Occasionally Connected Systems
Occasionally Connected SystemsOccasionally Connected Systems
Occasionally Connected Systemsrsnarayanan
 
Developing Php Applications Using Microsoft Software And Services
Developing Php Applications Using Microsoft Software And ServicesDeveloping Php Applications Using Microsoft Software And Services
Developing Php Applications Using Microsoft Software And Servicesrsnarayanan
 
Build Mission Critical Applications On The Microsoft Platform Using Eclipse J...
Build Mission Critical Applications On The Microsoft Platform Using Eclipse J...Build Mission Critical Applications On The Microsoft Platform Using Eclipse J...
Build Mission Critical Applications On The Microsoft Platform Using Eclipse J...rsnarayanan
 
J Query The Write Less Do More Javascript Library
J Query   The Write Less Do More Javascript LibraryJ Query   The Write Less Do More Javascript Library
J Query The Write Less Do More Javascript Libraryrsnarayanan
 
Ms Sql Business Inteligence With My Sql
Ms Sql Business Inteligence With My SqlMs Sql Business Inteligence With My Sql
Ms Sql Business Inteligence With My Sqlrsnarayanan
 
Windows 7 For Developers
Windows 7 For DevelopersWindows 7 For Developers
Windows 7 For Developersrsnarayanan
 
What Is New In Wpf 3.5 Sp1
What Is New In Wpf 3.5 Sp1What Is New In Wpf 3.5 Sp1
What Is New In Wpf 3.5 Sp1rsnarayanan
 
Ux For Developers
Ux For DevelopersUx For Developers
Ux For Developersrsnarayanan
 
A Lap Around Internet Explorer 8
A Lap Around Internet Explorer 8A Lap Around Internet Explorer 8
A Lap Around Internet Explorer 8rsnarayanan
 

Mais de rsnarayanan (20)

Walther Aspnet4
Walther Aspnet4Walther Aspnet4
Walther Aspnet4
 
Walther Ajax4
Walther Ajax4Walther Ajax4
Walther Ajax4
 
Kevin Ms Web Platform
Kevin Ms Web PlatformKevin Ms Web Platform
Kevin Ms Web Platform
 
Harish Understanding Aspnet
Harish Understanding AspnetHarish Understanding Aspnet
Harish Understanding Aspnet
 
Walther Mvc
Walther MvcWalther Mvc
Walther Mvc
 
Harish Aspnet Dynamic Data
Harish Aspnet Dynamic DataHarish Aspnet Dynamic Data
Harish Aspnet Dynamic Data
 
Harish Aspnet Deployment
Harish Aspnet DeploymentHarish Aspnet Deployment
Harish Aspnet Deployment
 
Whats New In Sl3
Whats New In Sl3Whats New In Sl3
Whats New In Sl3
 
Silverlight And .Net Ria Services – Building Lob And Business Applications Wi...
Silverlight And .Net Ria Services – Building Lob And Business Applications Wi...Silverlight And .Net Ria Services – Building Lob And Business Applications Wi...
Silverlight And .Net Ria Services – Building Lob And Business Applications Wi...
 
Advanced Silverlight
Advanced SilverlightAdvanced Silverlight
Advanced Silverlight
 
Netcf Gc
Netcf GcNetcf Gc
Netcf Gc
 
Occasionally Connected Systems
Occasionally Connected SystemsOccasionally Connected Systems
Occasionally Connected Systems
 
Developing Php Applications Using Microsoft Software And Services
Developing Php Applications Using Microsoft Software And ServicesDeveloping Php Applications Using Microsoft Software And Services
Developing Php Applications Using Microsoft Software And Services
 
Build Mission Critical Applications On The Microsoft Platform Using Eclipse J...
Build Mission Critical Applications On The Microsoft Platform Using Eclipse J...Build Mission Critical Applications On The Microsoft Platform Using Eclipse J...
Build Mission Critical Applications On The Microsoft Platform Using Eclipse J...
 
J Query The Write Less Do More Javascript Library
J Query   The Write Less Do More Javascript LibraryJ Query   The Write Less Do More Javascript Library
J Query The Write Less Do More Javascript Library
 
Ms Sql Business Inteligence With My Sql
Ms Sql Business Inteligence With My SqlMs Sql Business Inteligence With My Sql
Ms Sql Business Inteligence With My Sql
 
Windows 7 For Developers
Windows 7 For DevelopersWindows 7 For Developers
Windows 7 For Developers
 
What Is New In Wpf 3.5 Sp1
What Is New In Wpf 3.5 Sp1What Is New In Wpf 3.5 Sp1
What Is New In Wpf 3.5 Sp1
 
Ux For Developers
Ux For DevelopersUx For Developers
Ux For Developers
 
A Lap Around Internet Explorer 8
A Lap Around Internet Explorer 8A Lap Around Internet Explorer 8
A Lap Around Internet Explorer 8
 

Último

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 

Último (20)

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

Extending Workflow Foundation With Custom Activities

  • 1.
  • 2. Extending Workflow Foundation With Custom Activities K. Meena Director SymIndia Training & Consultancy Pvt Ltd meena@symindia.com
  • 3. Agenda Need Activity Automation Creating Simple Activities Basic Features Advanced Features Activity Component Model Creating Composite Activities
  • 4. Objectives and Pre-requisites Objectives Understand Activity Automation Develop Custom activities Pre-requisite Knowledge WF Architecture Experience in designing/developing WF based applications
  • 5. Agenda Need Activity Automation Creating Simple Activities Basic Features Advanced Features Activity Component Model Creating Composite Activities
  • 6. 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
  • 7. Activities: An Extensible Approach Domain-Specific Base Activity Custom Activity Workflow Packages Library Libraries Compliance CRM Compose Extend activities activity Out-of-Box Sae Activities Fill RosettaNet Author new activity IT Mgmt l General-purpose l Define workflow l Create/Extend/ constructs Compose activities l Vertical-specific activities l App-specific building & workflows blocks l First-class citizens
  • 8. Examples Credit Process Add Customer Profile Get Black listed List Compute Credit Score Mortgage Processing Get Flood Insurance Quote Compute Tax Prioritized Processing of Tasks
  • 9. WF with other Microsoft Products SharePoint 2007 Designer Send Email with List Item Attachments Grant Permissions to an item Copy List Item Delete List Item Permission Assignment Microsoft Dynamics CRM 4.0 Wizard based Workflow Creation Custom Activities Get the next Birthday Calculate Distance between Two zip codes Calculate Credit Score
  • 10. WF with other Microsoft Products Microsoft Speech Server 2007 CheckVoicePrintExistence RegisterSpeakerVoicePrint PerformDictation
  • 11. Agenda Need Activity Automation Basic Features Advanced Features Activity Component Model
  • 12. Atomic Work Execute InArgument<Int64> DecimalPlaces Calculate Pi Completed OutArgument<string> PiAsString
  • 13. Continuation, Long Running, or Reactive Execution Execute InArgument<string> Question Prompt yield Bookmark Resume OutArgument<string> Response Completed
  • 14. Composite Activity Composite execution Schedule activity Execute Authorize Receive Request Request yield Process Transfer Request Child completed Completed
  • 15. Activity Scheduling Pattern FIFO dispatch Scheduler Work Queue Holds work items Non-preemptive behavior
  • 16. Activity State Model Faulting Canceling Initialized Executing Closed Compensating Transition Initiator Workflow Runtime Activity (dashed line if final) Activity Fault
  • 17. Activity Automation - Basic Initialized Executing Closed Activity begins in Initialized state Runtime Moves it to Executing state when its work begins Moves to Closed state when its work is completed
  • 18. Agenda Need Activity Automation Creating Simple Activities Basic Features Advanced Features Activity Component Model Creating Composite Activities
  • 19. Derive From Activity Class Initialize Allocate resources Execute Do work Indicate whether the activity completed its work or not UnInitialize Cleanup resources allocated during Initialize OnClosed Cleanup resources allocated during the execution of the activity
  • 20. ActivityExecutionContext Execution Environment Application State – Activity tree Runtime State - internal queues and data structures for scheduling and execution Selectively exposes Workflow runtime capabilities Services
  • 21. Additions Custom properties Independent Dependent Custom methods Custom Events
  • 22. Dependency Properties Centralized repository of a workflow's state Instance type Data Binding at runtime To another activity’s property Meta type of dependency property Mandatory to be set to a literal value at design time Immutable at run time Attached Properties An activity registers it Other activities make use of it
  • 23. Simple Activity – Basic Features Gayathri Kumar Director SymIndia Training & Consultancy Pvt Ltd
  • 24. Agenda Need Activity Automation Creating Simple Activities Basic Features Advanced Features Activity Component Model Creating Composite Activities
  • 25. Activity State Model Faulting Initialized Executing Closed Compensating Transition Initiator Workflow Runtime Activity Activity Fault
  • 26. Exception Handling In case of error Activity handles the exception and continues Activity does not handle the exception Unhandled Exceptions Immediate transition to ‘Faulting’ state HandleFault method enqueued Default implementation moves activity to Closed state Perform any cleanup work to free resources Indicate whether to move to Closed state or not
  • 27. Exception Handling Propagation to parent of the fault activity Can be suppressed scheduled only when the faulting activity transitions to Closed state
  • 28. Compensation Mechanism by which previously completed work can be undone or compensated when a subsequent failure occurs Using Transactions to rollback ? Not possible when the workflow is long running
  • 29. Scenario A travel planning application Booking a flight Waiting for manager approval Paying for the flight Long running Process Not practical for the steps to participate in the same transaction. Compensation could be used to undo the booking step of the workflow if there is a failure later in the processing.
  • 30. Compensatable Activity Implement ICompensatableActivity Compensate method Short-running or Long running compensation logic Indicate readiness to transition to Closed state Called when The ActivityExecutionState is ‘Succeeded’ ActivityExecutionStatus to be ‘Closed’
  • 31. Faulting & Compensation Gayathri Kumar Director SymIndia Training & Consultancy Pvt Ltd
  • 32. Agenda Need Activity Automation Creating Simple Activities Basic Features Advanced Features Activity Component Model Creating Composite Activities
  • 33. Design Time Experience Appearance Custom context menus Validations Dynamic Properties
  • 34. Activity Component Model Each activity has an associated set of components Components are associated through attributes on the Activity Definition Designer Validator Services Activity Serializer [Designer(typeof(MyDesigner))] Code Generator [CodeGenerator(typeof(MyCodeGen))] [Validator(typeof(MyValidator))] Toolbox Item public class MyActivity: Activity {...}
  • 35. Design Time Features Gayathri Kumar Director SymIndia Training & Consultancy Pvt Ltd
  • 36. Agenda Need Activity Automation Creating Simple Activities Basic Features Advanced Features Activity Component Model Creating Composite Activities
  • 37. Typical Composite Activity Execution Execute() Composite Activity Child += OnChildClosed Activity .. .. .. Child += OnChildClosed Activity Status.Closed()
  • 38. Sequence Activity – Execute() protected override ActivityExecutionStatus Execute(ActivityExecutionContext context) { if (this.EnabledActivities.Count == 0) return ActivityExecutionStatus.Closed; Activity childActivity = this.EnabledActivities[0]; childActivity.Closed += OnClosed; context.ExecuteActivity(childActivity); return ActivityExecutionStatus.Executing; } Void OnClosed(object sender, ActivityExecutionStatusChangedEventArgs e) { ActivityExecutionContext context = sender as ActivityExecutionContext ; e.Activity.Closed -= this.OnClosed; int index = this.EnabledActivities.IndexOf(e.Activity); if ( index+1) == this.EnabledActivities.Count) context.CloseActivity(); else { Activity child = this.EnabledActivities[index+1]; child.Closed += this.OnClosed; context.ExecuteActivity(); } }
  • 39. Interleaving Start all activities in a burst Subscribe for Closed Event of all children In Closed event handler Call CloseActivity only if every child is in Closed state (completed)
  • 40. Sequencing or Interleaving? WF runtime has no knowledge
  • 41. Custom Composite Derive from SequenceActivity CompositeActivity No default logic for handling child activities Override Execute method
  • 42. Activity State Model Faulting Canceling Initialized Executing Closed Compensating Transition Initiator Workflow Runtime Activity (dashed line if final) Activity Fault
  • 43. Cancellation Composite Activity’s Parent invoking cancellation Faulting Logical error within composite activity itself One of the child activities has faulted Control Flow logic of the composite activity Scenario: you try to sell your house Thru newspaper ad, thru broker , internet ad ‘Any one will do’
  • 44. Cancellation Composite should not request any more activities to be executed Composite should cancel all activities with status as “Executing” Each child activity’s Cancel method invoked Each Child activity performs cleanup and closes Only when all child activities are in either ‘Closed’ or in ‘Initialized’ state Composite moves to ‘Closed’ state from the cancelling state
  • 45. Cancelling Child activities Gayathri Kumar Director SymIndia Training & Consultancy Pvt Ltd
  • 46. Dependency Properties - Attached Composite activity registers a property It is then used by child activities Scenarios ConnectionString property for each child activity Maximum count / Retry for each child activity
  • 47. Attached Properties Gayathri Kumar Director SymIndia Training & Consultancy Pvt Ltd
  • 48. Pegasus Activity Library Imaging Activities for WF and MOSS deskew, despeckle, border cropping, inverse text correction, removal of dot shading, line removal, character smoothing Scenario : Sharepoint workflow is triggered when users add faxed documents to a Sharepoint document library. Apply despeckle and deskew activities, convert the images into PDF format, and forward them to users.
  • 49. Pegasus Activity Library Workflow Take groups of images from a large microfiche image collection Tests them for inverted display and negates them if needed Removes unsightly borders Positions the new images on the page Saves them as multi-page TIFF files
  • 50. More Examples Repeated Execution of Child Activities Prioritized Execution of Child Activities GetApprovals ‘M’ of ‘N’ will do Activities with support for Event handling Transactions
  • 51. Summary You can extend workflow capabilities with Custom Activities Simple / Composite Custom Semantics / Model domain logic Understanding Activity Automation is critical to writing custom activities Rich Design time Experience Normal Execution cycle Compensation, Cancellation, Fault Handling
  • 52.
  • 53.
  • 54. Related Content Overview of .NET Framework 4.0 Dublin: A Boon to WCF and WF Developers (for on-premise and cloud)
  • 55. Resources “Essential Windows Workflow Foundation” Book by Dharma Shukla and Bob Schmidt URLs with relevant Articles http://msdn.microsoft.com/en- us/magazine/cc163504.aspx http://msdn.microsoft.com/en- us/library/aa480200.aspx http://msdn.microsoft.com/hi- in/magazine/cc163414(en-us).aspx
  • 56. Track Resources Resource 1 Resource 2 Resource 3 Resource 4
  • 57. © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.