From 32f9d17983c6b667788b480687b9758d3398380f Mon Sep 17 00:00:00 2001 From: lenboo Date: Wed, 17 Jul 2019 15:35:16 +0800 Subject: [PATCH] update receiver and cc for child process --- .../src/main/java/cn/escheduler/dao/ProcessDao.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/escheduler-dao/src/main/java/cn/escheduler/dao/ProcessDao.java b/escheduler-dao/src/main/java/cn/escheduler/dao/ProcessDao.java index 09e2149d88..2bda59e5b3 100644 --- a/escheduler-dao/src/main/java/cn/escheduler/dao/ProcessDao.java +++ b/escheduler-dao/src/main/java/cn/escheduler/dao/ProcessDao.java @@ -890,6 +890,9 @@ public class ProcessDao extends AbstractBaseDao { cmdParam.put(CMDPARAM_COMPLEMENT_DATA_START_DATE, startTime); processMapStr = JSONUtils.toJson(cmdParam); } + + updateSubProcessDefinitionByParent(parentProcessInstance, childDefineId); + Command command = new Command(); command.setWarningType(parentProcessInstance.getWarningType()); command.setWarningGroupId(parentProcessInstance.getWarningGroupId()); @@ -904,6 +907,16 @@ public class ProcessDao extends AbstractBaseDao { logger.info("sub process command created: {} ", command.toString()); } + private void updateSubProcessDefinitionByParent(ProcessInstance parentProcessInstance, int childDefinitionId) { + ProcessDefinition fatherDefinition = this.findProcessDefineById(parentProcessInstance.getProcessDefinitionId()); + ProcessDefinition childDefinition = this.findProcessDefineById(childDefinitionId); + if(childDefinition != null && fatherDefinition != null){ + childDefinition.setReceivers(fatherDefinition.getReceivers()); + childDefinition.setReceiversCc(fatherDefinition.getReceiversCc()); + processDefineMapper.update(childDefinition); + } + } + /** * submit task to mysql * @param taskInstance