Java Code Examples for org.activiti.engine.query.Query#list()
The following examples show how to use
org.activiti.engine.query.Query#list() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PurchaseApplyUserInnerServiceSMOImpl.java From MicroCommunity with Apache License 2.0 | 5 votes |
/** * 获取用户审批的任务 * * @param user 用户信息 */ public List<PurchaseApplyDto> getUserHistoryTasks(@RequestBody AuditUser user) { HistoryService historyService = processEngine.getHistoryService(); HistoricTaskInstanceQuery historicTaskInstanceQuery = historyService.createHistoricTaskInstanceQuery() .processDefinitionKey("resourceEnter") .taskAssignee(user.getUserId()); if (!StringUtil.isEmpty(user.getAuditLink()) && "START".equals(user.getAuditLink())) { historicTaskInstanceQuery.taskName("resourceEnter"); } else if (!StringUtil.isEmpty(user.getAuditLink()) && "AUDIT".equals(user.getAuditLink())) { historicTaskInstanceQuery.taskName("resourceEnterDealUser"); } Query query = historicTaskInstanceQuery.orderByHistoricTaskInstanceStartTime().desc(); List<HistoricTaskInstance> list = null; if (user.getPage() != PageDto.DEFAULT_PAGE) { list = query.listPage((user.getPage() - 1) * user.getRow(), user.getRow()); } else { list = query.list(); } List<String> complaintIds = new ArrayList<>(); for (HistoricTaskInstance task : list) { String processInstanceId = task.getProcessInstanceId(); //3.使用流程实例,查询 HistoricProcessInstance pi = historyService.createHistoricProcessInstanceQuery().processInstanceId(processInstanceId).singleResult(); //4.使用流程实例对象获取BusinessKey String business_key = pi.getBusinessKey(); complaintIds.add(business_key); } //查询 投诉信息 // ComplaintDto complaintDto = new ComplaintDto(); // complaintDto.setStoreId(user.getStoreId()); // complaintDto.setCommunityId(user.getCommunityId()); // complaintDto.setComplaintIds(complaintIds.toArray(new String[complaintIds.size()])); // List<ComplaintDto> tmpComplaintDtos = complaintInnerServiceSMOImpl.queryComplaints(complaintDto); return null; }
Example 2
Source File: ComplaintUserInnerServiceSMOImpl.java From MicroCommunity with Apache License 2.0 | 5 votes |
/** * 获取用户审批的任务 * * @param user 用户信息 */ public List<ComplaintDto> getUserHistoryTasks(@RequestBody AuditUser user) { HistoryService historyService = processEngine.getHistoryService(); HistoricTaskInstanceQuery historicTaskInstanceQuery = historyService.createHistoricTaskInstanceQuery() .processDefinitionKey(getWorkflowDto(user.getCommunityId())) .taskAssignee(user.getUserId()); if (!StringUtil.isEmpty(user.getAuditLink()) && "START".equals(user.getAuditLink())) { historicTaskInstanceQuery.taskName("complaint"); } else if (!StringUtil.isEmpty(user.getAuditLink()) && "AUDIT".equals(user.getAuditLink())) { historicTaskInstanceQuery.taskName("complaitDealUser"); } Query query = historicTaskInstanceQuery.orderByHistoricTaskInstanceStartTime().desc(); List<HistoricTaskInstance> list = null; if (user.getPage() != PageDto.DEFAULT_PAGE) { list = query.listPage((user.getPage() - 1) * user.getRow(), user.getRow()); } else { list = query.list(); } List<String> complaintIds = new ArrayList<>(); for (HistoricTaskInstance task : list) { String processInstanceId = task.getProcessInstanceId(); //3.使用流程实例,查询 HistoricProcessInstance pi = historyService.createHistoricProcessInstanceQuery().processInstanceId(processInstanceId).singleResult(); //4.使用流程实例对象获取BusinessKey String business_key = pi.getBusinessKey(); complaintIds.add(business_key); } //查询 投诉信息 ComplaintDto complaintDto = new ComplaintDto(); complaintDto.setStoreId(user.getStoreId()); complaintDto.setCommunityId(user.getCommunityId()); complaintDto.setComplaintIds(complaintIds.toArray(new String[complaintIds.size()])); List<ComplaintDto> tmpComplaintDtos = complaintInnerServiceSMOImpl.queryComplaints(complaintDto); return tmpComplaintDtos; }