基于Teamplate Workflow组件的工组流开发概述

简要整理了基于Teamplate Workflow组件进行工作流开发的步骤。

 

1. 准备工作

为了设计ModelWorkflow应用程序,你必须拥有Teamplate系统中设定的AdministratorDesigner权限。可以通过Teamplate for .Net User Administration配置工具来实现:

1Load All Active Directory Users And Groups,导入当前Active Directory中用户和用户组。如果用户和用户组较多,需要较长时间才能完成。

2)在管理界面的Users/Group页面,选择导入的指定用户,然后就可以编辑该用户的权限。Teamplate系统只提供AdministratorDesigner两个权限选项。

 

2. 使用Teamplate for .Net IDE创建Model

Model通过提供一组WorkflowResource Objects对象,来定义和设计业务流程。共有三种对象:Workflow Objects, Resource ObjectsData Objects,每一种对象都有不同的功能。

 

创建Model就是根据实际的业务流程,将一些Workflow对象布置在Model Design Canvas中,然后通过Resource对象、Data对象和脚本(Script)来扩展工作流的功能。如下图所示:

Fig. 1 Teamplate Workflow提供的一个Time Off RequestModel

 

其中有4WebForm对象和2Event对象。WebForm对象需要设定DefaultForm / Description等属性。

 

此外,Model也有自己的属性和事件,不同于放置在Model Design Canvas上的Workflow Object的属性和事件。其中IISDirectory属性指定Model存放的IIS目录(如\\SPS\models$\TimeOffRequests),IISServerName属性指定Model存放的IIS Server Name(如http://intranet/models/TimeOffRequests)。注意:这里TimeOffRequests虚拟目录需要设定为Application

 

Teamplate提供了11种类型的Workflow对象:Task, WebForm, System, Event, SubProcess, Link, Rework Link, Lable, Chart, Table and Viewer。如下Workflow对象的描述文字来自于<Teamplate Developer Guide>文档。

Task: The Task Workflow Object is the basic Workflow Object used to model one step in the workflow process and is also used to allow Users to interact with the Model.

WebForm: The WebForm WorkFlow Object is a special Task used to extend access to the Model to Users outside the Teamplate environment with only a thin client web browser available to them.

System: The System Workflow Object is a special Task that is automatically executed by the system without the need for any User interaction or initiation.

Event: The Event Workflow Object is a Task that is executed by the system. When a time/date, data, database, file drop or messaging queue criteria is met or true the Task will be executed automatically.

SubProcess: The SubProcess Workflow Object is a type of Task used to call another Process. In other words, it is a special Task that is made up of all the Tasks of another Process. This is a way to roll up process steps and reduce the number of Tasks that appear on the high-level Model Design Canvas.

Link: The Link Workflow Object is the connection between a Task, WebForm, System or Event that defines the flow of the work or that links two Workflow Objects together.

Rework Link: The Rework Link Workflow Object is a link that allows the work to flow backwards in the Process, thereby allowing a Task to be reworked or allows the Model to backtrack to previously executed Tasks.

Label: The Label Workflow Object is used to display information on the workflow diagram. It can also be used as a button to execute non-process related operations.

Chart: The Chart Workflow Object is used to graphically display procedd data in the form of a chart.

Table: The Table Workflow Object is object used to display information in the form of table.

Viewer: The Viewer Workflow Object is used to display an Internet web page, a Process, a document, or some type of media in another window.

 

一旦Workflow的可视化流程设计完成后,下一步是设计界面Form。在Teamplate中,有两类界面可以用作用户界面来获取用户输入的数据或者显示结果给用户:Windows FormWeb Form。你可以使用Teamplate提供的Form设计工具,也可以使用VS.Net来进行界面设计。

 

3. 通过ScriptView定制脚本

ScriptViewTeamplate for .Net IDE提供的脚本编辑环境,你可以浏览在创建Model过程中自己生成的脚本和编辑定制自己的脚本,Model Model中每一个FormWebForm都有一个ScriptViewScriptView编辑功能相对而言不是很强,连鼠标滚轮都不支持。脚本语言目前为VB.Net

 

4.验证Model的脚本

在完成Model的设计和编辑脚本之后,下一步建议验证或测试脚本的正确性。Teamplate IDE提供了两个按钮用来帮助实现这一过程。

Verify Script Button: 用来编译Model代码,并显示一系列包括错误及错误行提示对话框。

Start Debug Button: 也可用来编译Model代码,并显示一系列包括错误及错误行提示对话框。此外,还基于Model创建业务流程实例来指出其中的逻辑错误。

 

5. 使用VS.Net进行界面设计和功能开发

虽然Teamplate for .Net IDE也支持界面设计和编辑VB.NET脚本,但是不是很方便,当然可能是我长期使用VS.NET有关。

这样,我们可以完全采用VS.Net来进行用户界面设计,但是这里的Web Page的命名必须与ModelWebForm对象的DefaultForm属性保持一致,并且Web Page部分必须是VB.Net脚本。

 

VS.Net中,你可以创建新的基于C#或者VB.Net项目来进行业务逻辑部分的开发,然后在上述的项目中进行调用相应的业务逻辑类。

 

另外,这些项目还需要引用位于Program Files\Teamplate\Teamplate.NET目录中Teamplate BLL文件。

 

在界面设计和功能开发完成后,编译整个Solution,将所有的Web Page\Bin目录的DLL文件复制到前面ModelIISDirectory属性设定的TimeOffRequests Web Application中的Bin目录下。

 

你可以通过Teamplate IDEDebug功能或者Teamplate提供的Web Access功能,甚至可以基于SharePoint Workflow Web Part来测试上述创建的Model

原文地址:https://www.cnblogs.com/rickie/p/45380.html