本文整理汇总了Java中org.activiti.engine.runtime.ProcessInstanceQuery.processInstanceBusinessKey方法的典型用法代码示例。如果您正苦于以下问题:Java ProcessInstanceQuery.processInstanceBusinessKey方法的具体用法?Java ProcessInstanceQuery.processInstanceBusinessKey怎么用?Java ProcessInstanceQuery.processInstanceBusinessKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.activiti.engine.runtime.ProcessInstanceQuery
的用法示例。
在下文中一共展示了ProcessInstanceQuery.processInstanceBusinessKey方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getProcessInstanceList
import org.activiti.engine.runtime.ProcessInstanceQuery; //导入方法依赖的package包/类
@Override
public List<ProcessInstanceVo> getProcessInstanceList(QueryCondition condition, PageInfo pageInfo) {
//查询条件
String name = null; //流程实例名称
String businessKey = null;//业务key
String category = null; //业务类型编码
Map<String, String> conditionMap = condition.getConditionMap();
if (conditionMap != null) {
if (conditionMap.get("name") != null)
name = conditionMap.get("name").toString();
if (conditionMap.get("businessKey") != null)
businessKey = conditionMap.get("businessKey").toString();
if (conditionMap.get("category") != null)
category = conditionMap.get("category").toString();
}
List<ProcessInstance> instanceList;
long count;
ProcessInstanceQuery query = runtimeService.createProcessInstanceQuery();
if (!StrUtil.isEmpty(name)) {
query = query.processInstanceNameLike(name);
}
if (!StrUtil.isEmpty(businessKey)) {
query = query.processInstanceBusinessKey(businessKey);
}
if (!StrUtil.isEmpty(category)) {
query = query.processDefinitionCategory(category);
}
count = query.count();
instanceList = query.orderByProcessInstanceId().desc().listPage((pageInfo.getPageNum() - 1) * pageInfo
.getPageSize(), pageInfo.getPageSize());
pageInfo.setCount((int) count);
//原来类型为ExecutionEntity,再向前台json格式化的时候出现异常,所以转化为ProcessInstanceVo
List<ProcessInstanceVo> volist = new ArrayList<>();
for (ProcessInstance processInstance : instanceList) {
ProcessInstanceVo vo = new ProcessInstanceVo();
BeanUtils.copyProperties(processInstance, vo);
//业务类型
ProcessDefinition processDefinition = repositoryService.getProcessDefinition(processInstance
.getProcessDefinitionId());
vo.setCategory(processDefinition.getCategory());
vo.setStartUserId(getStartUserId(processInstance));
vo.setStartUserName(identityPageService.getUserNamesByUserIds(vo.getStartUserId()));
volist.add(vo);
}
return volist;
}
示例2: getQueryResponse
import org.activiti.engine.runtime.ProcessInstanceQuery; //导入方法依赖的package包/类
protected DataResponse getQueryResponse(ProcessInstanceQueryRequest queryRequest,
Map<String, String> requestParams, UriInfo uriInfo) {
RuntimeService runtimeService = BPMNOSGIService.getRuntimeService();
ProcessInstanceQuery query = runtimeService.createProcessInstanceQuery();
// Populate query based on request
if (queryRequest.getProcessInstanceId() != null) {
query.processInstanceId(queryRequest.getProcessInstanceId());
}
if (queryRequest.getProcessDefinitionKey() != null) {
query.processDefinitionKey(queryRequest.getProcessDefinitionKey());
}
if (queryRequest.getProcessDefinitionId() != null) {
query.processDefinitionId(queryRequest.getProcessDefinitionId());
}
if (queryRequest.getProcessBusinessKey() != null) {
query.processInstanceBusinessKey(queryRequest.getProcessBusinessKey());
}
if (queryRequest.getInvolvedUser() != null) {
query.involvedUser(queryRequest.getInvolvedUser());
}
if (queryRequest.getSuspended() != null) {
if (queryRequest.getSuspended()) {
query.suspended();
} else {
query.active();
}
}
if (queryRequest.getSubProcessInstanceId() != null) {
query.subProcessInstanceId(queryRequest.getSubProcessInstanceId());
}
if (queryRequest.getSuperProcessInstanceId() != null) {
query.superProcessInstanceId(queryRequest.getSuperProcessInstanceId());
}
if (queryRequest.getExcludeSubprocesses() != null) {
query.excludeSubprocesses(queryRequest.getExcludeSubprocesses());
}
if (queryRequest.getIncludeProcessVariables() != null) {
if (queryRequest.getIncludeProcessVariables()) {
query.includeProcessVariables();
}
}
if (queryRequest.getVariables() != null) {
addVariables(query, queryRequest.getVariables());
}
if(queryRequest.getTenantId() != null) {
query.processInstanceTenantId(queryRequest.getTenantId());
}
if(queryRequest.getTenantIdLike() != null) {
query.processInstanceTenantIdLike(queryRequest.getTenantIdLike());
}
if(Boolean.TRUE.equals(queryRequest.getWithoutTenantId())) {
query.processInstanceWithoutTenantId();
}
return new ProcessInstancePaginateList(new RestResponseFactory(), uriInfo)
.paginateList(requestParams, queryRequest, query, "id", allowedSortProperties);
}