activiti 流程定义和流程实例的挂起

来源:互联网 发布:java opencv 人脸比对 编辑:程序博客网 时间:2024/06/05 20:20

关于流程定义和流程实例的挂起,activiti的官方文档描述比较详细,摘录如下:

Suspending and activating a process

It’s possible to suspend a process definition. When a process definition is suspended,new process instance can’t be created (an exception will be thrown). Suspending the process definition is done through the RepositoryService:

code segment
repositoryService.suspendProcessDefinitionByKey("vacationRequest");try {  runtimeService.startProcessInstanceByKey("vacationRequest");} catch (ActivitiException e) {  e.printStackTrace();}

To reactivate a process definition, simply call one of the repositoryService.activateProcessDefinitionXXX methods.

It’s also possible to suspend a process instance. When suspended, the process cannot be continued (e.g. completing a task throws an exception) and no jobs (such as timers) will executed. Suspending a process instance can be done by calling theruntimeService.suspendProcessInstance method. Activating the process instance again is done by calling theruntimeService.activateProcessInstanceXXX methods.

0 0
原创粉丝点击