本文整理汇总了Java中org.activiti.engine.RuntimeService.suspendProcessInstanceById方法的典型用法代码示例。如果您正苦于以下问题:Java RuntimeService.suspendProcessInstanceById方法的具体用法?Java RuntimeService.suspendProcessInstanceById怎么用?Java RuntimeService.suspendProcessInstanceById使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.activiti.engine.RuntimeService
的用法示例。
在下文中一共展示了RuntimeService.suspendProcessInstanceById方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: suspendProcessInstance
import org.activiti.engine.RuntimeService; //导入方法依赖的package包/类
protected ProcessInstanceResponse suspendProcessInstance(ProcessInstance processInstance, RestResponseFactory
restResponseFactory, UriInfo uriInfo) {
if (processInstance.isSuspended()) {
throw new BPMNConflictException("Process instance with id '" +
processInstance.getId() + "' is already suspended.");
}
RuntimeService runtimeService = BPMNOSGIService.getRuntimeService();
runtimeService.suspendProcessInstanceById(processInstance.getId());
ProcessInstanceResponse response = restResponseFactory.createProcessInstanceResponse(processInstance, uriInfo
.getBaseUri().toString());
// No need to re-fetch the instance, just alter the suspended state of the result-object
response.setSuspended(true);
return response;
}
示例2: suspendProcessInstance
import org.activiti.engine.RuntimeService; //导入方法依赖的package包/类
/**
* 暂停流程实例.
*/
@RequestMapping("console-suspendProcessInstance")
public String suspendProcessInstance(
@RequestParam("processInstanceId") String processInstanceId) {
RuntimeService runtimeService = processEngine.getRuntimeService();
runtimeService.suspendProcessInstanceById(processInstanceId);
return "redirect:/bpm/console-listProcessInstances.do";
}
示例3: suspendProcessInstance
import org.activiti.engine.RuntimeService; //导入方法依赖的package包/类
/**
* Suspend process instance by instance ID
*
* @param instanceId
* @throws BPSFault
*/
public void suspendProcessInstance(String instanceId) throws BPSFault {
Integer tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
RuntimeService runtimeService = BPMNServerHolder.getInstance().getEngine().getRuntimeService();
List<ProcessInstance> processInstances = runtimeService.createProcessInstanceQuery().processInstanceTenantId(tenantId.toString()).processInstanceId(instanceId).list();
if (processInstances.isEmpty()) {
String msg = "No process instances with the ID: " + instanceId;
log.error(msg);
throw new BPSFault(msg);
}
runtimeService.suspendProcessInstanceById(instanceId);
}