Introduction to 12 Basic workflow modes

Source: Internet
Author: User

1. Five Basic workflow modes

The common denominator of these five patterns is that the execution path of the process involved in the pattern is determined at design time and does not require runtime information. Including:

    • Sequence (sequential mode)
    • Parallel split (parallel split mode)
    • Synchronization (Synchronous mode)
    • Exclusive Choice (Exclusive selection)
    • Simple merge (simplified merging mode)

1.1 Sequence (Sequential mode)

Pattern Description:

In a process instance, each activity is executed sequentially.

The problem that the pattern solves:

Processes need to guarantee the sequence of execution of a series of activities.

Examples of pattern applications:

In a bank loan approval process, the approver must review the credit status of the loan applicant before deciding to agree or reject the loan, that is, the process must be executed in order to check the credit status of the loan applicant before deciding to approve or reject the loan.

Solution:

1) Place the activities (activity) that need to be guaranteed in sequence (sequence).

2) Connect the sequence of activities (activity) in a parallel stream with the link order.

WebSphere Integration Developer V6 implementation:

(Sequential mode WID implementation 1 flowchart)

(Sequential mode WID implementation 2 flowchart)

1.2 Parallel split (parallel split mode)

Pattern Description:

In a process instance, there are two or more execution paths executed in parallel, but there is no association between these parallel paths, and the execution of the parallel paths does not have a deterministic sequential relationship.

The problem that the pattern solves:

The process needs to split a path into two or more paths in parallel without worrying about the order in which the paths are executed.

Examples of pattern applications:

In a cargo handling process, customers are required to initiate shipments in parallel, notifying customers of their activities.

Solution:

1) Create a parallel activity with multiple branches in the process (parallel activity);

2) draw multiple lines from one activity in the process to activities that need to be executed in parallel.

WebSphere Integration Developer V6 implementation:

(Sequential mode WID implementation 1 flowchart)

(Sequential mode WID implementation 2 flowchart)

Note: The implementation of 1 more readable, 2 more flexible, because sometimes the maintenance needs to add judgment on the path, when the implementation of 1 is very large, the implementation of 2 can be flexible in connection to join the judging conditions.

1.3 Synchronization (Synchronous mode)

Pattern Description:

In a process instance, the execution of an activity depends on the result of the execution of the previous paths.

The problem that the pattern solves:

The process needs to synchronize the previous execution paths in one of the active nodes.

Examples of pattern applications:

In a bank loan process, the archiving activity is performed after parallel execution of the loan and notification of the lender's activity.

Solution:

1) Connect multiple parallel activities to the synchronized active node using a connection link.

2) After the end of a parallel stream, the synchronization activity is resumed.

WebSphere Integration Developer V6 implementation:

(Synchronous mode WID implementation 1 flowchart)

(Synchronous mode WID Implementation 2 flowchart)

1.4 Exclusive Choice (exclusive selection mode)

Pattern Description:

In a process instance, there are different execution paths depending on the conditions.

The problem that the pattern solves:

The process needs to decide which path to flow to, depending on the data at run time.

Examples of pattern applications:

In a billing process, charges are deducted based on the payment method selected by the customer.

Solution:

1) Add an option (choice) to the process and then join multiple branches (case).

2) determine which branch to flow through a connected condition (condition) in a parallel stream.

WebSphere Integration Developer V6 implementation:

(Exclusive selection mode WID implementation 1 flowchart)

(Exclusive selection mode WID implementation 2 flowchart)

1.5 Simple merge (simplified merging mode)

Pattern Description:

In one process instance, two or more execution paths are merged on one active node.

The problem that the pattern solves:

No matter which parallel path is executed in the process, one of the active nodes needs to be executed.

Examples of pattern applications:

In a billing process, a notification message that returns billing information must be executed after the deduction is based on the customer's choice of payment method.

Solution:

1) after the option (choice), add the active node that needs to be executed after merging.

2) in a parallel stream, connect from each branch that needs to be merged (link) to the activity that needs to be performed after the merge.

WebSphere Integration Developer V6 implementation:

(Simple merge mode WID implementation 1 flowchart)

(Simple merge mode WID Implementation 2 flowchart)

Note: This mode differs from the synchronous mode in that the parallel path of the synchronous mode can be executed at the same time, while the parallel execution path of the simple merge mode is only one, which can of course be expanded according to the specific needs.





2. Two structured modes

The common denominator of the two patterns is that the execution path of the process involved in the pattern is determined by the runtime, not by design time. Including:

    • Arbitrary cycles (forced cycle mode)
    • implicit termination (implicit termination mode)

2.1 Arbitrary cycles (forced cycle mode)

Pattern Description:

In a process instance, some activities need to be executed multiple times.

The problem that the pattern solves:

You need to reflow to a previous node in the process.

Examples of pattern applications:

In an approval process, if the manager does not approve, the approval initiator needs to resubmit the approval request until the manager approves the consent.

Solution:

1) through the loop (while), using variables to control the logic of the loop.

WebSphere Integration Developer V6 implementation:

(Forced loop mode WID implementation flowchart)

Note: Since the Ws-bpel 2.0 specification does not support forced-loop mode, making it impossible to model by a simple fallback mode, it must be done by loop, believing that there will be support for Forced loop mode in future releases, so that it can be modeled with a simple fallback method.

2.2 Implicit termination (implicit termination mode)

Pattern Description:

In a process instance, the process instance should terminate after all active activities have been performed.

The problem that the pattern solves:

The process engine must decide when the process terminates.

Examples of pattern applications:

In a customer service process, the process must be terminated when information is sent to the customer.

Solution:

1) in the Ws-bpel 2.0 specification, the process terminates when there is no activity at the time of execution.

2) The blue circle represents an implicit terminating state.

WebSphere Integration Developer V6 implementation:

(Implicit termination mode WID implementation flowchart)

3. Two cancellation modes

The common denominator of these two patterns is that the process involved in a pattern disables an activity or the entire process at run time, including:

    • Cancel activity (active Cancel mode)
    • Cancel case (instance cancellation mode)

3.1 Cancel activity (active Cancel mode)

Pattern Description:

In a process instance, whether an activity is performed depends on the condition judgment at run time.

The problem that the pattern solves:

In a process, you must decide whether to skip an activity based on the conditions of the runtime.

Examples of pattern applications:

In an online ordering process, the customer can choose the customer-based process, or choose to use the default options, the process needs to skip the customer process.

Solution:

1) Use an accept option (Receive choice), add two paths, one normal path, perform normal activities, and one that skips the activity when a condition is met.

WebSphere Integration Developer V6 implementation:

(Active Cancel Mode WID implementation flowchart)

3.2 Cancel case (instance cancellation mode)

Pattern Description:

In a process instance, the entire instance is terminated at a certain step.

The problem that the pattern solves:

The process engine must be able to terminate the process instance, and all sub-processes of the process instance must also be terminated completely.

Examples of pattern applications:

In an order process, the customer can cancel the order before the goods are sent, thereby terminating the entire process.

Solution:

1) Terminate the entire process instance using the Terminate active node.

WebSphere Integration Developer V6 implementation:

(Instance cancel Mode WID implementation flowchart)

4. Three state-based modes

The common denominator of these three patterns is that the pattern involves changing the execution path in the process based on the state of the current running process, including:

    • Deferred Choice (deferred selection mode)
    • Interleaved parallel routing (alternate parallel route mode)
    • Milestone (Milestone mode)

4.1 Deferred Choice (deferred selection mode)

Pattern Description:

There are multiple execution paths in a process instance, and the specific path to execute depends on the outside runtime state. The problem that the pattern solves:

The running path of a process depends on some conditions, but the process itself cannot decide which path to take.

Examples of pattern applications:

In a payment process, customers can choose different payment methods, and different payment methods will determine how the payment process goes.

Solution:

Use the Accept option (receive choice) to determine which path the process is going through by receiving different messages outside the process.

WebSphere Integration Developer V6 implementation:

(Deferred selection mode WID implementation flowchart)

4.2 Interleaved Parallel routing (alternate parallel route mode)

Pattern Description:

In a process instance, there are multiple paths that can be executed in parallel, and one can be executed according to external conditions.

The problem that the pattern solves:

The process needs to perform some activities in any order, but not two activities at the same time.

Examples of pattern applications:

In an approval process, the manager can either agree or reject a request, but only one request at a time.

Solution:

1) Create a parallel stream.

WebSphere Integration Developer V6 implementation:

(Alternate parallel routing mode WID implementation flowchart)

4.3 Milestone (milestone mode)

Pattern Description: In a process instance, whether an activity can be executed depends on a specified state. That is, the activity is only executed when a specific, non-expiring milestone is reached.

The problem that the pattern solves:

The availability of a task node depends on a specific status condition, which means that the task can be activated only if a milestone has been reached and has not expired.

Examples of pattern applications:

In a paper approval process, the paper must be reviewed by 3 reviewers within 3 weeks before it can be published.

Solution:

1) in a parallel stream, add two branches, one with deferred selection to control the business logic, and the other branch to handle time expiration.

2) Direct use of deferred selection to control the business logic, time expires processing time to complete.

WebSphere Integration Developer V6 implementation:

Milestone mode WID Implementation 1 flowchart)

(Milestone mode WID implementation 2 flowchart)

Note: As the milestone model is more complex, here is an example of a paper approval process:

The first step: the author of the paper submitted on the Internet, online application to send an XML file with paper information format to the process.

Step two: The first call to the activity check the format of the paper.

Step three: The review counter is zeroed.

Fourth step: Go to two branches, left branch waiting for reviewer comments, right branch wait time is three weeks.

Fifth step: Select the receiving activity waiting for the reviewer's opinion.

Sixth step: If there is a reviewer approval consent, then review the counter plus one, and wait for the comments of the other two reviewers.

Seventh step: Of course, the reviewer can also reject, also review the counter plus one, and wait for the comments of the other two reviewers.

Eighth step: After three weeks, the timer activates and sends the cancel message.

The Nineth step: Select the Receive activity to accept the cancel message, perform the corresponding processing, the counter is three, the loop exits, the process ends.

http://blog.itpub.net/14789789/viewspace-473195/

Paper: http://www.docin.com/p-191263866.html

Introduction to 12 Basic workflow modes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.