当前位置: 首页>>代码示例>>Java>>正文


Java RuntimeService.suspendProcessInstanceById方法代码示例

本文整理汇总了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;
}
 
开发者ID:wso2,项目名称:carbon-business-process,代码行数:18,代码来源:BaseProcessInstanceService.java

示例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";
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:12,代码来源:ConsoleController.java

示例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);
}
 
开发者ID:wso2,项目名称:carbon-business-process,代码行数:18,代码来源:BPMNInstanceService.java


注:本文中的org.activiti.engine.RuntimeService.suspendProcessInstanceById方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。