工作流模板设计文档.docx

上传人:b****5 文档编号:8021428 上传时间:2023-01-28 格式:DOCX 页数:15 大小:19.75KB
下载 相关 举报
工作流模板设计文档.docx_第1页
第1页 / 共15页
工作流模板设计文档.docx_第2页
第2页 / 共15页
工作流模板设计文档.docx_第3页
第3页 / 共15页
工作流模板设计文档.docx_第4页
第4页 / 共15页
工作流模板设计文档.docx_第5页
第5页 / 共15页
点击查看更多>>
下载资源
资源描述

工作流模板设计文档.docx

《工作流模板设计文档.docx》由会员分享,可在线阅读,更多相关《工作流模板设计文档.docx(15页珍藏版)》请在冰豆网上搜索。

工作流模板设计文档.docx

工作流模板设计文档

工作流模板设计文档

ByDonaldzhou

2003/2/12

一.设计目的

设计本工作流的模板,可以方便快速的生成工作流的应用系统,方便系统的升级维护。

二.设计思想

将特定的工作流系统和工作流系统的流程定义分开

工作流系统的流程定义数据库

特定的工作流系统数据库

调用流程定义信息

 

三.设计概述―――流程定义数据库(workflowdefine.nsf)

1.概述:

对于一个工作流,我们定义其Activity(状态),Relation(状态间的联系),Mailnotify(邮件通知)。

2.表单:

(1)WorkflowDefineProfile:

是Profile。

存储工作流定义数据库的服务器名和路径。

如果以后这个工作流定义的数据库位置发生改变,需要修改这个Profile。

(具体方法见帮助文件)

字段名

类型

备注

ServerName

Text,Editable

存放工作流定义数据库的服务器名

Path

Text,Editable

存放工作流定义数据库的路径

 

(2)Workflow:

用来生成一个Workflow的文档,里面存储Workflow系统的信息

字段名

类型

备注

WorkflowId

Text,Editable

WorkflowName

Text,Editable

WorkflowDescription

Text,Editable

 

(3)Role:

可以定义一些角色,比如在外出系统中,需要总务来填写机票的一些信息,那我们可以定义一个角色(Role),将负责订票业务的总务放到里面。

如果以后负责订票业务的人员发生变动,我们只要更改这个角色中的人员就可以了。

 

字字段名

类型

备注

WorkflowId

Dialoglist,Editable

选择项公式:

ServerName:

=@GetProfileField("WorkflowDefineProfile";"ServerName");

Path:

=@GetProfileField("WorkflowDefineProfile";"Path");

@DbColumn("":

"nocache";ServerName:

Path;"AllWorkflow";1)

RoleName

Text,Editable

RoleMember

Dialoglist,Editable

Useaddressdialoglistforchoices

 

(4)Activity:

定义每一个状态的ID号,名称等。

最重要的是定义了Activity的Owner,即能编辑处在这一个状态的文档的人员。

字段名

类型

备注

WorkflowId

Dialoglist,Editable

选择项公式为:

ServerName:

=@GetProfileField("WorkflowDefineProfile";"ServerName");

Path:

=@GetProfileField("WorkflowDefineProfile";"Path");

@DbColumn("":

"nocache";ServerName:

Path;"AllWorkflow";1)

ActivityId

Text,Editable

ActivityName

Text,Editable

ActivityDescription

Text,Editable

ActivityOwner

选择项公式为:

ServerName:

=@GetProfileField("WorkflowDefineProfile";"ServerName");

Path:

=@GetProfileField("WorkflowDefineProfile";"Path");

AllRoles:

="@RoleMemberOf"+""+@DbColumn("";ServerName:

Path;"AllRoles";1);

"@Field":

AllRoles

 

(5)Relation:

定义文档由一个Activity转换到另一个Activity的条件,以及要发送的邮件。

字段名

类型

备注

WorkflowId

Dialoglist,Editable

选择项公式为:

ServerName:

=@GetProfileField("WorkflowDefineProfile";"ServerName");

Path:

=@GetProfileField("WorkflowDefineProfile";"Path");

@DbColumn("":

"nocache";ServerName:

Path;"AllWorkflow";1)

RelationId

Text,Editable

Condition

Text,Editable

条件的书写语法与Formula类似

MailNotifyId

Dialoglist,Editable

选择项公式为:

ServerName:

=@GetProfileField("WorkflowDefineProfile";"ServerName");

Path:

=@GetProfileField("WorkflowDefineProfile";"Path");

@DbColumn("":

"Nocache";ServerName:

Path;"MailNotify";2)

(6)MailNotify:

定义邮件的主题,收件人。

字段名

类型

备注

WorkflowId

Dialoglist,Editable

选择项公式为:

ServerName:

=@GetProfileField("WorkflowDefineProfile";"ServerName");

Path:

=@GetProfileField("WorkflowDefineProfile";"Path");

@DbColumn("":

"nocache";ServerName:

Path;"AllWorkflow";1)

MailNotifyId

Text,Editable

Recipients

Dialoglist,Editable

选择项公式为:

ServerName:

=@GetProfileField("WorkflowDefineProfile";"ServerName");

Path:

=@GetProfileField("WorkflowDefineProfile";"Path");

AllRoles:

="@RoleMemberOf"+""+@DbColumn("";ServerName:

Path;"AllRoles";1);

"@Field":

AllRoles

Subject

Text,Editable

条件的书写语法与Formula类似

注:

以红颜色标明的字段的选择条件中,提供了两中形式的选择项,@rolememberOf和@field。

这是自己定义的“伪公式”,在程序中将对这两种形式的公式进行计算。

3.View:

视图(Profile)中有一个ActionEditProfile,用来编辑Profile.

四.设计概述--------具体的工作流应用系统。

这里以外出系统为例。

(1.23.nsf)

1.概述:

当员工因公司事务外出时,必须填写因公外出的申请单。

外出类型分两种:

Loacl和OtherPlace。

当外出类型是OtherPlace时,在送交直属主管签核前,需要由总务部门来填写机票和酒店信息。

2.subform:

(1)WorkflowInfo:

存放表示当前文档的状态以及Owner的信息。

其中有一个Authors的字段,用来控制谁可以编辑文档。

字段名

类型

备注

CurrentActivityId

Text,Editable

默认值:

”01”

CurrentActivityName

Text,Editable

默认值:

WorkflowId:

=@GetProfileField("WorkflowProfile";"WorkflowId");

ServerName:

=@GetProfileField("WorkflowProfile";"ServerName");

Path:

=@GetProfileField("WorkflowProfile";"Path");

temp:

=@DbLookup("";ServerName:

Path;"AllActivity";WorkflowId+"-"+CurrentActivityId;2);

@If(@IsError(temp);"Error";temp)

CurrentActivityOwner

Authors,Editable

PreviousActivityId

Text,Editable

前一个状态的Id

PreviousActivityName

Text,Editable

前一个状态的名称

 

(2)ForWrite:

用来给员工填写外出的一些信息。

字段名

类型

备注

Filler

Text,Editable

填表人。

默认值:

@Name([CN];@UserName)。

Requester

Dialoglist,Editable

默认值:

@Name([CN];@UserName)+"/sernet"

选择项:

Useaddressdialoglistforchoices

Department

Text,Editable

申请人的部门:

默认值:

xuser:

=requester;

xview:

="($VIMPeople)";

temp:

=@Name([CN];@Trim(@DbLookup("";@Subset(@DbName;1):

"names.nsf";xview;xuser;"department")));

@If(@IsError(temp);"Error";temp)

StartDate,

StartTime,EndDate,EndTime,

Date/time

Hours

Number,Editable

输入验证:

@If(hours=0;@Failure("假期的时间不能为0");@Success)

TripType

Radiobutton,Editable

选择项:

Local和

OtherPlace

 

(3)ForRead:

用来显示员工填写的外出信息。

字段名

类型

备注

Filler

Text,Computed

Value:

Filler

Requester

Dialoglist,Computed

Value:

Requester

Department

Text,Computed

Value:

Department

StartDate,

StartTime,EndDate,EndTime,

Date/time,Computed

Value:

StartDate,

StartTime,EndDate,EndTime,

Hours

Number,Computed

Value:

Hours

TripType

Radiobutton,Computed

Value:

TripType

 

(4)GSWrite:

总务用来填写机票酒店信息。

字段名

类型

备注

Hotel

Text,Editable

Ticket

Text,Editable

 

(5)GSRead

字段名

类型

备注

Hotel

Text,Computed

Value:

Hotel

Ticket

Text,Computed

Value:

Ticket

 

3.Form

(1)WorkflowProfile:

是Profile,用来记录当前系统的编号,以及工作流定义数据库的路径。

在使用这个工作流之前,管理员必须填写好该Profile。

字段名

类型

备注

WorkflowId

Text,Editable

表示当前这个工作流的Id

ServerName

Text,Editable

表示工作流定义数据库的服务器名

Path

Text,Editable

表示工作流定义数据库的路径

 

(2)RequestForm:

用来填写申请信息的表单,里面包括子表单和计算子表单。

名称

类型

备注

“WorkflowInfo”

Subform

Computedsubform

计算公式为:

@If(CurrentActivityName="FillRequestForm";"ForWrite";"ForRead")

Computedsubform

计算公式为:

@If(CurrentActivityName="GSOperation";"GSWrite";"GSRead")

Manager1

Dialoglist,Editable

默认值为:

xuser:

=requester;

xview:

="($VIMPeople)";

temp:

=@Name([CN];@Trim(@DbLookup("":

"nocache";@Subset(@DbName;1):

"names.nsf";xview;xuser;"Manager")))+"/sernet";

@If(@IsError(temp);"Error";temp)

转换公式为:

@Name([CN];Manager1)

Manager1Option

Radiobutton,Editable

选择公式为:

Yes,No

隐藏条件:

CurrentActivityName!

="Manager1Sign"

Manager1OptionRead

Text,computed

计算公式为:

Manager1Option

Manager2

Dialoglist,Editable

Manager2Option

Radiobutton,Editable

选择公式为:

Yes,No

隐藏条件:

CurrentActivityName!

="Manager2Sign"

Manager2OptionRead

Text,computed

计算公式为:

Manager2Option

 

注:

A.表单中还有字段Manager2,Manager2Option,anager2OptionRead,GeneralManager,GeneralManangerOption,GeneralManangerOptionRead与Manager1,Manager1Option,anager1OptionRead设置相似。

B.表单中使用计算子表单的目的:

我们要求填表人在填写申请单时候,只能填写外出的时间等信息,而机票信息是由总务来填写的。

总务在填写机票信息时,不能更改已经由填表人填写好的外出信息。

子表单计算公式为:

@If(CurrentActivityName="FillRequestForm";"ForWrite";"ForRead")和

@If(CurrentActivityName="GSOperation";"GSWrite";"GSRead")。

这样只有在状态为FillRequestForm(填写外出申请单)时候,子表单为ForWrite,这个子表单里面的字段时Editable,其他状态时为ForRead,这个子表单里面的字段为Computed,且值为填写好的外出信息。

同样的道理,只有在状态为GSOperation(总务填写外出信息)时候,是包含Editable类型的的字段的子表单(GSWrite),在其他的时候在包含Computed类型的字段的子表单(GSRead)。

 

4.Action:

整个系统公用一个Action”送下一步处理”,在读的状态下隐藏。

公式:

@Command([ToolsRunMacro];"ChangActivity");@Command([FileSave]);@Command([FileCloseWindow])。

5.Agent:

ChangActivity:

改变文档的状态.代码:

(options):

OptionDeclare

Use"ChangeActivity"(使用了代码库里的代码)

(Declarations)

DimsessionAsnotessession

DimCurrentDocumentAsnotesdocument

Intialize:

SubInitialize

DimsendAsVariant

Setsession=Newnotessession

SetCurrentDocument=session.documentcontext

CallChangeActivity(session,CurrentDocument)

EndSub

6.Scriptlibraries:

”ChangeActivity”

(options):

OptionPublic

OptionDeclare

(Declarations)

DimCurrentDatabaseAsnotesdatabase

DimWorkflowDefineAsnotesdatabase'工作流定义的数据库

'Workflow的信息

DimWorkflowIdAsString

DimServerNameAsString

DimPathAsString

ChangeActivity:

SubChangeActivity(SessionAsnotessession,CurrentDocumentAsnotesdocument)

'ByDonald2003/1/22

'功能:

完成文档的状态转换

OnErrorGotoPrintError

DimProfileAsnotesdocument

DimCurrentActivityIdAsString

DimRelationCollectionAsnotesdocumentcollection

DimRelationAsnotesdocument

DimiAsInteger

DimevaluateResultAsVariant

DimToActivityIdAsString

DimMailNotifyIdAsString

DimToActivityNameAsString

DimRountConditionAsString

DimtempOwnerAsVariant

DimOwnerlistAsVariant

DimMailAsnotesdocument

'取得工作流的Profile文档,从中得到当前工作流系统的编号以及工作流定义数据库的路径

SetCurrentDatabase=session.currentdatabase

SetProfile=CurrentDatabase.GetProfileDocument("WorkflowProfile")

WorkflowId=Profile.WorkflowId(0)

ServerName=Profile.ServerName(0)

Path=Profile.path(0)

'取得工作流定义数据库

SetWorkflowDefine=session.getdatabase(ServerName,Path)

'取得当前文档的状态编号

CurrentActivityId=CurrentDocument.CurrentActivityId(0)

'找下一个状态

SetRelationCollection=WorkflowDefine.search("Form=""Relation""&WorkflowId="""+WorkflowId+"""&@left(RelationId;2)="""+CurrentActivityId+"""",Nothing,0)

IfRelationCollection.count<1Then

Msgbox("工作流定义出错")

ExitSub

Else

Fori=1ToRelationCollection.count

SetRelation=RelationCollection.getnthdocument(i)

RountCondition=Trim(Relation.Condition(0))

IfRountCondition=""Then'没有流转条件

ToActivityId=Trim(Right(Relation.RelationId(0),2))

MailNotifyId=Relation.MailNotifyId(0)

ExitFor

Else

evaluateResult=Evaluate(RountCondition,CurrentDocument)

IfevaluateResult(0)Then

ToActivityId=Trim(Right(Relation.RelationId(0),2))

MailNotifyId=Relation.MailNotifyId(0)

ExitFor

EndIf

EndIf

Next

EndIf

'将本状态的CurrentActivityId放到PreviousActivityId中,

'将本状态的CurrentActivityName放到PreviousActivityName

CurrentDocument.PreviousActivityId=CurrentDocument.CurrentActivityId(0)

CurrentDocument.PreviousActivityName=CurrentDocument.CurrentActivityName(0)

'计算下一个状态的Owner

tempOwner=Evaluate("@dblookup("""";"""+ServerName+""":

"""+Path+""";""AllActivity"";"""+WorkflowId+""+"-"+ToActivityId+""";4)")

Ownerlist=FormulaCalculate(tempOwner(0),CurrentDocument)

'将下一个状态的Owner放到CurrentActivityOwner中

'下一个状态的ActivityId放到CurrentActivityId中

'下一个状态的ActivityName

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 总结汇报 > 学习总结

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1