在Captaris WOrkflow 6.0开发工作流平台开发中,需要使用ASP.NET 2.0和 Web表单来执行任务。由于任务的数据较多而且存在主从结构,例如:Product Change Request(产品更改申请)或Month Expense Request(个人月费用报销申请),将所有的数据显示在一个Web表单上会导致以下问题:
大页面,运行效率低下。 |
页面控制太复杂,造成不稳定,增加出错几率。 |
修改及扩展困难,如果流程的任务发生改变,维护变得困难。 |
缺乏灵活机动(如上)。 |
鉴于此,我们需要使用ASP.NET 2.0的MasterPage来分别显示不同的层面的数据,例如对于Product Change Request(产品更改申请)流程我们使用wfApproveInfo.aspx显示所有审核者的签核信息,wfDistributeDept.aspx显示资料发放部门列表,wfArchives.aspx显示图纸列表,在MasterPage中显示Product Change Request的基本信息,如单号、申请人姓名、更改分类等。wfApproveInfo.aspx、wfDistributeDept.aspx和wfArchives.aspx页面都引用MasterPage。
但是当我们应用MasterPage到Captaris Workflow 6.0中时,发生了两个问题:
Captaris Workflow 6.0的任务表单需要继承Teamplate.Web.UI.BaseWorkflowPage,MasterPage不可能继承它 |
wfArchives.aspx等页面引用MasterPage后,无法调用this.CompleteTask()方法 |
MasterPage设置公共属性,在Content Page中访问它并且赋值。 |
不使用BaseWorkflowPage的this.CompleteTask()方法,使用Process.WorkAdvance()方法。 |
1
foreach (Control control1 in this.Page.Controls[1].Controls)
2
{
3
if (control1 is WebControl)
4
{
5
base.Trace.Write(string.Format("Adding {0} of type {1}", control1.ID, control1.GetType().UnderlyingSystemType.ToString()));
6
list1.Add(control1);
7
}
8
}
9

2



3

4



5

6

7

8

9
