Learn WF notes 9-custom workflow activity (1)

Source: Internet
Author: User

WF already provides many types of activities that can meet the basic needs of most people, however, in actual projects, you sometimes need to re-develop or encapsulate some activities with special business significance for use in the workflow. Therefore, WF provides the ability to expand the original activities and customize new activities, 1. You can create and develop custom activities through "workflow activity library.


Figure 1 create a custom Activity Project

 

1.1 Type of custom Activity

By default, the created custom activity inherits the "system. workflow. Activities. sequenceactivity" parent class. As shown in figure 2, the appearance of a custom activity is composed of a sequence ordered container. You can add other sub-activities to the sequence activity.

Figure 2 sequenceactivity-type custom Activity

If you want to create a special compensation-type custom activity, you can inherit the "system. workflow. componentmodel. compositeactivity" parent class. The appearance of this type of custom activity is shown in 3. You cannot add any sub-activity to this activity.

Figure 3 compositeactivity-type custom Activity

If you want to encapsulate some additional functions based on the callexternalmethod activity, you can inherit the "system. workflow. Activities. callexternalmethodactivity" parent class. This type of custom activity is shown in Figure 4.

Figure 4 callexternalmethodactivity-type custom Activity

If you want to encapsulate some additional functions based on the handleexternalevent activity, you can inherit the "system. workflow. Activities. handleexternaleventactivity" parent class. This type of custom activity looks 5.

Figure 5 handleexternaleventactivity-type custom Activity

You can inherit the "system. workflow. componentmodel. Activity" parent class to customize a "componentmodelactivity" type custom activity. Both sequenceactivity and sequenceactivity are the two most commonly used custom activities in daily work, it differs from the sequenceactivity type custom activity in that the user cannot add any sub-activity within it. The appearance of this type of custom activity is shown in 6.

 

Figure 6 componentmodelactivity-type custom Activity

 

Custom activities developed using WF are also very easy to use. As shown in 7, the custom activities developed in the same solution can be viewed and used in the toolbar after compilation is successful.


Figure 7 the toolbar displays the custom activities for development.

 

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.