Introduction To Windows Workflow Foundation 4.0

14
WINDO WS WO RKFLOW FOUNDATION 4 Meli ck Raj ee B ar anas oor iya http://melick- rajee.blogspo t.com/

description

Session conducted in .NET user group

Transcript of Introduction To Windows Workflow Foundation 4.0

Page 1: Introduction To Windows Workflow Foundation 4.0

WIN

DOWS W

ORKFLOW

FOUNDAT

ION 4

Mel

ick

Rajee

Bar

anas

ooriy

a

http://

mel

ick-

raje

e.blo

gspot

.com

/

Page 2: Introduction To Windows Workflow Foundation 4.0

WHY WORKFLOWS ?

• Programming model

• Enabling workflow within line-of-business applications

• User-interface page flows

• Document-centric workflows

• Human workflows

• Composite workflows for service-oriented applications

• Business rule-driven workflows

• Workflows for systems management

Page 3: Introduction To Windows Workflow Foundation 4.0

WHAT IS WORKFLOW ?

• A workflow is a set of elemental units

• called activities 

• Activities describes a real-world process

• Activity Stores Data using

• Variable

• Argument

• Expression

• Describing the order of execution and dependent relationship

• Work passes through the model from start to finish

Page 4: Introduction To Windows Workflow Foundation 4.0

WORKFLOW MODELS

Sequential Activity Workflow start To end No Go back One after the other

State machine Activity Workflow Only States Transitions

when true

Page 5: Introduction To Windows Workflow Foundation 4.0

ACTIVITY OVERVIEW

• Developed as a CLR type• Activity• An abstract base class used to create composite activities

• Code Activity• An abstract class for creating a custom activity with imperative

behavior defined with the Execute method

• Async Code Activity• Abstract Class that manages asynchronous code activity execution

from start to completion

• Native Activity• An Abstract base class for custom activities that implement execution

logic using the Execute method, which has full access to the runtime’s features.

Page 6: Introduction To Windows Workflow Foundation 4.0

ACTIVITY LIFE CYCLE

• Activity Context• Classes that represent the execution environment of an activity

• Starts with Executing• Closed

• The activity has completed its work and exited• Canceled

• The activity has gracefully abandoned its work and exited. Work is not explicitly rolled back when this state is entered

• Faulted• The activity has encountered an error and has exited without

completing its work

Page 7: Introduction To Windows Workflow Foundation 4.0

WORK FLOW RUNTIME

•  is the environment in which workflows execute

• Few methods of executing

• WorkflowInvoker• which invokes the workflow like a method.

• WorkflowApplication • explicit control over the execution of a single workflow instance.

• WorkflowServiceHost • message-based interactions in multi-instance scenarios.

Page 8: Introduction To Windows Workflow Foundation 4.0

WORKFLOW EXECUTION

Invoker Method

WorkflowApplication• Events• Completed• Aborted• Idle

Page 9: Introduction To Windows Workflow Foundation 4.0

DEMO

Page 10: Introduction To Windows Workflow Foundation 4.0

PASSING PARAMETERS - IN

Property Method

IDictionary Method

Page 11: Introduction To Windows Workflow Foundation 4.0

PASSING PARAMETERS - OUT

Using Application

Using Invoker

Page 12: Introduction To Windows Workflow Foundation 4.0

CUSTOM ACTIVITIES

• Set of Reusable Activities

• Apply Same Workflow Rules

• Can have design interface

• Can have validation

• Override Metadata Cache

Page 13: Introduction To Windows Workflow Foundation 4.0

DEMO

Page 14: Introduction To Windows Workflow Foundation 4.0

THANK

YOU