/** 已办任务. */ public Page findFinishedTasks(String userId, int pageNo, int pageSize) { Page page = taskInfoManager.pagedQuery( "from TaskInfo where assignee=? and status='complete'", pageNo, pageSize, userId); List<TaskInfo> taskInfos = (List<TaskInfo>) page.getResult(); List<HumanTaskDTO> humanTaskDtos = this.convertHumanTaskDtos(taskInfos); page.setResult(humanTaskDtos); return page; }
/** 部署. */ public Page findDeployments(String tenantId, Page page) { RepositoryService repositoryService = processEngine.getRepositoryService(); long count = repositoryService.createDeploymentQuery().deploymentTenantId(tenantId).count(); List<Deployment> deployments = repositoryService .createDeploymentQuery() .deploymentTenantId(tenantId) .listPage((int) page.getStart(), page.getPageSize()); page.setResult(deployments); page.setTotalCount(count); return page; }
/** 任务. */ public Page findTasks(String tenantId, Page page) { TaskService taskService = processEngine.getTaskService(); long count = taskService.createTaskQuery().taskTenantId(tenantId).count(); List<Task> tasks = taskService .createTaskQuery() .taskTenantId(tenantId) .listPage((int) page.getStart(), page.getPageSize()); page.setResult(tasks); page.setTotalCount(count); return page; }
/** 作业. */ public Page findJobs(String tenantId, Page page) { ManagementService managementService = processEngine.getManagementService(); long count = managementService.createJobQuery().jobTenantId(tenantId).count(); List<Job> jobs = managementService .createJobQuery() .jobTenantId(tenantId) .listPage((int) page.getStart(), page.getPageSize()); page.setResult(jobs); page.setTotalCount(count); return page; }
/** 历史任务. */ public Page findHistoricTaskInstances(String tenantId, Page page) { HistoryService historyService = processEngine.getHistoryService(); long count = historyService.createHistoricTaskInstanceQuery().taskTenantId(tenantId).count(); List<HistoricTaskInstance> historicTaskInstances = historyService .createHistoricTaskInstanceQuery() .taskTenantId(tenantId) .listPage((int) page.getStart(), page.getPageSize()); page.setResult(historicTaskInstances); page.setTotalCount(count); return page; }
/** 流程实例. */ public Page findProcessInstances(String tenantId, Page page) { RuntimeService runtimeService = processEngine.getRuntimeService(); long count = runtimeService.createProcessInstanceQuery().processInstanceTenantId(tenantId).count(); List<ProcessInstance> processInstances = runtimeService .createProcessInstanceQuery() .processInstanceTenantId(tenantId) .listPage((int) page.getStart(), page.getPageSize()); page.setResult(processInstances); page.setTotalCount(count); return page; }
@RequestMapping("user-status-list") public String list( @ModelAttribute Page page, @RequestParam Map<String, Object> parameterMap, Model model) { List<PropertyFilter> propertyFilters = PropertyFilter.buildFromMap(parameterMap); propertyFilters.add(new PropertyFilter("EQS_scopeId", ScopeHolder.getScopeId())); page = userStatusManager.pagedQuery(page, propertyFilters); List<UserStatus> userStatuses = (List<UserStatus>) page.getResult(); List<UserStatusDTO> userStatusDtos = userStatusConverter.createUserStatusDtos( userStatuses, ScopeHolder.getUserRepoRef(), ScopeHolder.getScopeId()); page.setResult(userStatusDtos); model.addAttribute("page", page); return "auth/user-status-list"; }
/** 流程定义. */ public Page findProcessDefinitions(String tenantId, Page page) { RepositoryService repositoryService = processEngine.getRepositoryService(); long count = repositoryService .createProcessDefinitionQuery() .processDefinitionTenantId(tenantId) .count(); List<ProcessDefinition> processDefinitions = repositoryService .createProcessDefinitionQuery() .processDefinitionTenantId(tenantId) .listPage((int) page.getStart(), page.getPageSize()); page.setResult(processDefinitions); page.setTotalCount(count); return page; }
/** 参与流程. */ public Page findInvolvedProcessInstances(String userId, String tenantId, Page page) { HistoryService historyService = processEngine.getHistoryService(); // TODO: finished(), unfinished() long count = historyService .createHistoricProcessInstanceQuery() .processInstanceTenantId(tenantId) .involvedUser(userId) .count(); List<HistoricProcessInstance> historicProcessInstances = historyService .createHistoricProcessInstanceQuery() .processInstanceTenantId(tenantId) .involvedUser(userId) .listPage((int) page.getStart(), page.getPageSize()); page.setResult(historicProcessInstances); page.setTotalCount(count); return page; }
/** 未结流程. */ public Page findRunningProcessInstances(String userId, String tenantId, Page page) { HistoryService historyService = processEngine.getHistoryService(); // TODO: 改成通过runtime表搜索,提高效率 long count = historyService .createHistoricProcessInstanceQuery() .processInstanceTenantId(tenantId) .startedBy(userId) .unfinished() .count(); List<HistoricProcessInstance> historicProcessInstances = historyService .createHistoricProcessInstanceQuery() .processInstanceTenantId(tenantId) .startedBy(userId) .unfinished() .listPage((int) page.getStart(), page.getPageSize()); page.setResult(historicProcessInstances); page.setTotalCount(count); return page; }