@SuppressWarnings("rawtypes")
public Map<String, Object> getProcessDefitionList(Map<String, Object> params) throws SQLException {
Map<String,Object> resultMap = new HashMap<String,Object>();
String userId = StringUtil.getString(params.get("userId"));
ProcessEngine processEngine = getProcessEngine(userId);
ProcessDefinitionQuery processDefinitionQuery = processEngine.getModelService().createProcessDefinitionQuery();
try{
String processName = StringUtil.getString(params.get("queryProcessName"));
if(StringUtil.isNotEmpty(processName)){
processDefinitionQuery.processDefinitionNameLike(processName);
}
String processId = StringUtil.getString(params.get("queryProcessId"));
if(StringUtil.isNotEmpty(processId)){
processDefinitionQuery.processDefinitionKeyLike(processId);
}
String processCategory = StringUtil.getString(params.get("queryType"));
if(StringUtil.isNotEmpty(processCategory)){
processDefinitionQuery.processDefinitionCategoryLike(processCategory);
}
String pageI = StringUtil.getString(params.get("pageIndex"));
String rowI = StringUtil.getString(params.get("pageSize"));
int pageIndex=1;
int rowNum =15;
if(StringUtil.isNotEmpty(pageI)){
pageIndex = Integer.valueOf(pageI);
}
if(StringUtil.isNotEmpty(rowI)){
rowNum = Integer.valueOf(rowI);
}
// QueryExpandTo queryExpandTo = new QueryExpandTo();
// //添加扩展的字段
// queryExpandTo.setFieldSql("fixflow_def_deployment.deploy_Time");
// //增加扩展查询的left join语句
// queryExpandTo.setLeftJoinSql("left join fixflow_def_deployment on PD.deployment_id = fixflow_def_deployment.id");
// processDefinitionQuery.queryExpandTo(queryExpandTo);
processDefinitionQuery.orderByDeploymentTime().desc();
List<ProcessDefinitionBehavior> processDefinitions = processDefinitionQuery.listPagination(pageIndex, rowNum);
Long count = processDefinitionQuery.count();
List<Map<String,Object>> processDefinitionList = new ArrayList<Map<String,Object>>();
Pagination page = new Pagination(pageIndex,rowNum);
page.setTotal(count.intValue());
for(ProcessDefinitionBehavior processDefinition:processDefinitions){
Map<String,Object> processDefinitonMap = processDefinition.getPersistentState();