WF study Note 1

Source: Internet
Author: User

As there were a lot of workflows used in previous projects, I was interested in learning the WF knowledge of Ms.
WF definition:A workflow is defined in an activity diagram. It may be a human operation or a system process. An activity is a step in a workflow. It is embodied as an executable unit that can be reused and integrated. After the workflow is designed, it is compiled into a. Net assembly and executed by the workflow runtime and the general language runtime (CLR.

Method for passing parameters to WF:
You must set attributes in the workflow first.
Private string firstname;
Private string message;
Public String firstname
{
Set {firstname = value ;}
}
Public String message
{
Get {return message ;}
}
When other programs call this workflow to create a workflow instance Key-value set for Transmission
Dictionary <string, Object> initpara = new dictionary <string, Object> ();
Initpara. Add ("firstname", "Todd ");
Workflowinstance instance = workflowruntime. createworkflow (typeof (helloworld. workflow1), initpara );

Obtain the parameters returned by WF:
Workflowruntime. workflowcompleted + = delegate (Object sender, workflowcompletedeventargs E)
{
Message = (string) E. outputparameters ["message"];
Waithandle. Set ();
}

Conditional activity can be defined in two ways. One is implemented by code, and the other is implemented by external rules. The Code conditions are as follows:
Private void checkcounter (Object sender, conditionaleventargs E)
{

E. Result = false;

If (counter <10)

{

E. Result = true;

}

}

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.