WWF workflow learning notes (SIJIN Street)

Source: Internet
Author: User

My first workflow \ "Hello Word \"
Create a state machine workflow project \ "WorkflowLibrary1 \"
Private void codeactivityappsexecutecode (object sender, EventArgs e)
{
// System. Windows. Forms. MessageBox. Show (\ "sdlkalksadfasdF \");
CodeActivity cd = new CodeActivity ();
Console. writeLine (\ "Hello, from \ '{0 }\'. \ nI \'m an instance of the {1} class. \ ", cd. name, cd. toString ());

}
2. Add the new project (console program) \ "leleapplication1 \" Code as follows:
Class Program
{
Static AutoResetEvent waitHandle = new AutoResetEvent (false );
Static void Main (string [] args)
{
// Form1 fr = new Form1 ();
// Fr. Show ();
WorkflowRuntime wn = new WorkflowRuntime ();
Wn. StartRuntime ();

Wn. WorkflowCompleted + = new EventHandler <WorkflowCompletedEventArgs> (OnWorkflowCompleted );
Type type = typeof (WorkflowLibrary1.Workflow1 );
WorkflowInstance inst = wn. CreateWorkflow (type );
Inst. Start ();
// Wn. CreateWorkflow (type );

WaitHandle. WaitOne ();

Wn. StopRuntime ();
Console. WriteLine (\"\");
Console. WriteLine (\"\");
Console. WriteLine (\ "=========================== \");
Console. WriteLine (\ "Press any key to exit .\");
Console. WriteLine (\ "=========================== \");
Console. ReadLine ();
}

Static void OnWorkflowCompleted (object sender, WorkflowCompletedEventArgs e)
{
WaitHandle. Set ();
// Throw new Exception (\ "The method Or operation is not implemented .\");
}
}
Implementation result
[Img = http://www.microsoft.com/china/MSDN/library/Windev/WindowsVista/art/wwfgetstart_04.png]

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.