implementing workflow patterns with business process ...€¦ · implementing workflow patterns...

39
® IBM Software Group © 2003 IBM Corporation Implementing Workflow Patterns with Business Process Choreography

Upload: nguyendiep

Post on 04-Jun-2018

241 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Implementing Workflow Patterns with Business Process ...€¦ · Implementing Workflow Patterns with Business Process Choreography. IBM Software Group | WebSphere software Workflow

®

IBM Software Group

© 2003 IBM Corporation

Implementing Workflow Patternswith Business Process Choreography

Page 2: Implementing Workflow Patterns with Business Process ...€¦ · Implementing Workflow Patterns with Business Process Choreography. IBM Software Group | WebSphere software Workflow

IBM Software Group | WebSphere software

Workflow Patterns – Objectives

Describe workflow patterns implementationThe patterns themselves (conceptual)Implementation of these patterns in BPEL4WS & BPC v5.1

Equivalent implementations/options in BPEL4WS & BPC v5.1Differences between Long-running & Non-interruptible processes

After this presentation you should...Be able to recognize simple patterns in business processesBe able to use this presentation and its samples as a jump-start to implement specific business processes

Page 3: Implementing Workflow Patterns with Business Process ...€¦ · Implementing Workflow Patterns with Business Process Choreography. IBM Software Group | WebSphere software Workflow

IBM Software Group | WebSphere software

Workflow Patterns – Agenda

Terms

Workflow PatternsBasic Control Flow Patterns (5)Structural Patterns (2)Cancellation Patterns (2)Communication Patterns (2)State based Patterns (3)Advanced Branching and Synchronization Patterns (5)Patterns with multiple instances (4)

Summary

Page 4: Implementing Workflow Patterns with Business Process ...€¦ · Implementing Workflow Patterns with Business Process Choreography. IBM Software Group | WebSphere software Workflow

IBM Software Group | WebSphere software

Workflow Patterns – TermsSynonyms, Abbreviations & Similar meanings

BranchPath or Execution PathThread of Control

Long-Running Process (LR)

Non-Interruptible (NI)

Synchronous interfaceRequest - ResponseInput - Output

Asynchronous interfaceCall – CallbackFire and Forget

Page 5: Implementing Workflow Patterns with Business Process ...€¦ · Implementing Workflow Patterns with Business Process Choreography. IBM Software Group | WebSphere software Workflow

IBM Software Group | WebSphere software

Workflow Patterns

Basic Control Flow Patterns (5)SequenceParallel SplitSynchronizationExclusive ChoiceSimple Merge

Structural Patterns (2)Cancellation Patterns (2)Communication Patterns (2)State based Patterns (3)

Page 6: Implementing Workflow Patterns with Business Process ...€¦ · Implementing Workflow Patterns with Business Process Choreography. IBM Software Group | WebSphere software Workflow

IBM Software Group | WebSphere software

Sequence

ContextActivities may depend on other activities

ProblemSome activities may have to wait until other activities complete

SolutionUse sequenceOr flow

plus links or joinConditions that evaluate to true

Page 7: Implementing Workflow Patterns with Business Process ...€¦ · Implementing Workflow Patterns with Business Process Choreography. IBM Software Group | WebSphere software Workflow

IBM Software Group | WebSphere software

Sequence Example

part

partpart

Page 8: Implementing Workflow Patterns with Business Process ...€¦ · Implementing Workflow Patterns with Business Process Choreography. IBM Software Group | WebSphere software Workflow

IBM Software Group | WebSphere software

Parallel Split

ContextActivities have no direct dependencies and parallel execution is required (LR)

ProblemA single thread of control has to split into 2 or more different execution paths (branches)

SolutionUse links

Or flow

Page 9: Implementing Workflow Patterns with Business Process ...€¦ · Implementing Workflow Patterns with Business Process Choreography. IBM Software Group | WebSphere software Workflow

IBM Software Group | WebSphere software

Parallel Split

see next slide...

Page 10: Implementing Workflow Patterns with Business Process ...€¦ · Implementing Workflow Patterns with Business Process Choreography. IBM Software Group | WebSphere software Workflow

IBM Software Group | WebSphere software

Synchronization

ContextMultiple branches need to converge into a single execution path (LR)

ProblemSynchronize parallel execution paths

SolutionUse links in flows

Or continue after flow

Page 11: Implementing Workflow Patterns with Business Process ...€¦ · Implementing Workflow Patterns with Business Process Choreography. IBM Software Group | WebSphere software Workflow

IBM Software Group | WebSphere software

Exclusive Choice

ContextDifferent paths need to be chosen based on a condition

ProblemDecide which path to go and trigger one path only

SolutionUse switch

Page 12: Implementing Workflow Patterns with Business Process ...€¦ · Implementing Workflow Patterns with Business Process Choreography. IBM Software Group | WebSphere software Workflow

IBM Software Group | WebSphere software

Simple Merge (1)

ContextThere are multiple execution paths, only one is executed

ProblemWe need a merge point

SolutionUse switch within a sequenceOr, use switch within a flow and continue with link

Page 13: Implementing Workflow Patterns with Business Process ...€¦ · Implementing Workflow Patterns with Business Process Choreography. IBM Software Group | WebSphere software Workflow

IBM Software Group | WebSphere software

Simple Merge (2)

If modeled with exclusive conditions this flow results in the same behavior as the previous one

Note: there are several options to model a specific pattern

choose the simplest oneto designto understand

JoinBehaviour/JoinConditionor Links evaluated

Page 14: Implementing Workflow Patterns with Business Process ...€¦ · Implementing Workflow Patterns with Business Process Choreography. IBM Software Group | WebSphere software Workflow

IBM Software Group | WebSphere software

Workflow Patterns

Basic Control Flow Patterns (5)

Structural Patterns (2)Arbitrary CyclesImplicit Termination

Cancellation Patterns (2)

Communication Patterns (2)

State based Patterns (3)

Page 15: Implementing Workflow Patterns with Business Process ...€¦ · Implementing Workflow Patterns with Business Process Choreography. IBM Software Group | WebSphere software Workflow

IBM Software Group | WebSphere software

Arbitrary Cycles

ContextA set of activities needs to be executed multiple times

ProblemSpecific entry points are necessary as starting points for the execution of a pathExiting the path requires additional activities or information

SolutionYou cannot realize this pattern with BPEL4WS; however, structured cycles are possible with while activities

Page 16: Implementing Workflow Patterns with Business Process ...€¦ · Implementing Workflow Patterns with Business Process Choreography. IBM Software Group | WebSphere software Workflow

IBM Software Group | WebSphere software

Implicit Termination

ContextThe workflow engine (BP Engine) must determine when a process has ended

ProblemThere may be processes that have no reply or terminate activity

SolutionImplicit termination is provided with BPEL4WS, terminate is not required to end a process

Page 17: Implementing Workflow Patterns with Business Process ...€¦ · Implementing Workflow Patterns with Business Process Choreography. IBM Software Group | WebSphere software Workflow

IBM Software Group | WebSphere software

Workflow Patterns

Basic Control Flow Patterns (5)

Structural Patterns (2)

Cancellation Patterns (2)Cancel ActivityCancel Case

Communication Patterns (2)

State based Patterns (3)

Page 18: Implementing Workflow Patterns with Business Process ...€¦ · Implementing Workflow Patterns with Business Process Choreography. IBM Software Group | WebSphere software Workflow

IBM Software Group | WebSphere software

Cancel Activity

ContextSome scenarios require that activities are disabled for some reason

ProblemSkip activities based on conditions

SolutionUse flow and

Decide with links & its conditionsLet the join condition decide

Use switch

Page 19: Implementing Workflow Patterns with Business Process ...€¦ · Implementing Workflow Patterns with Business Process Choreography. IBM Software Group | WebSphere software Workflow

IBM Software Group | WebSphere software

Cancel Case

ContextThe execution of a process be must stopped. Running activities will be stopped immediately as well.

ProblemThere may be sub-processes running that may need to be stopped as wellOnly child sub-processes will be stopped

SolutionUse terminate

Page 20: Implementing Workflow Patterns with Business Process ...€¦ · Implementing Workflow Patterns with Business Process Choreography. IBM Software Group | WebSphere software Workflow

IBM Software Group | WebSphere software

Workflow Patterns – Agenda

Basic Control Flow Patterns (5)

Structural Patterns (2)

Cancellation Patterns (2)

Communication Patterns (2)Request/ReplyOne-Way

State based Patterns (3)

Page 21: Implementing Workflow Patterns with Business Process ...€¦ · Implementing Workflow Patterns with Business Process Choreography. IBM Software Group | WebSphere software Workflow

IBM Software Group | WebSphere software

Request / Response & One-Way

ContextCommunication between processes, talking to web services

ProblemUse of input/output and input-only operations with BPEL4WS

SolutionSee picture

start

notify

requestInforesponseInfostartResponse

Page 22: Implementing Workflow Patterns with Business Process ...€¦ · Implementing Workflow Patterns with Business Process Choreography. IBM Software Group | WebSphere software Workflow

IBM Software Group | WebSphere software

Workflow Patterns

Basic Control Flow Patterns (5)

Structural Patterns (2)

Cancellation Patterns (2)

Communication Patterns (2)

State based Patterns (3)Deferred ChoiceInterleaved Parallel RoutingMilestone

Page 23: Implementing Workflow Patterns with Business Process ...€¦ · Implementing Workflow Patterns with Business Process Choreography. IBM Software Group | WebSphere software Workflow

IBM Software Group | WebSphere software

Deferred Choice (LR)

ContextThe modeler cannot model the process such that a particular branch can be chosen based on the data available to the process

ProblemA particular branch must be chosen (compare choice pattern) based on a decision not influenced by the process model

SolutionUse pick

Page 24: Implementing Workflow Patterns with Business Process ...€¦ · Implementing Workflow Patterns with Business Process Choreography. IBM Software Group | WebSphere software Workflow

IBM Software Group | WebSphere software

Interleaved Parallel Routing (NI)

ContextA set of activities needs to be executed – no concurrent active activities are allowed

ProblemThe activities should be executed in an arbitrary order that will be determined at runtime

SolutionUse non-interruptible processes and the flowOr non-interruptible processes and links

Page 25: Implementing Workflow Patterns with Business Process ...€¦ · Implementing Workflow Patterns with Business Process Choreography. IBM Software Group | WebSphere software Workflow

IBM Software Group | WebSphere software

Milestone

ContextAn Activity is enabled after a FirstActivitycompleted as long as it completes is a certain amount of time

ProblemDisable Activity after time has expired with Invoke

SolutionUse pick (LR) and send end event in Invokeafter the timer.

Page 26: Implementing Workflow Patterns with Business Process ...€¦ · Implementing Workflow Patterns with Business Process Choreography. IBM Software Group | WebSphere software Workflow

IBM Software Group | WebSphere software

Workflow Patterns

Advanced Branching and Synchronization (5)Multi ChoiceSynchronizing MergeMulti-MergeDiscriminatorN-out-of-M Join

Patterns with multiple instances (4)

Page 27: Implementing Workflow Patterns with Business Process ...€¦ · Implementing Workflow Patterns with Business Process Choreography. IBM Software Group | WebSphere software Workflow

IBM Software Group | WebSphere software

Multi Choice

ContextThere are a number of branches that may need to be executed based upon a condition that isn’t determined until run time

ProblemDecide which branches to execute, possibly fork (LR)

SolutionUse links and apply conditions

Google(TM)

Yahoo(TM)

IBM

Page 28: Implementing Workflow Patterns with Business Process ...€¦ · Implementing Workflow Patterns with Business Process Choreography. IBM Software Group | WebSphere software Workflow

IBM Software Group | WebSphere software

Synchronizing Merge

ContextParallel path synchronization, not all paths are not necessarily executed

ProblemSynchronize parallel execution (LR) paths and ignore skipped execution paths

SolutionUse links in flow

Or continue after flow

Page 29: Implementing Workflow Patterns with Business Process ...€¦ · Implementing Workflow Patterns with Business Process Choreography. IBM Software Group | WebSphere software Workflow

IBM Software Group | WebSphere software

Multi Merge (1)

possibly another process

order add CD

ContextFor a set of different branches the same service must be called

ProblemMultiple alternatives must be executed based upon a condition. After executing the alternatives a special service must be called

SolutionThere is no special activity for that; call the specific service after each path

Page 30: Implementing Workflow Patterns with Business Process ...€¦ · Implementing Workflow Patterns with Business Process Choreography. IBM Software Group | WebSphere software Workflow

IBM Software Group | WebSphere software

Multi Merge (2)

asynchronous activationof service

Page 31: Implementing Workflow Patterns with Business Process ...€¦ · Implementing Workflow Patterns with Business Process Choreography. IBM Software Group | WebSphere software Workflow

IBM Software Group | WebSphere software

Discriminator without Sync (LR)

ContextA set of concurrent branches is executed –continue as soon as the fastest branch is complete

ProblemGuarantee that the succeeding activity is executed only once; continue without waiting for other branches

SolutionUse receive or pick

Page 32: Implementing Workflow Patterns with Business Process ...€¦ · Implementing Workflow Patterns with Business Process Choreography. IBM Software Group | WebSphere software Workflow

IBM Software Group | WebSphere software

Discriminator with Sync (LR)

ContextA set of concurrent branches is executed – next activity must be started as soon as possible and only once (after first branch is completed)

ProblemIn addition to “Discriminator without Sync”, synchronization needs to be done after all branches have been executed

SolutionUse receive in a loop

Page 33: Implementing Workflow Patterns with Business Process ...€¦ · Implementing Workflow Patterns with Business Process Choreography. IBM Software Group | WebSphere software Workflow

IBM Software Group | WebSphere software

N-out-of-M Join (LR)

ContextMultiple alternatives must be executed based upon a condition and must synchronize again

ProblemExecution of an activity in the workflow must happen as soon as N out of M paths are completed

SolutionUse receive in a loop

COUNT = 1,next one will

execute !

Event Event

Page 34: Implementing Workflow Patterns with Business Process ...€¦ · Implementing Workflow Patterns with Business Process Choreography. IBM Software Group | WebSphere software Workflow

IBM Software Group | WebSphere software

Workflow Patterns

Advanced Branching and Synchronization Patterns (5)

Patterns with multiple instances (4)without synchronizationwith a priori design time knowledgewith a priori runtime knowledgewithout a priori runtime knowledge

Page 35: Implementing Workflow Patterns with Business Process ...€¦ · Implementing Workflow Patterns with Business Process Choreography. IBM Software Group | WebSphere software Workflow

IBM Software Group | WebSphere software

Multiple Instances without Synchronization

ContextAn activity must be started multiple times; however, control over the execution of the activity is not necessary

ProblemFor each instance of an activity an additional thread of control must be started (LR)

SolutionUse while activity and call another process asynchronously

Page 36: Implementing Workflow Patterns with Business Process ...€¦ · Implementing Workflow Patterns with Business Process Choreography. IBM Software Group | WebSphere software Workflow

IBM Software Group | WebSphere software

Multiple Instances with design time knowledge

ContextThe number of instances of an activity are known at design time; synchronization after execution is needed

ProblemMultiple threads of control need to be started (LR) and synchronized after execution

Solutionuse flow and model the number of activities

Page 37: Implementing Workflow Patterns with Business Process ...€¦ · Implementing Workflow Patterns with Business Process Choreography. IBM Software Group | WebSphere software Workflow

IBM Software Group | WebSphere software

Multiple Instances with runtime knowledge

ContextThe number of instances of an activity is known at runtime

ProblemMultiple instances must be started in parallel (LR) –asynchronously, then synchronized again

SolutionSee picture

Page 38: Implementing Workflow Patterns with Business Process ...€¦ · Implementing Workflow Patterns with Business Process Choreography. IBM Software Group | WebSphere software Workflow

IBM Software Group | WebSphere software

Multiple Instances without runtime knowledge

ContextSee pattern on previous page; the number of instances is not known at runtime

ProblemConcurrently start an unknown number of activities and gain control again (LR) for synchronization

SolutionSee picture

Page 39: Implementing Workflow Patterns with Business Process ...€¦ · Implementing Workflow Patterns with Business Process Choreography. IBM Software Group | WebSphere software Workflow

IBM Software Group | WebSphere software

Summary

Reviewed simple workflow patternsThe patterns themselves (conceptual)Implementation of these patterns in BPEL4WS & WPC v5.1

Discussed several equivalent implementations of certain patterns in BPEL4WS & WPC v5.1

Pointed out differences between Long-running & Non-interruptible processes and how they effect the patterns

Built a foundation to discuss more advanced workflow patterns