|
@@ -144,28 +144,18 @@ public class GlobalActivityEventListener extends AbstractFlowableEngineEventList
|
|
|
BpmnModel bpmnModel = repositoryService.getBpmnModel(execution.getProcessDefinitionId());
|
|
|
// 获取当前节点
|
|
|
FlowElement currentFlowElement = bpmnModel.getFlowElement(execution.getCurrentActivityId());
|
|
|
- log.info("当前节点: {}", currentFlowElement.getName());
|
|
|
- log.info("当前节点: {}", currentFlowElement.getId());
|
|
|
+ log.info("当前节点名称: {}", currentFlowElement.getName());
|
|
|
+ log.info("当前节点ID: {}", currentFlowElement.getId());
|
|
|
+ log.info("当前节点类型: {}", currentFlowElement.getClass().getSimpleName());
|
|
|
|
|
|
- // 判断是否是最后一个节点(结束事件)
|
|
|
- if (currentFlowElement instanceof EndEvent) {
|
|
|
- // 最后一个节点,消息发送人为当前登录用户
|
|
|
- String username = Objects.requireNonNull(SecurityContextUtil.getUserInfo()).getUsername();
|
|
|
- log.info("这是最后一个节点,登录用户: {}", username);
|
|
|
- notify.setSender(username);
|
|
|
- } else {
|
|
|
- // 其余节点,消息发送人为发起人
|
|
|
- notify.setSender(startUserId);
|
|
|
- }
|
|
|
+ // 消息发送人为发起人
|
|
|
+ notify.setSender(startUserId);
|
|
|
|
|
|
notify.setType(NotifyEnum.TODO);
|
|
|
notify.setReceiver(entity.getAssignee());
|
|
|
notify.setReceivingTime(LocalDateTime.now());
|
|
|
notify.setUrl("/flow/todo");
|
|
|
notifyService.notify(notify);
|
|
|
-
|
|
|
- log.info("当前节点 ID: {}", execution.getCurrentActivityId());
|
|
|
- log.info("当前节点类型: {}", currentFlowElement.getClass().getSimpleName());
|
|
|
}
|
|
|
});
|
|
|
}
|
|
@@ -200,6 +190,8 @@ public class GlobalActivityEventListener extends AbstractFlowableEngineEventList
|
|
|
ExecutionEntityImpl entity = (ExecutionEntityImpl) event.getEntity();
|
|
|
String instanceId = entity.getProcessInstanceId();
|
|
|
|
|
|
+ DelegateExecution execution = super.getExecution(event);
|
|
|
+
|
|
|
// 获取表单标题(实例名称)
|
|
|
// ProcessInstance processInstance = runtimeService.createProcessInstanceQuery()
|
|
|
// .processInstanceId(instanceId)
|
|
@@ -225,6 +217,7 @@ public class GlobalActivityEventListener extends AbstractFlowableEngineEventList
|
|
|
// notify.setContent(String.format("您申请的流程《%s》已通过", entity.getName()));
|
|
|
notify.setSubject("申请已通过" + "-" + fromName);
|
|
|
notify.setContent(fromName + "-" + "已完结");
|
|
|
+ // notify.setSender(Objects.requireNonNull(SecurityContextUtil.getUserInfo()).getUsername());
|
|
|
notify.setSender(entity.getStartUserId());
|
|
|
notify.setType(NotifyEnum.SYSTEM);
|
|
|
notify.setReceiver(entity.getStartUserId());
|