无题

/**
* 根据任务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 ;
}







你可能感兴趣的:(无题)