首页 > 其他 > 详细

completed solution matches microsoft sequential workflow tutorial

时间:2014-01-28 23:05:44      阅读:378      评论:0      收藏:0      [点我收藏+]

microsoft sequential workflow tutorial website:http://msdn.microsoft.com/en-us/library/ms734794(v=vs.90).aspx.

after reading this tutorial,i found three bugs:

1.the name of workflow project is the same as a class file name,both of them named "ExpenseReportWorkflow",which can cause compilction failed。

for example:

this.rejectEvent.InterfaceType = typeof(ExpenseReportWorkflow.IExpenseReportService);

please modify any of them;

2.the attribute of the interface IExpenseReportService should be ExternalDataExchangeAttribute

bubuko.com,布布扣
    [ExternalDataExchangeAttribute]
    public interface IExpenseReportService
    {
        /// <summary>
        /// host appliation implements the Methods which will be called by workflow
        /// </summary>
        /// <param name="message"></param>
        void GetLeadApproval(string message);
        void GetManagerApproval(string message);
        /// <summary>
        /// 用于通知工作流特定的事件已经发生
        /// 例如用户在界面中点击了同意按钮
        /// </summary>
        event EventHandler<ExternalDataEventArgs> ExpenseReportApproved;
        event EventHandler<ExternalDataEventArgs> ExpenseReportRejected;
    }
bubuko.com,布布扣

3.for running this demo continuously,you‘d better modify the submitButton_Click method as below:

bubuko.com,布布扣
            if (properties.ContainsKey("Amount"))
            {
                //properties.Add("Amount", Int32.Parse(this.amount.Text));
                properties["Amount"] = Int32.Parse(this.amount.Text);
            }
            else
                properties.Add("Amount", Int32.Parse(this.amount.Text));
            
            Type type =typeof(ExpenseReportWorkflowProject.ExpenseReportWorkflow);
            this.workflowInstance = workflowRuntime.CreateWorkflow(type, properties);
            this.workflowInstance.Start();
bubuko.com,布布扣

finally,u can download the completed solution here

completed solution matches microsoft sequential workflow tutorial

原文:http://www.cnblogs.com/jjhe369/p/3535826.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!