本文整理汇总了Java中org.activiti.engine.repository.ProcessDefinitionQuery.count方法的典型用法代码示例。如果您正苦于以下问题:Java ProcessDefinitionQuery.count方法的具体用法?Java ProcessDefinitionQuery.count怎么用?Java ProcessDefinitionQuery.count使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.activiti.engine.repository.ProcessDefinitionQuery
的用法示例。
在下文中一共展示了ProcessDefinitionQuery.count方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getProcessDefList
import org.activiti.engine.repository.ProcessDefinitionQuery; //导入方法依赖的package包/类
@Override
public List<ProcessDefVo> getProcessDefList(QueryCondition condition, PageInfo pageInfo) {
String name = null;
if (condition != null)
name = condition.getConditionMap().get("name").toString();
List<ProcessDefinition> processDefList;
long count;
ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery();
if (!StrUtil.isEmpty(name)) {
query = query.processDefinitionName(name);
}
count = query.count();
processDefList = query.orderByProcessDefinitionId().desc()
.listPage((pageInfo.getPageNum() - 1) * pageInfo.getPageSize(), pageInfo.getPageSize());
pageInfo.setCount((int) count);
List<ProcessDefVo> retList = new ArrayList<>();
for (ProcessDefinition processDefinition : processDefList) {
ProcessDefinitionEntity entity = (ProcessDefinitionEntity) processDefinition;
ProcessDefVo vo = new ProcessDefVo();
BeanUtils.copyProperties(entity, vo);
retList.add(vo);
}
return retList;
}
示例2: processList
import org.activiti.engine.repository.ProcessDefinitionQuery; //导入方法依赖的package包/类
/**
* 流程定义列表
*/
@GetMapping("/processList")
public ResponseMessage<PagerResult<ProcessDefinition>> processList(QueryParamEntity param) {
ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery();
param.getTerms().forEach((term) -> {
PropertyWrapper valueWrapper = new SimplePropertyWrapper(term.getValue());
String stringValue = valueWrapper.toString();
switch (term.getColumn()) {
case "name":
if (term.getTermType().equals(TermType.like)) {
processDefinitionQuery.processDefinitionNameLike(stringValue);
} else {
processDefinitionQuery.processDefinitionName(stringValue);
}
break;
case "key":
if (term.getTermType().equals(TermType.like)) {
processDefinitionQuery.processDefinitionKeyLike(stringValue);
} else {
processDefinitionQuery.processDefinitionKey(stringValue);
}
break;
case "category":
if (term.getTermType().equals(TermType.like)) {
processDefinitionQuery.processDefinitionCategoryLike(stringValue);
} else {
processDefinitionQuery.processDefinitionCategory(stringValue);
}
break;
case "deploymentId":
processDefinitionQuery.deploymentId(stringValue);
break;
}
});
int total = (int) processDefinitionQuery.count();
param.rePaging(total);
if (total == 0) {
return ResponseMessage.ok(PagerResult.empty());
}
List<ProcessDefinition> models = processDefinitionQuery
.listPage(param.getPageIndex(), param.getPageSize() * (param.getPageIndex() + 1))
.stream()
.map(SimpleProcessDefinition::new)
.collect(Collectors.toList());
return ResponseMessage.ok(new PagerResult<>(total, models));
}