Java Code Examples for org.activiti.engine.repository.ProcessDefinitionQuery#listPage()
The following examples show how to use
org.activiti.engine.repository.ProcessDefinitionQuery#listPage() .
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: ActProcessService.java From Shop-for-JavaWeb with MIT License | 6 votes |
/** * 流程定义列表 */ public Page<Object[]> processList(Page<Object[]> page, String category) { ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery() .latestVersion().orderByProcessDefinitionKey().asc(); if (StringUtils.isNotEmpty(category)){ processDefinitionQuery.processDefinitionCategory(category); } page.setCount(processDefinitionQuery.count()); List<ProcessDefinition> processDefinitionList = processDefinitionQuery.listPage(page.getFirstResult(), page.getMaxResults()); for (ProcessDefinition processDefinition : processDefinitionList) { String deploymentId = processDefinition.getDeploymentId(); Deployment deployment = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult(); page.getList().add(new Object[]{processDefinition, deployment}); } return page; }
Example 2
Source File: ActTaskService.java From Shop-for-JavaWeb with MIT License | 6 votes |
/** * 获取流程列表 * @param category 流程分类 */ public Page<Object[]> processList(Page<Object[]> page, String category) { /* * 保存两个对象,一个是ProcessDefinition(流程定义),一个是Deployment(流程部署) */ ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery() .latestVersion().active().orderByProcessDefinitionKey().asc(); if (StringUtils.isNotEmpty(category)){ processDefinitionQuery.processDefinitionCategory(category); } page.setCount(processDefinitionQuery.count()); List<ProcessDefinition> processDefinitionList = processDefinitionQuery.listPage(page.getFirstResult(), page.getMaxResults()); for (ProcessDefinition processDefinition : processDefinitionList) { String deploymentId = processDefinition.getDeploymentId(); Deployment deployment = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult(); page.getList().add(new Object[]{processDefinition, deployment}); } return page; }
Example 3
Source File: ProcessEngineService.java From open-cloud with MIT License | 5 votes |
/** * 查询流程定义列表 * * @return */ public IPage<ProcessDefinition> findProcessDefinition(String key, int firstResult, int maxResults) { ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery(); // 只查询最新版本 query.latestVersion(); if (StringUtils.isNotBlank(key)) { String processKey = "%" + key + "%"; query.processDefinitionKeyLike(processKey); } List<ProcessDefinition> list = query.listPage(firstResult, maxResults); IPage page = new Page(); page.setRecords(list); page.setTotal(query.count()); return page; }
Example 4
Source File: DeploymentController.java From activiti-in-action-codes with Apache License 2.0 | 5 votes |
/** * 流程定义列表 */ @RequestMapping(value = "/processes") public ModelAndView processList(HttpServletRequest request) { // 对应WEB-INF/views/chapter5/process-list.jsp String viewName = "chapter5/process-list"; Page<ProcessDefinition> page = new Page<ProcessDefinition>(PageUtil.PAGE_SIZE); int[] pageParams = PageUtil.init(page, request); ModelAndView mav = new ModelAndView(viewName); ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery(); List<ProcessDefinition> processDefinitionList = processDefinitionQuery.listPage(pageParams[0], pageParams[1]); page.setResult(processDefinitionList); page.setTotalCount(processDefinitionQuery.count()); mav.addObject("page", page); // 读取所有人员 List<User> users = identityService.createUserQuery().list(); mav.addObject("users", users); // 读取所有组 List<Group> groups = identityService.createGroupQuery().list(); mav.addObject("groups", groups); // 读取每个流程定义的候选属性 Map<String, Map<String, List<? extends Object>>> linksMap = setCandidateUserAndGroups(processDefinitionList); mav.addObject("linksMap", linksMap); return mav; }
Example 5
Source File: DeploymentController.java From activiti-in-action-codes with Apache License 2.0 | 5 votes |
/** * 流程定义列表--过滤激活的流程定义 */ @RequestMapping(value = "/process-list-view") public ModelAndView processListReadonly(HttpServletRequest request) { // 对应WEB-INF/views/chapter5/process-list.jsp String viewName = "chapter5/process-list-view"; Page<ProcessDefinition> page = new Page<ProcessDefinition>(PageUtil.PAGE_SIZE); int[] pageParams = PageUtil.init(page, request); ModelAndView mav = new ModelAndView(viewName); // User user = UserUtil.getUserFromSession(request.getSession()); // ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery().startableByUser(user.getId()); ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery(); processDefinitionQuery.suspended().active(); List<ProcessDefinition> processDefinitionList = processDefinitionQuery.listPage(pageParams[0], pageParams[1]); page.setResult(processDefinitionList); page.setTotalCount(processDefinitionQuery.count()); mav.addObject("page", page); // 读取每个流程定义的候选属性 Map<String, Map<String, List<? extends Object>>> linksMap = setCandidateUserAndGroups(processDefinitionList); mav.addObject("linksMap", linksMap); return mav; }
Example 6
Source File: DeploymentController.java From activiti-in-action-codes with Apache License 2.0 | 5 votes |
/** * 流程定义列表 */ @RequestMapping(value = "/process-list") public ModelAndView processList(HttpServletRequest request) { // 对应WEB-INF/views/chapter5/process-list.jsp String viewName = "chapter5/process-list"; Page<ProcessDefinition> page = new Page<ProcessDefinition>(PageUtil.PAGE_SIZE); int[] pageParams = PageUtil.init(page, request); ModelAndView mav = new ModelAndView(viewName); ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery(); List<ProcessDefinition> processDefinitionList = processDefinitionQuery.listPage(pageParams[0], pageParams[1]); page.setResult(processDefinitionList); page.setTotalCount(processDefinitionQuery.count()); mav.addObject("page", page); // 读取所有人员 List<User> users = identityService.createUserQuery().list(); mav.addObject("users", users); // 读取所有组 List<Group> groups = identityService.createGroupQuery().list(); mav.addObject("groups", groups); // 读取每个流程定义的候选属性 Map<String, Map<String, List<? extends Object>>> linksMap = setCandidateUserAndGroups(processDefinitionList); mav.addObject("linksMap", linksMap); return mav; }
Example 7
Source File: DeploymentController.java From activiti-in-action-codes with Apache License 2.0 | 5 votes |
/** * 流程定义列表--过滤激活的流程定义 */ @RequestMapping(value = "/process-list-view") public ModelAndView processListReadonly(HttpServletRequest request) { // 对应WEB-INF/views/chapter5/process-list.jsp String viewName = "chapter5/process-list-view"; Page<ProcessDefinition> page = new Page<ProcessDefinition>(PageUtil.PAGE_SIZE); int[] pageParams = PageUtil.init(page, request); ModelAndView mav = new ModelAndView(viewName); // User user = UserUtil.getUserFromSession(request.getSession()); // ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery().startableByUser(user.getId()); ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery(); processDefinitionQuery.suspended().active(); List<ProcessDefinition> processDefinitionList = processDefinitionQuery.listPage(pageParams[0], pageParams[1]); page.setResult(processDefinitionList); page.setTotalCount(processDefinitionQuery.count()); mav.addObject("page", page); // 读取每个流程定义的候选属性 Map<String, Map<String, List<? extends Object>>> linksMap = setCandidateUserAndGroups(processDefinitionList); mav.addObject("linksMap", linksMap); return mav; }
Example 8
Source File: DeploymentController.java From activiti-in-action-codes with Apache License 2.0 | 5 votes |
/** * 流程定义列表 */ @RequestMapping(value = "/process-list") public ModelAndView processList(HttpServletRequest request) { // 对应WEB-INF/views/chapter5/process-list.jsp String viewName = "chapter5/process-list"; Page<ProcessDefinition> page = new Page<ProcessDefinition>(PageUtil.PAGE_SIZE); int[] pageParams = PageUtil.init(page, request); ModelAndView mav = new ModelAndView(viewName); ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery(); List<ProcessDefinition> processDefinitionList = processDefinitionQuery.listPage(pageParams[0], pageParams[1]); page.setResult(processDefinitionList); page.setTotalCount(processDefinitionQuery.count()); mav.addObject("page", page); // 读取所有人员 List<User> users = identityService.createUserQuery().list(); mav.addObject("users", users); // 读取所有组 List<Group> groups = identityService.createGroupQuery().list(); mav.addObject("groups", groups); // 读取每个流程定义的候选属性 Map<String, Map<String, List<? extends Object>>> linksMap = setCandidateUserAndGroups(processDefinitionList); mav.addObject("linksMap", linksMap); return mav; }
Example 9
Source File: DeploymentController.java From activiti-in-action-codes with Apache License 2.0 | 5 votes |
/** * 流程定义列表--过滤激活的流程定义 */ @RequestMapping(value = "/process-list-view") public ModelAndView processListReadonly(HttpServletRequest request) { // 对应WEB-INF/views/chapter5/process-list.jsp String viewName = "chapter5/process-list-view"; Page<ProcessDefinition> page = new Page<ProcessDefinition>(PageUtil.PAGE_SIZE); int[] pageParams = PageUtil.init(page, request); ModelAndView mav = new ModelAndView(viewName); // User user = UserUtil.getUserFromSession(request.getSession()); // ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery().startableByUser(user.getId()); ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery(); processDefinitionQuery.suspended().active(); List<ProcessDefinition> processDefinitionList = processDefinitionQuery.listPage(pageParams[0], pageParams[1]); page.setResult(processDefinitionList); page.setTotalCount(processDefinitionQuery.count()); mav.addObject("page", page); // 读取每个流程定义的候选属性 Map<String, Map<String, List<? extends Object>>> linksMap = setCandidateUserAndGroups(processDefinitionList); mav.addObject("linksMap", linksMap); return mav; }
Example 10
Source File: DeploymentController.java From activiti-in-action-codes with Apache License 2.0 | 5 votes |
/** * 流程定义列表 */ @RequestMapping(value = "/process-list") public ModelAndView processList(HttpServletRequest request) { // 对应WEB-INF/views/chapter5/process-list.jsp String viewName = "chapter5/process-list"; Page<ProcessDefinition> page = new Page<ProcessDefinition>(PageUtil.PAGE_SIZE); int[] pageParams = PageUtil.init(page, request); ModelAndView mav = new ModelAndView(viewName); ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery(); List<ProcessDefinition> processDefinitionList = processDefinitionQuery.listPage(pageParams[0], pageParams[1]); page.setResult(processDefinitionList); page.setTotalCount(processDefinitionQuery.count()); mav.addObject("page", page); // 读取所有人员 List<User> users = identityService.createUserQuery().list(); mav.addObject("users", users); // 读取所有组 List<Group> groups = identityService.createGroupQuery().list(); mav.addObject("groups", groups); // 读取每个流程定义的候选属性 Map<String, Map<String, List<? extends Object>>> linksMap = setCandidateUserAndGroups(processDefinitionList); mav.addObject("linksMap", linksMap); return mav; }
Example 11
Source File: DeploymentController.java From activiti-in-action-codes with Apache License 2.0 | 5 votes |
/** * 流程定义列表--过滤激活的流程定义 */ @RequestMapping(value = "/process-list-view") public ModelAndView processListReadonly(HttpServletRequest request) { // 对应WEB-INF/views/chapter5/process-list.jsp String viewName = "chapter5/process-list-view"; Page<ProcessDefinition> page = new Page<ProcessDefinition>(PageUtil.PAGE_SIZE); int[] pageParams = PageUtil.init(page, request); ModelAndView mav = new ModelAndView(viewName); // User user = UserUtil.getUserFromSession(request.getSession()); // ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery().startableByUser(user.getId()); ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery(); processDefinitionQuery.suspended().active(); List<ProcessDefinition> processDefinitionList = processDefinitionQuery.listPage(pageParams[0], pageParams[1]); page.setResult(processDefinitionList); page.setTotalCount(processDefinitionQuery.count()); mav.addObject("page", page); // 读取每个流程定义的候选属性 Map<String, Map<String, List<? extends Object>>> linksMap = setCandidateUserAndGroups(processDefinitionList); mav.addObject("linksMap", linksMap); return mav; }
Example 12
Source File: DeploymentController.java From activiti-in-action-codes with Apache License 2.0 | 5 votes |
/** * 流程定义列表 */ @RequestMapping(value = "/process-list") public ModelAndView processList(HttpServletRequest request) { // 对应WEB-INF/views/chapter5/process-list.jsp String viewName = "chapter5/process-list"; Page<ProcessDefinition> page = new Page<ProcessDefinition>(PageUtil.PAGE_SIZE); int[] pageParams = PageUtil.init(page, request); ModelAndView mav = new ModelAndView(viewName); ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery(); List<ProcessDefinition> processDefinitionList = processDefinitionQuery.listPage(pageParams[0], pageParams[1]); page.setResult(processDefinitionList); page.setTotalCount(processDefinitionQuery.count()); mav.addObject("page", page); // 读取所有人员 List<User> users = identityService.createUserQuery().list(); mav.addObject("users", users); // 读取所有组 List<Group> groups = identityService.createGroupQuery().list(); mav.addObject("groups", groups); // 读取每个流程定义的候选属性 Map<String, Map<String, List<? extends Object>>> linksMap = setCandidateUserAndGroups(processDefinitionList); mav.addObject("linksMap", linksMap); return mav; }
Example 13
Source File: DeploymentController.java From activiti-in-action-codes with Apache License 2.0 | 5 votes |
/** * 流程定义列表--过滤激活的流程定义 */ @RequestMapping(value = "/process-list-view") public ModelAndView processListReadonly(HttpServletRequest request) { // 对应WEB-INF/views/chapter5/process-list.jsp String viewName = "chapter5/process-list-view"; Page<ProcessDefinition> page = new Page<ProcessDefinition>(PageUtil.PAGE_SIZE); int[] pageParams = PageUtil.init(page, request); ModelAndView mav = new ModelAndView(viewName); // User user = UserUtil.getUserFromSession(request.getSession()); // ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery().startableByUser(user.getId()); ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery(); processDefinitionQuery.suspended().active(); List<ProcessDefinition> processDefinitionList = processDefinitionQuery.listPage(pageParams[0], pageParams[1]); page.setResult(processDefinitionList); page.setTotalCount(processDefinitionQuery.count()); mav.addObject("page", page); // 读取每个流程定义的候选属性 Map<String, Map<String, List<? extends Object>>> linksMap = setCandidateUserAndGroups(processDefinitionList); mav.addObject("linksMap", linksMap); return mav; }