fix:【BPM 工作流】修复子流程发起人为列表时实际发起人会变成主流程发起人 https://gitee.com/zhijiantianya/yudao-cloud/issues/ICNHA8
This commit is contained in:
@@ -448,7 +448,7 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService
|
||||
.setNodeType(BpmSimpleModelNodeTypeEnum.CHILD_PROCESS.getType()).setStatus(processInstanceStatus)
|
||||
.setStartTime(DateUtils.of(activity.getStartTime()))
|
||||
.setEndTime(DateUtils.of(activity.getEndTime()))
|
||||
.setProcessInstanceId(activity.getProcessInstanceId());
|
||||
.setProcessInstanceId(activity.getCalledProcessInstanceId());
|
||||
approvalNodes.add(callActivity);
|
||||
}
|
||||
});
|
||||
@@ -520,7 +520,7 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService
|
||||
activityNode.setCandidateUserIds(CollUtil.sub(candidateUserIds, index + 1, candidateUserIds.size()));
|
||||
}
|
||||
if (BpmSimpleModelNodeTypeEnum.CHILD_PROCESS.getType().equals(activityNode.getNodeType())) {
|
||||
activityNode.setProcessInstanceId(firstActivity.getProcessInstanceId());
|
||||
activityNode.setProcessInstanceId(firstActivity.getCalledProcessInstanceId());
|
||||
}
|
||||
return activityNode;
|
||||
});
|
||||
|
||||
@@ -85,10 +85,15 @@ public class BpmCallActivityListener implements ExecutionListener {
|
||||
// 2.2 使用表单值,并兜底字符串转 Long 失败时使用主流程发起人
|
||||
try {
|
||||
FlowableUtils.setAuthenticatedUserId(Long.parseLong(formFieldValue));
|
||||
} catch (Exception e) {
|
||||
log.error("[notify][监听器:{},子流程监听器设置流程的发起人字符串转 Long 失败,字符串:{}]",
|
||||
DELEGATE_EXPRESSION, formFieldValue);
|
||||
FlowableUtils.setAuthenticatedUserId(Long.parseLong(processInstance.getStartUserId()));
|
||||
} catch (NumberFormatException ex) {
|
||||
try {
|
||||
List<Long> formFieldValues = JsonUtils.parseArray(formFieldValue, Long.class);
|
||||
FlowableUtils.setAuthenticatedUserId(formFieldValues.get(0));
|
||||
} catch (Exception e) {
|
||||
log.error("[notify][监听器:{},子流程监听器设置流程的发起人字符串转 Long 失败,字符串:{}]",
|
||||
DELEGATE_EXPRESSION, formFieldValue);
|
||||
FlowableUtils.setAuthenticatedUserId(Long.parseLong(processInstance.getStartUserId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user