Browse Source

fix sub process worker group id is 0

pull/2/head
lenboo 5 years ago
parent
commit
5c7515cf8c
  1. 10
      escheduler-api/src/main/java/cn/escheduler/api/service/ProcessInstanceService.java
  2. 3
      escheduler-dao/src/main/java/cn/escheduler/dao/ProcessDao.java

10
escheduler-api/src/main/java/cn/escheduler/api/service/ProcessInstanceService.java

@ -115,12 +115,18 @@ public class ProcessInstanceService extends BaseDAGService {
return checkResult;
}
ProcessInstance processInstance = processDao.findProcessInstanceDetailById(processId);
String workerGroupName = "";
if(processInstance.getWorkerGroupId() == -1){
processInstance.setWorkerGroupName(DEFAULT);
workerGroupName = DEFAULT;
}else{
WorkerGroup workerGroup = workerGroupMapper.queryById(processInstance.getWorkerGroupId());
processInstance.setWorkerGroupName(workerGroup.getName());
if(workerGroup != null){
workerGroupName = DEFAULT;
}else{
workerGroupName = workerGroup.getName();
}
}
processInstance.setWorkerGroupName(workerGroupName);
ProcessDefinition processDefinition = processDao.findProcessDefineById(processInstance.getProcessDefinitionId());
processInstance.setReceivers(processDefinition.getReceivers());
processInstance.setReceiversCc(processDefinition.getReceiversCc());

3
escheduler-dao/src/main/java/cn/escheduler/dao/ProcessDao.java

@ -493,7 +493,8 @@ public class ProcessDao extends AbstractBaseDao {
processInstance.setProcessInstanceJson(processDefinition.getProcessDefinitionJson());
// set process instance priority
processInstance.setProcessInstancePriority(command.getProcessInstancePriority());
processInstance.setWorkerGroupId(command.getWorkerGroupId());
int workerGroupId = command.getWorkerGroupId() == 0 ? -1 : command.getWorkerGroupId();
processInstance.setWorkerGroupId(workerGroupId);
processInstance.setTimeout(processDefinition.getTimeout());
processInstance.setTenantId(processDefinition.getTenantId());
return processInstance;

Loading…
Cancel
Save