本文整理汇总了Java中org.activiti.engine.repository.ProcessDefinitionQuery.listPage方法的典型用法代码示例。如果您正苦于以下问题:Java ProcessDefinitionQuery.listPage方法的具体用法?Java ProcessDefinitionQuery.listPage怎么用?Java ProcessDefinitionQuery.listPage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.activiti.engine.repository.ProcessDefinitionQuery
的用法示例。
在下文中一共展示了ProcessDefinitionQuery.listPage方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processList
import org.activiti.engine.repository.ProcessDefinitionQuery; //导入方法依赖的package包/类
/**
* 流程定义列表
*/
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;
}
示例2: processList
import org.activiti.engine.repository.ProcessDefinitionQuery; //导入方法依赖的package包/类
/**
* 获取流程列表
* @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;
}
示例3: processList
import org.activiti.engine.repository.ProcessDefinitionQuery; //导入方法依赖的package包/类
/**
* 流程定义列表
*/
@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;
}
示例4: processListReadonly
import org.activiti.engine.repository.ProcessDefinitionQuery; //导入方法依赖的package包/类
/**
* 流程定义列表--过滤激活的流程定义
*/
@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;
}
示例5: processList
import org.activiti.engine.repository.ProcessDefinitionQuery; //导入方法依赖的package包/类
/**
* 流程定义列表
*/
@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;
}