嵌入式工作流客户端接口文档.doc_第1页
嵌入式工作流客户端接口文档.doc_第2页
嵌入式工作流客户端接口文档.doc_第3页
嵌入式工作流客户端接口文档.doc_第4页
嵌入式工作流客户端接口文档.doc_第5页
已阅读5页,还剩3页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

4 工作流客户端文档Business KeyBusiness Key是业务系统中用来标识一个流程实例的标识,工作流系统使用该标识可以找到相应的流程实例。例如在检察院系统中,是案件编号。业务系统在创建流程实例时将将值赋予创建的流程实例,以后每次都使用该值于工作流交互,工作流可以找到对应的流程实例。Business Key在工作流中,作为一个流程实例变量存储在数据库中。工作流中的变量包括变量名、类型和值这些属性。配置一个作为Business Key的变量,需要指定变量名称和类型,供工作流系统使用。配置business key示例如下:ajbhjava.lang.String说明:需要配置Business Key 的变量名称,Business Key的Java类型(keyType)。目前支持的Java类型包括:n String,n Long, n Double接口说明:接口列表中,对流程依赖比较严重而不建议使用的接口排在后面。获取工作流接口:嵌入式工作流接口: com.thunisoft.wf.embedded. WorkflowFacade;这个接口是嵌入式工作流的一个门面,集成了嵌入式工作流提供的相关服务集合。可以通过下面这个静态方法获取工作流faade:com.thunisoft.wf.embedded.WorkflowHelper.getWorkflowFacade();关于工作流接口的准确定义和详细情况,请参考javadoc,在这里指出的是一个概要情况。UML图示如下:流程实例相关接口:开始新流程实例/* * create a new process instance, if instance has no start task, signal instance * to leave the start state. * * if contextVariables contains a key equals Business key, it should be covered. * * param workflowName Process Definition name to create new instance * param keyValue Value of the new ProcessInstance Business key * param contextVariables Context variables for the new process instance * return Id of the new process instance , If failed, return null * throws WorkflowException * throws link IllegalArgumentException If workflowName or keyValue is null, * or key values type is error. */public Long startProcessInstance(String workflowName, Object keyValue,Map contextVariables) throws WorkflowException;流程实例变量管理存放在流程实例Context内的变量,在整个流程实例范围内可见。获取给定流程实例全流程范围内的变量/* * Get all variables stored in process instance context * param keyValue * return * throws WorkflowException */public Map getProcessContextVarialbes(Object keyValue) throws WorkflowException;增加变量到流程实例Context中:一次增加多个流程变量:/* * Add variables to process context. If a variable is already exists, replace it * param keyValue * param variables Variables map, use key as variable name, value as variable value * throws WorkflowException */public void addProcessVariable(Object keyValue, Map variables)throws WorkflowException;增加一个流程变量:(不要调用多次来代替上一个接口的功能)/* * Add a variable to process instance context * param keyValue Business key value * param name Variable name * param value Variable value * throws WorkflowException * throws IllegalArgumentException If name or value is null */public void addProcessVarialbe(Object keyValue, String name, Object value) throws WorkflowException;暂停执行流程实例/* * resume a process instance * param keyValue * throws WorkflowException */public void resumeProcessInstance(Object keyValue) throws WorkflowException;获取当前流程实例状态名称/* * Get name of current state * param keyValue Business key value * return Name of current state, or null if no matched process instance * throws WorkflowException */public String getCurrentStateName(Object keyValue) throws WorkflowException;流程跳转:【不建议使用】通常情况下,流程跳转一般应该采用工作流中配置来完成,而不适宜通过业务系统调用下面的接口来完成。因为这使得业务系统代码强制性依赖于工作流程,从而显示流程流转逻辑的变化。相似的功能,可以通过在工作流定义中增加Action来完成。沿默认路径跳转/* * singal process instance to next state, taking default transition * * param keyValue Value of business key * return if no trace, return empty list */public void singalProcessInstance(Object keyValue) throws WorkflowException;沿给定路径跳转/* * signal process instance to next state, taking gived transition * * param keyValue * param transition Transition name, if null, taking default transition * throws WorkflowException If transition is inexistent */public void signalProcessInstance(Object keyValue, String transition)throws WorkflowException;分支沿默认路径跳转/* * signal a branch of process instance, taking default transition * param keyValue * param token Token path of the branch, If null ,take root token as default * throws WorkflowException */public void signalProcessInstanceBranch(Object keyValue, String token)throws WorkflowException;分支沿着给定路径跳转/* * signal a branch of process instance, take gived transition * param keyValue * param token Token path of branch * param transition Transition name, if null, taking default transition * throws WorkflowException If transition is inexistent */public void signalProcessInstanceBranch(Object keyValue, String token,String transition) throws WorkflowException;任务管理相关接口方法:获取给定流程当前状态可以创建实例的任务:返回的是可以创建的任务名称组成的列表。/* * Get task name of tasks on current state * param keyValue * return To do tasks on current state * throws WorkflowException */public List getTodoTasks(Object keyValue) throws WorkflowException;获取给定流程的历史任务实例:/* * get process instance history trace, all the task instance be wrapped with * link Trace object,any task instance has been started should be loaded * order by create-time ASC * param keyValue Value of business key * return if no trace, return empty list */public List getHistoryTraces(Object keyValue)throws WorkflowException;在给定流程当前状态上创建新任务实例:/* * Create a new task of given task on current state. * param keyValue * param taskName Task name * return Id of created task instance * throws WorkflowException If current state has no gived task */public Long createTaskInstance(Object keyValue, String taskName)throws WorkflowException;结束一个任务(保存任务实例变量)/* * End given task instance, and save variables for given task instance * param taskInstanceId * param variable Variables to save * throws WorkflowException */public void commitTaskInstance(Long taskInstanceId, Map variable)throws WorkflowException;结束一个任务(无变量)/* * End given task instance * param taskInstanceId */public void commitTaskInstance(Long taskInstanceId);保存任务实例/* * save the taskInstanceId, and add the variables to taskInstance * param taskInstanceId * param variables * throws WorkflowException * throws If taskInstanceId is null */public void saveTaskInstance(Long taskInstanceId, Map variables)throws WorkflowException;取消任务实例/* * Cancel a unfinished task instance * param taskInstanceId * param variable * throws WorkflowException If task instance is finished */public void cancelTaskInstance(Long tas

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论