本文整理汇总了Java中org.activiti.engine.repository.ProcessDefinitionQuery.list方法的典型用法代码示例。如果您正苦于以下问题:Java ProcessDefinitionQuery.list方法的具体用法?Java ProcessDefinitionQuery.list怎么用?Java ProcessDefinitionQuery.list使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.activiti.engine.repository.ProcessDefinitionQuery
的用法示例。
在下文中一共展示了ProcessDefinitionQuery.list方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processList
import org.activiti.engine.repository.ProcessDefinitionQuery; //导入方法依赖的package包/类
/**
* 流程定义列表
*
* @return
*/
@GetMapping(value = "/processes")
public String processList(Model model) {
ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery().orderByDeploymentId().desc();
List<ProcessDefinition> processDefinitionList = processDefinitionQuery.list();
model.addAttribute("processDefinitionList", processDefinitionList);
return "workflow/processes";
}
示例2: testQuerySorting
import org.activiti.engine.repository.ProcessDefinitionQuery; //导入方法依赖的package包/类
public void testQuerySorting() {
// asc
ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery().orderByProcessDefinitionId().asc();
verifyQueryResults(query, 3);
query = repositoryService.createProcessDefinitionQuery().orderByDeploymentId().asc();
verifyQueryResults(query, 3);
query = repositoryService.createProcessDefinitionQuery().orderByProcessDefinitionKey().asc();
verifyQueryResults(query, 3);
query = repositoryService.createProcessDefinitionQuery().orderByProcessDefinitionVersion().asc();
verifyQueryResults(query, 3);
// desc
query = repositoryService.createProcessDefinitionQuery().orderByProcessDefinitionId().desc();
verifyQueryResults(query, 3);
query = repositoryService.createProcessDefinitionQuery().orderByDeploymentId().desc();
verifyQueryResults(query, 3);
query = repositoryService.createProcessDefinitionQuery().orderByProcessDefinitionKey().desc();
verifyQueryResults(query, 3);
query = repositoryService.createProcessDefinitionQuery().orderByProcessDefinitionVersion().desc();
verifyQueryResults(query, 3);
// Typical use case
query = repositoryService.createProcessDefinitionQuery().orderByProcessDefinitionKey().asc().orderByProcessDefinitionVersion().desc();
List<ProcessDefinition> processDefinitions = query.list();
assertEquals(3, processDefinitions.size());
assertEquals("one", processDefinitions.get(0).getKey());
assertEquals(2, processDefinitions.get(0).getVersion());
assertEquals("one", processDefinitions.get(1).getKey());
assertEquals(1, processDefinitions.get(1).getVersion());
assertEquals("two", processDefinitions.get(2).getKey());
assertEquals(1, processDefinitions.get(2).getVersion());
}