WorkFlow Design Step 5-custom workflow activity-wf4.0

Source: Internet
Author: User
Opening

In the previous article "workflow design Article step.4-Exception Handling (continued)-wf4.0", we talked about the usage of workflow exception handling activities. In fact, there are other methods, such as triggering by codeactivity.

This article mainly describes how to use codeactivity and how to use codeactivity.

Summary

Workflow is a popular technology recently. In fact, WF originated from the office automation field in the mid-S. Since its establishment in, WfMC (Workflow Management Alliance) formulated

Series of workflow standards. More and more scholars are paying attention to the workflow in the 21st century, and the technology is becoming more and more mature. Of course, I also have to keep up with the times, so I also joined the workflow army, hoping

Enough to keep up with our predecessors. Of course, I also hope that interested friends can join the workflow discussion group. Specific Group Number:120661978.

At present, we have made a sequent in the agileeas platform. The content of the interface designer + workflow, of course, the workflow is not very mature yet, and it is not convenient to release it. This article is just a reference, but alsoHope

You pay more attention to the content of workflows.

Outline

I. Opening

Ii. Summary

3. wf4.0 user-defined activities

User-Defined activity codeactivity

The activity nodes provided by the system can satisfy some simple flows, but some flows are composed of custom activities. At this time, we can use the codeactivity base class provided by the system, we rewrite

The attributes and methods are used to complete custom behaviors and customize the process. Let's take a look at the usage of custom activities.

1. Create a blank solution.

2. Assign the solution in the previous article to the same level folder of the solution.

3. Add an existing project:

4. Select a project file:

5. After opening, the corresponding file is loaded into the current solution, and the class and iteminfo are created.

6. Create a codeactivityCodeActivity:

7. After adding the node, add the following code to the active node:

8. Compile the solution after adding the package. Switch to the designer view and view the custom activity nodes in the toolbar. the nodes are automatically loaded to the toolbar on the left. The Group is based on the namespace.

9. Add a new activity, and then add an ordered control flow and two output activities and user-defined activities to the designer view of the activity:

10. Define two variables and design the process as follows:

11. After F5 is run, the output to the console is as follows:

For more applications and instructions, I believe that you will see more applications in the subsequent design process. Of course, due to my limited level, some content is generated, unclear or

If you do not understandPlease criticize and point out.

For the source code of the previous article, refer to the previous articleArticle《Workflow design step 4-Exception Handling (continued)-wf4.0Download

Next we will combine the exception handling in the previous article to trigger an exception through the codeactivity activity to see how to capture the exception information.

1. Add a custom codeactivity that generates an exception:

2. Compile the solution and add the activity to the designer. The specific process is as follows:

3. Modify the calling code in program:

4. Run F5 to see the specific results:

5. view the error message:

6. To continue running, the "unhandledexceptionaction" defined in programs will be executed. The specific content is as follows:

Next announcement

This article describes how to use codeactivity and how to handle exceptions in user-defined activities. Next, we will describe how to use invokemethod in a workflow.

Source code download

More communication

Official blog: http://www.smarteas.net/

Http://www.agilelab.cn/

If you have any questions about using the agileeas. NET development platform, use the following contact methods or communication methods.

1. Email:

Wei Qiong East: mail.james@qq.com mobile phone: 18629261335 blog: http://eastjade.cnblogs.com/

Yin long wave: 549558408@qq.com blog: http://www.cnblogs.com/onmyway/

He gozhou: hegezhou_hot@163.com blog: http://www.cnblogs.com/hegezhou_hot/

2. QQ chat group:

Communication Group on the agileeas. NET platform: 120661978 (super group) [New]

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.