if (!StringUtils.equals(processType, "all")) {
/*
* 只读取动态表单的流程
*/
ProcessDefinitionQuery query1 = repositoryService.createProcessDefinitionQuery().processDefinitionKey("leave-dynamic-from").active().orderByDeploymentId().desc();
List<ProcessDefinition> list = query1.listPage(pageParams[0], pageParams[1]);
ProcessDefinitionQuery query2 = repositoryService.createProcessDefinitionQuery().processDefinitionKey("dispatch").active().orderByDeploymentId().desc();
List<ProcessDefinition> dispatchList = query2.listPage(pageParams[0], pageParams[1]);
ProcessDefinitionQuery query3 = repositoryService.createProcessDefinitionQuery().processDefinitionKey("leave-jpa").active().orderByDeploymentId().desc();
List<ProcessDefinition> list3 = query3.listPage(pageParams[0], pageParams[1]);
list.addAll(list3);
list.addAll(dispatchList);
page.setResult(list);
page.setTotalCount(query1.count() + query2.count());
} else {
// 读取所有流程
ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery().active().orderByDeploymentId().desc();
List<ProcessDefinition> list = query.list();
page.setResult(list);
page.setTotalCount(query.count());
}
mav.addObject("page", page);
return mav;
}