无题

来源:互联网 发布:建筑施工仿真软件 编辑:程序博客网 时间:2024/06/05 22:52
/**
* 根据任务ID删除流程实例

* @param taskId
*            任务ID
* @return
*/
public String deleteTaskById(String taskId)
{
String result = EsunnyConst.FAIL ;
Task task = null ;
String processInstanceId = null ; 

try {
task = processEngine.getTaskService().getTask(taskId) ;
// 判断
if(task != null) {
processInstanceId = task.getExecutionId() ;

// 删除流程实例
if(processInstanceId != null) {
processEngine.getExecutionService().deleteProcessInstanceCascade(processInstanceId) ;
result = EsunnyConst.SUCCEED ;
}
}
} catch(Exception e) {
result = EsunnyConst.FAIL ;
e.printStackTrace();
logger.error(e.getMessage(), e);
throw new RuntimeException("session 超时!");
}

return result ;
}







原创粉丝点击