WWF state machine workflow (1)

Source: Internet
Author: User
Use Case:

After the state machine workflow is defined, the problem arises:
1. How to define the events contained in each status?
2. How to run this process?
3. What changes do I need to modify when my process (status flow) changes?
Wait, there are many problems. Let's solve them one by one!

Question 1:
Each State (except the termination state) must provide at least one event (system. workflow. activities. eventdrivenactivity). Each eventdrivenactivity contains a handleexternalevent and a setstate. setstate has the targetstatename member attribute to control the target flow state, while handleexternalevent must specify the interface type (interfacetype) and event name (eventname, from the event object provided by interfacetype). The event definition is as follows:


Here, interfacetype is an interface that needs to be defined by ourselves. Currently, it is called localservices. imywfservice. The interface also defines event campaigncreated.

Using System;
Using System. workflow. Activities;

Namespace Localservices
{
[Externaldataexchange]
Public   Interface Imywfservice
{
EventEventhandler<Mywfeventargs>Campaigncreated;
EventEventhandler<Mywfeventargs>Campaignsubmited;
}
}

<To be continued...>

 

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.