Understanding windows Workflow Foundation

Source: Internet
Author: User

Each WF workflow contains a certain number of activities, and each activity implements some functions of the workflow. For these activities, workflows act as containers and control the lifecycle and execution sequence of the activities. WF is determined to support system workflows and manual workflows in a unified manner. As described earlier, system workflows are executed in predefined order, while manual workflows are the opposite. To meet these requirements, WF provides two built-in workflow types: sequential workflow: the ability to execute activities based on predefined patterns. State Machine workflow: ability to interact with external events. They all depend on the same runtime environment and can use the same custom activity. Ordered workflows are naturally suitable for system workflows. A state machine workflow provides a method to model a loosely defined manual workflow. An independent job can merge all these elements and combine the two workflows. If necessary, developers can also create custom workflow types. However, most WF application systems only use one of the two standard workflow types. The following sections describe the sequence workflow.

Use sequential Workflow

The purpose of a sequential workflow is to execute activities in a predefined sequence. This sequence can include loops, branches, and other types of control flows. When a workflow does not have a defined path from start to end. The basic activity library has a set of activities used in the ordered workflow. These activities include:
Ifelse: Execute two or more paths based on whether the conditions are met.
While: Repeat one or more activities until one condition is true.
Sequence: Execute a set of workflows at the same time according to the defined sequence.
Parellel: Execute one or more tasks in parallel, and wait until all the activities in parallel are completed before the workflow continues to the next step.
Code: Execute a defined section.Code.
Compensationhandler: Contains a supplementary logic. For example, in some cases, an error occurs when executing a group of other activities and some code is executed.
Listen: Wait for a special event to execute one or more activities when the event is received.
Delay: It takes some time for a running workflow to be suspended.
Callexternalevent: Wait for a method call from the application system but outside the workflow.
Invokeworkflow: Other workflows are executed.
Invokewebservice: Call WebService.
Transactionscope: Allows you to merge one or more other activities into one atomic transaction.
Terminate: Terminate workflow execution.

Demonstrate a simple sequence workflow and several activities created by the WF workflow designer:

people who have experience in this field may have noticed that many of the default activities used in sequential workflows are similar to those in Business Process Execution Language (BPEL. Originally defined by Microsoft and IBM, BPEL is now the OASIS standard. It aims to define system workflows. This is also a subset of many WF methods.
Microsoft provides a BFEL Technology for Windows workflow foudation to meet the needs of developers who want to use BPEL. It allows you to import the Business Process processing logic defined in BPEL to a WF workflow. You can also import the WF workflow logic to the BPEL.

Related Article

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.