update - 为所有事件,添加日志标识,方便后续快速排查问题

This commit is contained in:
wangli 2023-12-12 00:18:14 +08:00
parent 18d7e84fd6
commit a7e4914dc1
18 changed files with 128 additions and 83 deletions

View File

@ -17,18 +17,18 @@ import java.util.List;
import static cn.axzo.workflow.core.common.utils.BpmnMetaParserHelper.getApproverSpecify; import static cn.axzo.workflow.core.common.utils.BpmnMetaParserHelper.getApproverSpecify;
/** /**
* TODO * 自定义的推测用户任务的审批人的命令实现
* *
* @author wangli * @author wangli
* @since 2023/12/11 17:56 * @since 2023/12/11 17:56
*/ */
public class CustomCalcAssigneeCmd implements Command<List<BpmnTaskDelegateAssigner>>, Serializable { public class CustomForecastUserTaskAssigneeCmd implements Command<List<BpmnTaskDelegateAssigner>>, Serializable {
private String processInstanceId; private final String processInstanceId;
private UserTask userTask; private final UserTask userTask;
private EngineExecutionStartListener engineExecutionStartListener; private final EngineExecutionStartListener engineExecutionStartListener;
public CustomCalcAssigneeCmd(String processInstanceId, UserTask userTask, public CustomForecastUserTaskAssigneeCmd(String processInstanceId, UserTask userTask,
EngineExecutionStartListener engineExecutionStartListener) { EngineExecutionStartListener engineExecutionStartListener) {
this.processInstanceId = processInstanceId; this.processInstanceId = processInstanceId;
this.userTask = userTask; this.userTask = userTask;
this.engineExecutionStartListener = engineExecutionStartListener; this.engineExecutionStartListener = engineExecutionStartListener;

View File

@ -8,6 +8,7 @@ import org.flowable.common.engine.api.delegate.event.FlowableEngineEventType;
import org.flowable.engine.delegate.event.AbstractFlowableEngineEventListener; import org.flowable.engine.delegate.event.AbstractFlowableEngineEventListener;
import org.flowable.engine.delegate.event.FlowableActivityCancelledEvent; import org.flowable.engine.delegate.event.FlowableActivityCancelledEvent;
import org.flowable.engine.delegate.event.FlowableActivityEvent; import org.flowable.engine.delegate.event.FlowableActivityEvent;
import org.flowable.engine.delegate.event.FlowableMultiInstanceActivityCancelledEvent;
import org.flowable.engine.delegate.event.FlowableMultiInstanceActivityCompletedEvent; import org.flowable.engine.delegate.event.FlowableMultiInstanceActivityCompletedEvent;
import org.springframework.beans.factory.ObjectProvider; import org.springframework.beans.factory.ObjectProvider;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -20,6 +21,8 @@ import java.util.Set;
import static org.flowable.common.engine.api.delegate.event.FlowableEngineEventType.ACTIVITY_CANCELLED; import static org.flowable.common.engine.api.delegate.event.FlowableEngineEventType.ACTIVITY_CANCELLED;
import static org.flowable.common.engine.api.delegate.event.FlowableEngineEventType.ACTIVITY_COMPLETED; import static org.flowable.common.engine.api.delegate.event.FlowableEngineEventType.ACTIVITY_COMPLETED;
import static org.flowable.common.engine.api.delegate.event.FlowableEngineEventType.ACTIVITY_STARTED; import static org.flowable.common.engine.api.delegate.event.FlowableEngineEventType.ACTIVITY_STARTED;
import static org.flowable.common.engine.api.delegate.event.FlowableEngineEventType.MULTI_INSTANCE_ACTIVITY_CANCELLED;
import static org.flowable.common.engine.api.delegate.event.FlowableEngineEventType.MULTI_INSTANCE_ACTIVITY_COMPLETED;
import static org.flowable.common.engine.api.delegate.event.FlowableEngineEventType.MULTI_INSTANCE_ACTIVITY_COMPLETED_WITH_CONDITION; import static org.flowable.common.engine.api.delegate.event.FlowableEngineEventType.MULTI_INSTANCE_ACTIVITY_COMPLETED_WITH_CONDITION;
/** /**
@ -40,6 +43,8 @@ public class EngineActivityEventListener extends AbstractFlowableEngineEventList
.add(ACTIVITY_STARTED) .add(ACTIVITY_STARTED)
.add(ACTIVITY_COMPLETED) .add(ACTIVITY_COMPLETED)
.add(MULTI_INSTANCE_ACTIVITY_COMPLETED_WITH_CONDITION) .add(MULTI_INSTANCE_ACTIVITY_COMPLETED_WITH_CONDITION)
.add(MULTI_INSTANCE_ACTIVITY_COMPLETED)
.add(MULTI_INSTANCE_ACTIVITY_CANCELLED)
.add(ACTIVITY_CANCELLED) .add(ACTIVITY_CANCELLED)
.build(); .build();
@ -65,13 +70,19 @@ public class EngineActivityEventListener extends AbstractFlowableEngineEventList
} }
/** /**
* 多实例 UserTask 通过, * 多实例 UserTask 条件通过
* *
* @param event * @param event
*/ */
@Override @Override
protected void multiInstanceActivityCompletedWithCondition(FlowableMultiInstanceActivityCompletedEvent event) { protected void multiInstanceActivityCompletedWithCondition(FlowableMultiInstanceActivityCompletedEvent event) {
log.info("activityCompleted: activityId: {} activityName: {}", event.getActivityId(), event.getActivityName()); log.info("multiInstanceActivityCompletedWithCondition: activityId: {} activityName: {}", event.getActivityId(), event.getActivityName());
getOrderedListeners().forEach(i -> i.onCompleted(event));
}
@Override
protected void multiInstanceActivityCompleted(FlowableMultiInstanceActivityCompletedEvent event) {
log.info("multiInstanceActivityCompleted: activityId: {} activityName: {}", event.getActivityId(), event.getActivityName());
getOrderedListeners().forEach(i -> i.onCompleted(event)); getOrderedListeners().forEach(i -> i.onCompleted(event));
} }
@ -81,6 +92,11 @@ public class EngineActivityEventListener extends AbstractFlowableEngineEventList
getOrderedListeners().forEach(i -> i.onCancelled(event)); getOrderedListeners().forEach(i -> i.onCancelled(event));
} }
@Override
protected void multiInstanceActivityCancelled(FlowableMultiInstanceActivityCancelledEvent event) {
log.info("multiInstanceActivityCancelled: activityId: {} activityName: {}", event.getActivityId(), event.getActivityName());
getOrderedListeners().forEach(i -> i.onCancelled(event));
}
private List<BpmnActivityEventListener> getOrderedListeners() { private List<BpmnActivityEventListener> getOrderedListeners() {
List<BpmnActivityEventListener> orderListeners = new ArrayList<>(); List<BpmnActivityEventListener> orderListeners = new ArrayList<>();

View File

@ -91,7 +91,7 @@ public class EngineExecutionStartListener implements ExecutionListener {
switch (method) { switch (method) {
case autoPassed: case autoPassed:
case autoRejection: case autoRejection:
// Do nothing, // Do nothing.
// 统一由 cn.axzo.workflow.server.controller.listener.task.AutoOperatorEventListener 来处理 // 统一由 cn.axzo.workflow.server.controller.listener.task.AutoOperatorEventListener 来处理
break; break;
default: default:
@ -132,15 +132,10 @@ public class EngineExecutionStartListener implements ExecutionListener {
log.info("当前节点: id: {}, name: {} 审批人为空", userTask.getId(), userTask.getName()); log.info("当前节点: id: {}, name: {} 审批人为空", userTask.getId(), userTask.getName());
getApproverEmptyHandleType(userTask).ifPresent(type -> { getApproverEmptyHandleType(userTask).ifPresent(type -> {
switch (type) { switch (type) {
// 自动通过和驳回, 统一由 cn.axzo.workflow.server.controller.listener.task.AutoOperatorEventListener 来处理
case autoPassed: case autoPassed:
// 自动通过的默认引擎参数必须设置为 true
// execution.setTransientVariable(BpmnConstants.FLOWABLE_SKIP_EXPRESSION_ENABLE, true);
// 设置当前 UserTask 使用的 skip 表达式
// execution.setTransientVariable(BPM_ALLOW_SKIP_USER_TASK, true);
// break;
case autoRejection: case autoRejection:
// execution.setTransientVariable(BPM_ALLOW_AUTO_REJECTION, true); // Do nothing.
// 自动通过和驳回, 统一由 cn.axzo.workflow.server.controller.listener.task.AutoOperatorEventListener 来处理
break; break;
case transferToAdmin: case transferToAdmin:
assigners.addAll(approverSelect(ApproverEmptyHandleTypeEnum.transferToAdmin.getType(), userTask, assigners.addAll(approverSelect(ApproverEmptyHandleTypeEnum.transferToAdmin.getType(), userTask,
@ -168,7 +163,23 @@ public class EngineExecutionStartListener implements ExecutionListener {
public List<BpmnTaskDelegateAssigner> approverSelect(String type, UserTask userTask, DelegateExecution execution) { public List<BpmnTaskDelegateAssigner> approverSelect(String type, UserTask userTask, DelegateExecution execution) {
List<BpmnTaskDelegateAssigner> assigners = new ArrayList<>(); List<BpmnTaskDelegateAssigner> assigners = new ArrayList<>();
// 如果开启了 mock 模式workflow.mock=true, 则直接返回 mock 的审批人 // 如果开启了 mock 模式workflow.mock=true, 则根据 mock 配置去选择审批人
/*
* nacos 中的的示例配置
* workflow:
* mock: true # 默认为 false, 开启 mock
* assignee:
* global: false # 默认为 true, 是否开启所有流程都使用该配置,
* category: '16' # 只有 global=false 只针对这一个业务分类编号的流程实例有效
* # 自定义节点的审批人当节点配置的审批方式不等于自动通过或拒绝时优先级最高同时上面的 mock 也必须为 true
* # map 中的 key = activityId = taskDefinitionKey value List<BpmnTaskDelegateAssigner> JSON 字符串
* map: "{
* node_747571121516: '[{\"assignerName\":\"王庆\",\"ouId\":\"5140\",\"tenantId\":\"195\",\"personId\":\"85047\",\"assignee\":\"2001205\",\"assigneeType\":\"3\"}]',
* node_747618945956: '[{\"assignerName\":\"杨秋菊\",\"ouId\":\"5140\",\"tenantId\":\"195\",\"personId\":\"80792\",\"assignee\":\"2000028\",\"assigneeType\":\"3\"}]',
* node_747602616511: '[{\"assignerName\":\"杨凯\",\"ouId\":\"5140\",\"tenantId\":\"195\",\"personId\":\"2390\",\"assignee\":\"2004125\",\"assigneeType\":\"3\"}]',
* node_868689511037: '[{\"assignerName\":\"邓九洲\",\"ouId\":\"5140\",\"tenantId\":\"195\",\"personId\":\"89508\",\"assignee\":\"2000560\",\"assigneeType\":\"3\"}]'
* }"
*/
if ((mock && global) || if ((mock && global) ||
(mock && !global && Objects.equals(category, execution.getProcessDefinitionId().split(":")[0]))) { (mock && !global && Objects.equals(category, execution.getProcessDefinitionId().split(":")[0]))) {
assigners.addAll(new MockTaskAssigneeSelector(assigneeMap, global, category).select(userTask, execution)); assigners.addAll(new MockTaskAssigneeSelector(assigneeMap, global, category).select(userTask, execution));

View File

@ -19,7 +19,7 @@ import cn.axzo.workflow.core.common.enums.BpmnProcessTaskResultEnum;
import cn.axzo.workflow.core.common.exception.WorkflowEngineException; import cn.axzo.workflow.core.common.exception.WorkflowEngineException;
import cn.axzo.workflow.core.common.utils.BpmnCollectionUtils; import cn.axzo.workflow.core.common.utils.BpmnCollectionUtils;
import cn.axzo.workflow.core.common.utils.BpmnMetaParserHelper; import cn.axzo.workflow.core.common.utils.BpmnMetaParserHelper;
import cn.axzo.workflow.core.engine.cmd.CustomCalcAssigneeCmd; import cn.axzo.workflow.core.engine.cmd.CustomForecastUserTaskAssigneeCmd;
import cn.axzo.workflow.core.engine.listener.EngineExecutionStartListener; import cn.axzo.workflow.core.engine.listener.EngineExecutionStartListener;
import cn.axzo.workflow.core.service.BpmnProcessDefinitionService; import cn.axzo.workflow.core.service.BpmnProcessDefinitionService;
import cn.axzo.workflow.core.service.BpmnProcessInstanceService; import cn.axzo.workflow.core.service.BpmnProcessInstanceService;
@ -596,19 +596,10 @@ public class BpmnProcessInstanceServiceImpl implements BpmnProcessInstanceServic
} else if (userTask.getBehavior() instanceof UserTaskActivityBehavior) { } else if (userTask.getBehavior() instanceof UserTaskActivityBehavior) {
node.setNodeMode(BpmnFlowNodeMode.GENERAL); node.setNodeMode(BpmnFlowNodeMode.GENERAL);
} }
List<BpmnTaskDelegateAssigner> forecastAssigners = // 推测当前节点的审批人
springProcessEngineConfiguration.getCommandExecutor().execute(new CustomCalcAssigneeCmd(processInstanceId, userTask, engineExecutionStartListener)); List<BpmnTaskDelegateAssigner> forecastAssigners = springProcessEngineConfiguration.getCommandExecutor()
.execute(new CustomForecastUserTaskAssigneeCmd(processInstanceId, userTask, engineExecutionStartListener));
node.setForecastAssigners(forecastAssigners); node.setForecastAssigners(forecastAssigners);
// List<BpmnTaskDelegateAssigner> forecastAssigners = new ArrayList<>();
// DelegateExecution execution = (DelegateExecution) runtimeService
// .createExecutionQuery().processInstanceId(processInstanceId)
// .activityId(userTask.getId()).singleResult();
// getApproverSpecify(userTask).ifPresent(specify -> {
// forecastAssigners.addAll(engineExecutionStartListener
// .approverSelect(specify.getType(), userTask,
// (DelegateExecution) list.get(0)));
// });
} else if (i instanceof ReceiveTask) { } else if (i instanceof ReceiveTask) {
ReceiveTask receiveTask = (ReceiveTask) i; ReceiveTask receiveTask = (ReceiveTask) i;
node.setId(receiveTask.getId()) node.setId(receiveTask.getId())

View File

@ -27,6 +27,10 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId> <artifactId>spring-boot-starter-validation</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.redisson</groupId>
<artifactId>redisson-spring-boot-starter</artifactId>
</dependency>
<dependency> <dependency>
<groupId>${project.groupId}</groupId> <groupId>${project.groupId}</groupId>
<artifactId>workflow-engine-core</artifactId> <artifactId>workflow-engine-core</artifactId>

View File

@ -2,26 +2,33 @@ package cn.axzo.workflow.server.common.annotation;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.ElementType; import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
import java.util.concurrent.TimeUnit;
/** /**
* 自定义注解防止表单重复提交 * 自定义注解防止表单重复提交
* *
* @author wangli * @author wangli
*/ */
@Inherited
@Target(ElementType.METHOD) @Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Documented @Documented
public @interface RepeatSubmit { public @interface RepeatSubmit {
/** /**
* 间隔时间(ms)小于此时间视为重复提交 * 间隔时间(ms)小于此时间视为重复提交
*/ */
int interval() default 5000; int interval() default 5000;
TimeUnit timeUnit() default TimeUnit.MILLISECONDS;
/** /**
* 提示消息 * 提示消息 支持国际化 格式为 {code}
*/ */
String message() default "不允许重复提交,请稍后再试"; String message() default "请勿重复提交,正在处理中";
} }

View File

@ -3,8 +3,10 @@ package cn.axzo.workflow.server.common.intercepter.impl;
import cn.axzo.workflow.server.common.annotation.RepeatSubmit; import cn.axzo.workflow.server.common.annotation.RepeatSubmit;
import cn.axzo.workflow.server.common.intercepter.RepeatSubmitInterceptor; import cn.axzo.workflow.server.common.intercepter.RepeatSubmitInterceptor;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
import java.util.HashMap; import java.util.HashMap;
@ -23,6 +25,8 @@ public class SameUrlDataInterceptor extends RepeatSubmitInterceptor {
public final String REPEAT_TIME = "repeatTime"; public final String REPEAT_TIME = "repeatTime";
public final String SESSION_REPEAT_KEY = "repeatData"; public final String SESSION_REPEAT_KEY = "repeatData";
@Resource
private StringRedisTemplate redisTemplate;
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@Override @Override
@ -36,6 +40,7 @@ public class SameUrlDataInterceptor extends RepeatSubmitInterceptor {
// 请求地址作为存放session的key值 // 请求地址作为存放session的key值
String url = request.getRequestURI(); String url = request.getRequestURI();
HttpSession session = request.getSession(); HttpSession session = request.getSession();
Object sessionObj = session.getAttribute(SESSION_REPEAT_KEY); Object sessionObj = session.getAttribute(SESSION_REPEAT_KEY);
if (sessionObj != null) { if (sessionObj != null) {

View File

@ -60,7 +60,7 @@ public class RocketMqBpmActivityEventListener implements BpmnActivityEventListen
@Override @Override
public void onStarted(FlowableEngineEvent event) { public void onStarted(FlowableEngineEvent event) {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("RocketMqBpmActivityEventListener#onStarted..."); log.debug("RocketMqBpmActivityEventListener#onStarted...activityId: {}", ((FlowableActivityEvent) event).getActivityId());
} }
ProcessActivityDTO dto = new ProcessActivityDTO(); ProcessActivityDTO dto = new ProcessActivityDTO();
dto.setType(PROCESS_ACTIVITY_STARTED); dto.setType(PROCESS_ACTIVITY_STARTED);
@ -82,14 +82,14 @@ public class RocketMqBpmActivityEventListener implements BpmnActivityEventListen
BpmnMetaParserHelper.getNoticeConfig(mainProcess).ifPresent(dto::setNoticeConf); BpmnMetaParserHelper.getNoticeConfig(mainProcess).ifPresent(dto::setNoticeConf);
sendMessageQueue(dto, PROCESS_ACTIVITY_STARTED); sendMessageQueue(dto, PROCESS_ACTIVITY_STARTED);
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("RocketMqBpmActivityEventListener#onStarted...end"); log.debug("RocketMqBpmActivityEventListener#onStarted...end, activityId: {}", ((FlowableActivityEvent) event).getActivityId());
} }
} }
@Override @Override
public void onCompleted(FlowableEngineEvent event) { public void onCompleted(FlowableEngineEvent event) {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("RocketMqBpmActivityEventListener#onCompleted..."); log.debug("RocketMqBpmActivityEventListener#onCompleted...activityId: {}", ((FlowableActivityEvent) event).getActivityId());
} }
ProcessActivityDTO dto = new ProcessActivityDTO(); ProcessActivityDTO dto = new ProcessActivityDTO();
dto.setType(PROCESS_ACTIVITY_COMPLETED); dto.setType(PROCESS_ACTIVITY_COMPLETED);
@ -114,14 +114,14 @@ public class RocketMqBpmActivityEventListener implements BpmnActivityEventListen
sendMessageQueue(dto, PROCESS_ACTIVITY_COMPLETED); sendMessageQueue(dto, PROCESS_ACTIVITY_COMPLETED);
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("RocketMqBpmActivityEventListener#onCompleted...end"); log.debug("RocketMqBpmActivityEventListener#onCompleted...end, activityId: {}", ((FlowableActivityEvent) event).getActivityId());
} }
} }
@Override @Override
public void onCancelled(FlowableEngineEvent event) { public void onCancelled(FlowableEngineEvent event) {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("RocketMqMessagePushEventListener#onCancelled..."); log.debug("RocketMqMessagePushEventListener#onCancelled...activityId: {}", ((FlowableActivityEvent) event).getActivityId());
} }
ProcessActivityDTO dto = new ProcessActivityDTO(); ProcessActivityDTO dto = new ProcessActivityDTO();
dto.setType(PROCESS_ACTIVITY_CANCELLED); dto.setType(PROCESS_ACTIVITY_CANCELLED);
@ -146,7 +146,7 @@ public class RocketMqBpmActivityEventListener implements BpmnActivityEventListen
sendMessageQueue(dto, PROCESS_ACTIVITY_CANCELLED); sendMessageQueue(dto, PROCESS_ACTIVITY_CANCELLED);
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("RocketMqBpmActivityEventListener#onCancelled...end"); log.debug("RocketMqBpmActivityEventListener#onCancelled...end, activityId: {}", ((FlowableActivityEvent) event).getActivityId());
} }
} }

View File

@ -116,13 +116,13 @@ public class RocketMqMessagePushEventListener implements BpmnMessagePushEventLis
return; return;
} }
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("RocketMqMessagePushEventListener#onNotice..."); log.debug("RocketMqMessagePushEventListener#onNotice...msgTemplateId: {}, receivePerson: {}", event.getNoticeConfig().getNotice().getNoticeMessageId(), JSON.toJSONString(event.getAssigner()));
} }
MessagePushDTO dto = build(event.getNoticeConfig().getNotice().getNoticeMessageId(), PROCESS_PUSH_NOTICE, event, MessagePushDTO dto = build(event.getNoticeConfig().getNotice().getNoticeMessageId(), PROCESS_PUSH_NOTICE, event,
collectionVariable(event)); collectionVariable(event));
sendMessageQueue(dto, PROCESS_PUSH_NOTICE); sendMessageQueue(dto, PROCESS_PUSH_NOTICE);
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("RocketMqMessagePushEventListener#onNotice...end"); log.debug("RocketMqMessagePushEventListener#onNotice...end, msgTemplateId: {}, receivePerson: {}", event.getNoticeConfig().getNotice().getNoticeMessageId(), JSON.toJSONString(event.getAssigner()));
} }
} }
@ -136,14 +136,14 @@ public class RocketMqMessagePushEventListener implements BpmnMessagePushEventLis
return; return;
} }
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("RocketMqMessagePushEventListener#onPendingPush..."); log.debug("RocketMqMessagePushEventListener#onPendingPush...msgTemplateId: {}, receivePerson: {}", event.getNoticeConfig().getNotice().getNoticeMessageId(), JSON.toJSONString(event.getAssigner()));
} }
MessagePushDTO dto = build(event.getNoticeConfig().getPending().getPendingMessageId(), PROCESS_PUSH_PENDING, MessagePushDTO dto = build(event.getNoticeConfig().getPending().getPendingMessageId(), PROCESS_PUSH_PENDING,
event, event,
collectionVariable(event)); collectionVariable(event));
sendMessageQueue(dto, PROCESS_PUSH_PENDING); sendMessageQueue(dto, PROCESS_PUSH_PENDING);
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("RocketMqMessagePushEventListener#onPendingPush...end"); log.debug("RocketMqMessagePushEventListener#onPendingPush...end, msgTemplateId: {}, receivePerson: {}", event.getNoticeConfig().getNotice().getNoticeMessageId(), JSON.toJSONString(event.getAssigner()));
} }
} }
@ -155,13 +155,13 @@ public class RocketMqMessagePushEventListener implements BpmnMessagePushEventLis
return; return;
} }
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("RocketMqMessagePushEventListener#onPendingComplete..."); log.debug("RocketMqMessagePushEventListener#onPendingComplete...msgTemplateId: {}, receivePerson: {}", event.getNoticeConfig().getNotice().getNoticeMessageId(), JSON.toJSONString(event.getAssigner()));
} }
MessagePushDTO dto = build(event.getNoticeConfig().getPending().getPendingMessageId(), PROCESS_PUSH_PENDING_COMPLETE, MessagePushDTO dto = build(event.getNoticeConfig().getPending().getPendingMessageId(), PROCESS_PUSH_PENDING_COMPLETE,
event, null); event, null);
sendMessageQueue(dto, PROCESS_PUSH_PENDING_COMPLETE); sendMessageQueue(dto, PROCESS_PUSH_PENDING_COMPLETE);
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("RocketMqMessagePushEventListener#onPendingComplete...end"); log.debug("RocketMqMessagePushEventListener#onPendingComplete...end, msgTemplateId: {}, receivePerson: {}", event.getNoticeConfig().getNotice().getNoticeMessageId(), JSON.toJSONString(event.getAssigner()));
} }
} }
@ -174,13 +174,13 @@ public class RocketMqMessagePushEventListener implements BpmnMessagePushEventLis
return; return;
} }
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("RocketMqMessagePushEventListener#onSms..."); log.debug("RocketMqMessagePushEventListener#onSms...msgTemplateId: {}, receivePerson: {}", event.getNoticeConfig().getNotice().getNoticeMessageId(), JSON.toJSONString(event.getAssigner()));
} }
MessagePushDTO dto = build(event.getNoticeConfig().getSms().getSmsId(), PROCESS_PUSH_SMS, event, MessagePushDTO dto = build(event.getNoticeConfig().getSms().getSmsId(), PROCESS_PUSH_SMS, event,
collectionVariable(event)); collectionVariable(event));
sendMessageQueue(dto, PROCESS_PUSH_SMS); sendMessageQueue(dto, PROCESS_PUSH_SMS);
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("RocketMqMessagePushEventListener#onSms...end"); log.debug("RocketMqMessagePushEventListener#onSms...end, msgTemplateId: {}, receivePerson: {}", event.getNoticeConfig().getNotice().getNoticeMessageId(), JSON.toJSONString(event.getAssigner()));
} }
} }

View File

@ -33,33 +33,33 @@ public class MessagePushProcessEventListener implements BpmnProcessEventListener
@Override @Override
public void onCancelled(FlowableCancelledEvent event) { public void onCancelled(FlowableCancelledEvent event) {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("MessagePushProcessEventListener#onCancelled..."); log.debug("MessagePushProcessEventListener#onCancelled...{}", event.getProcessInstanceId());
} }
pendingComplete(event); pendingComplete(event);
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("MessagePushProcessEventListener#onCancelled...end"); log.debug("MessagePushProcessEventListener#onCancelled...end: {}", event.getProcessInstanceId());
} }
} }
@Override @Override
public void onRejected(FlowableCancelledEvent event) { public void onRejected(FlowableCancelledEvent event) {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("MessagePushProcessEventListener#onRejected..."); log.debug("MessagePushProcessEventListener#onRejected...{}", event.getProcessInstanceId());
} }
pendingComplete(event); pendingComplete(event);
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("MessagePushProcessEventListener#onRejected...end"); log.debug("MessagePushProcessEventListener#onRejected...end: {}", event.getProcessInstanceId());
} }
} }
@Override @Override
public void onCompleted(FlowableEngineEntityEvent event) { public void onCompleted(FlowableEngineEntityEvent event) {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("MessagePushProcessEventListener#onCompleted..."); log.debug("MessagePushProcessEventListener#onCompleted...{}", event.getProcessInstanceId());
} }
pendingComplete(event); pendingComplete(event);
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("MessagePushProcessEventListener#onCompleted...end"); log.debug("MessagePushProcessEventListener#onCompleted...end: {}", event.getProcessInstanceId());
} }
} }

View File

@ -50,7 +50,7 @@ public class RocketMqBpmnProcessEventListener implements BpmnProcessEventListene
@Override @Override
public void onCreated(FlowableEngineEntityEvent event) { public void onCreated(FlowableEngineEntityEvent event) {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("MessagePushProcessEventListener#onCreated..."); log.debug("MessagePushProcessEventListener#onCreated...{}", event.getProcessInstanceId());
} }
Deployment deployment = Deployment deployment =
repositoryService.createDeploymentQuery().deploymentId(((ExecutionEntityImpl) event.getEntity()).getDeploymentId()).singleResult(); repositoryService.createDeploymentQuery().deploymentId(((ExecutionEntityImpl) event.getEntity()).getDeploymentId()).singleResult();
@ -73,14 +73,14 @@ public class RocketMqBpmnProcessEventListener implements BpmnProcessEventListene
BpmnMetaParserHelper.getNoticeConfig(mainProcess).ifPresent(dto::setNoticeConf); BpmnMetaParserHelper.getNoticeConfig(mainProcess).ifPresent(dto::setNoticeConf);
sendMessageQueue(dto, PROCESS_INSTANCE_CREATED); sendMessageQueue(dto, PROCESS_INSTANCE_CREATED);
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("MessagePushProcessEventListener#onCreated...end"); log.debug("MessagePushProcessEventListener#onCreated...end: {}", event.getProcessInstanceId());
} }
} }
@Override @Override
public void onStarted(FlowableProcessStartedEvent event) { public void onStarted(FlowableProcessStartedEvent event) {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("MessagePushProcessEventListener#onStarted..."); log.debug("MessagePushProcessEventListener#onStarted...{}", ((ExecutionEntityImpl) event.getEntity()).getProcessInstanceId());
} }
Deployment deployment = Deployment deployment =
repositoryService.createDeploymentQuery().deploymentId(((ExecutionEntityImpl) event.getEntity()).getDeploymentId()) repositoryService.createDeploymentQuery().deploymentId(((ExecutionEntityImpl) event.getEntity()).getDeploymentId())
@ -105,14 +105,14 @@ public class RocketMqBpmnProcessEventListener implements BpmnProcessEventListene
BpmnMetaParserHelper.getNoticeConfig(mainProcess).ifPresent(dto::setNoticeConf); BpmnMetaParserHelper.getNoticeConfig(mainProcess).ifPresent(dto::setNoticeConf);
sendMessageQueue(dto, PROCESS_INSTANCE_STARTED); sendMessageQueue(dto, PROCESS_INSTANCE_STARTED);
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("MessagePushProcessEventListener#onStarted...end"); log.debug("MessagePushProcessEventListener#onStarted...end: {}", ((ExecutionEntityImpl) event.getEntity()).getProcessInstanceId());
} }
} }
@Override @Override
public void onCancelled(FlowableCancelledEvent event) { public void onCancelled(FlowableCancelledEvent event) {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("MessagePushProcessEventListener#onCancelled..."); log.debug("MessagePushProcessEventListener#onCancelled...{}", event.getProcessInstanceId());
} }
Deployment deployment = Deployment deployment =
repositoryService.createDeploymentQuery().deploymentId(((ExecutionEntityImpl) ((FlowableProcessCancelledEventImpl) event).getExecution()).getDeploymentId()) repositoryService.createDeploymentQuery().deploymentId(((ExecutionEntityImpl) ((FlowableProcessCancelledEventImpl) event).getExecution()).getDeploymentId())
@ -136,7 +136,7 @@ public class RocketMqBpmnProcessEventListener implements BpmnProcessEventListene
BpmnMetaParserHelper.getNoticeConfig(mainProcess).ifPresent(dto::setNoticeConf); BpmnMetaParserHelper.getNoticeConfig(mainProcess).ifPresent(dto::setNoticeConf);
sendMessageQueue(dto, PROCESS_INSTANCE_CANCELLED); sendMessageQueue(dto, PROCESS_INSTANCE_CANCELLED);
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("MessagePushProcessEventListener#onCancelled...end"); log.debug("MessagePushProcessEventListener#onCancelled...end: {}", event.getProcessInstanceId());
} }
} }
@ -148,7 +148,7 @@ public class RocketMqBpmnProcessEventListener implements BpmnProcessEventListene
@Override @Override
public void onRejected(FlowableCancelledEvent event) { public void onRejected(FlowableCancelledEvent event) {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("MessagePushProcessEventListener#onRejected..."); log.debug("MessagePushProcessEventListener#onRejected...{}", event.getProcessInstanceId());
} }
Deployment deployment = Deployment deployment =
repositoryService.createDeploymentQuery().deploymentId(((ExecutionEntityImpl) ((FlowableProcessCancelledEventImpl) event).getExecution()).getDeploymentId()) repositoryService.createDeploymentQuery().deploymentId(((ExecutionEntityImpl) ((FlowableProcessCancelledEventImpl) event).getExecution()).getDeploymentId())
@ -172,14 +172,14 @@ public class RocketMqBpmnProcessEventListener implements BpmnProcessEventListene
BpmnMetaParserHelper.getNoticeConfig(mainProcess).ifPresent(dto::setNoticeConf); BpmnMetaParserHelper.getNoticeConfig(mainProcess).ifPresent(dto::setNoticeConf);
sendMessageQueue(dto, PROCESS_INSTANCE_REJECTED); sendMessageQueue(dto, PROCESS_INSTANCE_REJECTED);
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("MessagePushProcessEventListener#onRejected...end"); log.debug("MessagePushProcessEventListener#onRejected...end: {}", event.getProcessInstanceId());
} }
} }
@Override @Override
public void onCompleted(FlowableEngineEntityEvent event) { public void onCompleted(FlowableEngineEntityEvent event) {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("MessagePushProcessEventListener#onCompleted..."); log.debug("MessagePushProcessEventListener#onCompleted...{}", event.getProcessInstanceId());
} }
Deployment deployment = Deployment deployment =
repositoryService.createDeploymentQuery().deploymentId(((ExecutionEntityImpl) event.getEntity()).getDeploymentId()) repositoryService.createDeploymentQuery().deploymentId(((ExecutionEntityImpl) event.getEntity()).getDeploymentId())
@ -203,7 +203,7 @@ public class RocketMqBpmnProcessEventListener implements BpmnProcessEventListene
BpmnMetaParserHelper.getNoticeConfig(mainProcess).ifPresent(dto::setNoticeConf); BpmnMetaParserHelper.getNoticeConfig(mainProcess).ifPresent(dto::setNoticeConf);
sendMessageQueue(dto, PROCESS_INSTANCE_COMPLETED); sendMessageQueue(dto, PROCESS_INSTANCE_COMPLETED);
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("MessagePushProcessEventListener#onCompleted...end"); log.debug("MessagePushProcessEventListener#onCompleted...end: {}", event.getProcessInstanceId());
} }
} }

View File

@ -51,7 +51,7 @@ public class AutoOperatorEventListener implements BpmnTaskEventListener, Ordered
@Override @Override
public void onCreated(DelegateTask delegateTask) { public void onCreated(DelegateTask delegateTask) {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("AutoOperatorEventListener#onCreated..."); log.debug("AutoOperatorEventListener#onCreated...{}", delegateTask.getTaskDefinitionKey());
} }
Process mainProcess = repositoryService.getBpmnModel(delegateTask.getProcessDefinitionId()).getMainProcess(); Process mainProcess = repositoryService.getBpmnModel(delegateTask.getProcessDefinitionId()).getMainProcess();
UserTask userTask = (UserTask) mainProcess.getFlowElement(delegateTask.getTaskDefinitionKey()); UserTask userTask = (UserTask) mainProcess.getFlowElement(delegateTask.getTaskDefinitionKey());
@ -92,13 +92,13 @@ public class AutoOperatorEventListener implements BpmnTaskEventListener, Ordered
}); });
} }
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("AutoOperatorEventListener#onCreated...end"); log.debug("AutoOperatorEventListener#onCreated...end: {}", delegateTask.getTaskDefinitionKey());
} }
} }
private void autoReject(DelegateTask delegateTask) { private void autoReject(DelegateTask delegateTask) {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("AutoOperatorEventListener#autoReject..."); log.debug("AutoOperatorEventListener#autoReject...{}", delegateTask.getTaskDefinitionKey());
} }
taskService.addComment(delegateTask.getId(), delegateTask.getProcessInstanceId(), COMMENT_TYPE_ADVICE, "自动驳回"); taskService.addComment(delegateTask.getId(), delegateTask.getProcessInstanceId(), COMMENT_TYPE_ADVICE, "自动驳回");
Map<String, Object> variables = new HashMap<>(); Map<String, Object> variables = new HashMap<>();
@ -111,14 +111,20 @@ public class AutoOperatorEventListener implements BpmnTaskEventListener, Ordered
// 删除流程实例以实现驳回任务时取消整个审批流程 // 删除流程实例以实现驳回任务时取消整个审批流程
processInstanceService.deleteProcessInstance(delegateTask.getProcessInstanceId(), REJECTION_AUTO_COMPLETED.getDesc()); processInstanceService.deleteProcessInstance(delegateTask.getProcessInstanceId(), REJECTION_AUTO_COMPLETED.getDesc());
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("AutoOperatorEventListener#autoReject...end"); log.debug("AutoOperatorEventListener#autoReject...end: {}", delegateTask.getTaskDefinitionKey());
} }
} }
private void autoPass(DelegateTask delegateTask) { private void autoPass(DelegateTask delegateTask) {
if (log.isDebugEnabled()) {
log.debug("AutoOperatorEventListener#autoPass...{}", delegateTask.getTaskDefinitionKey());
}
taskService.addComment(delegateTask.getId(), delegateTask.getProcessInstanceId(), COMMENT_TYPE_AUTO_PASSED, taskService.addComment(delegateTask.getId(), delegateTask.getProcessInstanceId(), COMMENT_TYPE_AUTO_PASSED,
"自动通过"); "自动通过");
taskService.complete(delegateTask.getId(), runtimeService.getVariables(delegateTask.getExecutionId())); taskService.complete(delegateTask.getId(), runtimeService.getVariables(delegateTask.getExecutionId()));
if (log.isDebugEnabled()) {
log.debug("AutoOperatorEventListener#autoPass...end: {}", delegateTask.getTaskDefinitionKey());
}
} }
} }

View File

@ -51,7 +51,7 @@ public class MessagePushTaskEventListener implements BpmnTaskEventListener, Orde
@Override @Override
public void onAssigned(DelegateTask delegateTask) { public void onAssigned(DelegateTask delegateTask) {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("MessagePushTaskEventListener#onAssigned..."); log.debug("MessagePushTaskEventListener#onAssigned...{}", delegateTask.getTaskDefinitionKey());
} }
if (Objects.equals(TASK_ASSIGNEE_SKIP_FLAT, delegateTask.getAssignee())) { if (Objects.equals(TASK_ASSIGNEE_SKIP_FLAT, delegateTask.getAssignee())) {
// 转交功能原审批人完成待办, 由于在流程引擎侧, 任务是不会在转交时立即结束, 但待办消息需要立即完成, // 转交功能原审批人完成待办, 由于在流程引擎侧, 任务是不会在转交时立即结束, 但待办消息需要立即完成,
@ -61,18 +61,18 @@ public class MessagePushTaskEventListener implements BpmnTaskEventListener, Orde
} }
pendingPush(delegateTask); pendingPush(delegateTask);
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("MessagePushTaskEventListener#onAssigned...end"); log.debug("MessagePushTaskEventListener#onAssigned...end: {}", delegateTask.getTaskDefinitionKey());
} }
} }
@Override @Override
public void onDeleted(DelegateTask delegateTask) { public void onDeleted(DelegateTask delegateTask) {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("MessagePushTaskEventListener#onDeleted..."); log.debug("MessagePushTaskEventListener#onDeleted...{}", delegateTask.getTaskDefinitionKey());
} }
pendingComplete(delegateTask); pendingComplete(delegateTask);
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("MessagePushTaskEventListener#onDeleted...end"); log.debug("MessagePushTaskEventListener#onDeleted...end: {}", delegateTask.getTaskDefinitionKey());
} }
} }

View File

@ -53,48 +53,48 @@ public class RocketMqBpmnTaskEventListener implements BpmnTaskEventListener, Ord
@Override @Override
public void onCreated(DelegateTask delegateTask) { public void onCreated(DelegateTask delegateTask) {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("RocketMqBpmnTaskEventListener#onCreated..."); log.debug("RocketMqBpmnTaskEventListener#onCreated...{}", delegateTask.getTaskDefinitionKey());
} }
ProcessTaskDTO dto = build(delegateTask, PROCESS_TASK_CREATED); ProcessTaskDTO dto = build(delegateTask, PROCESS_TASK_CREATED);
sendMessageQueue(dto, PROCESS_TASK_CREATED); sendMessageQueue(dto, PROCESS_TASK_CREATED);
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("RocketMqBpmnTaskEventListener#onCreated...end"); log.debug("RocketMqBpmnTaskEventListener#onCreated...end: {}", delegateTask.getTaskDefinitionKey());
} }
} }
@Override @Override
public void onAssigned(DelegateTask delegateTask) { public void onAssigned(DelegateTask delegateTask) {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("RocketMqBpmnTaskEventListener#onAssigned..."); log.debug("RocketMqBpmnTaskEventListener#onAssigned...{}", delegateTask.getTaskDefinitionKey());
} }
ProcessTaskDTO dto = build(delegateTask, PROCESS_TASK_ASSIGNED); ProcessTaskDTO dto = build(delegateTask, PROCESS_TASK_ASSIGNED);
sendMessageQueue(dto, PROCESS_TASK_ASSIGNED); sendMessageQueue(dto, PROCESS_TASK_ASSIGNED);
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("RocketMqBpmnTaskEventListener#onAssigned...end"); log.debug("RocketMqBpmnTaskEventListener#onAssigned...end: {}", delegateTask.getTaskDefinitionKey());
} }
} }
@Override @Override
public void onCompleted(DelegateTask delegateTask) { public void onCompleted(DelegateTask delegateTask) {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("RocketMqBpmnTaskEventListener#onCompleted..."); log.debug("RocketMqBpmnTaskEventListener#onCompleted...{}", delegateTask.getTaskDefinitionKey());
} }
ProcessTaskDTO dto = build(delegateTask, PROCESS_TASK_COMPLETED); ProcessTaskDTO dto = build(delegateTask, PROCESS_TASK_COMPLETED);
sendMessageQueue(dto, PROCESS_TASK_COMPLETED); sendMessageQueue(dto, PROCESS_TASK_COMPLETED);
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("RocketMqBpmnTaskEventListener#onCompleted...end"); log.debug("RocketMqBpmnTaskEventListener#onCompleted...end: {}", delegateTask.getTaskDefinitionKey());
} }
} }
@Override @Override
public void onDeleted(DelegateTask delegateTask) { public void onDeleted(DelegateTask delegateTask) {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("RocketMqBpmnTaskEventListener#onDeleted..."); log.debug("RocketMqBpmnTaskEventListener#onDeleted...{}", delegateTask.getTaskDefinitionKey());
} }
ProcessTaskDTO dto = build(delegateTask, PROCESS_TASK_DELETED); ProcessTaskDTO dto = build(delegateTask, PROCESS_TASK_DELETED);
sendMessageQueue(dto, PROCESS_TASK_DELETED); sendMessageQueue(dto, PROCESS_TASK_DELETED);
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("RocketMqBpmnTaskEventListener#onDeleted...end"); log.debug("RocketMqBpmnTaskEventListener#onDeleted...end: {}", delegateTask.getTaskDefinitionKey());
} }
} }

View File

@ -37,7 +37,7 @@ public class SnapshotBpmnTaskTaskEventListener implements BpmnTaskEventListener,
@Override @Override
public void onAssigned(DelegateTask delegateTask) { public void onAssigned(DelegateTask delegateTask) {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("SnapshotBpmnTaskTaskEventListener#onAssigned..."); log.debug("SnapshotBpmnTaskTaskEventListener#onAssigned...{}", delegateTask.getTaskDefinitionKey());
} }
List<BpmnTaskDelegateAssigner> assignerList = runtimeService.getVariable(delegateTask.getProcessInstanceId(), List<BpmnTaskDelegateAssigner> assignerList = runtimeService.getVariable(delegateTask.getProcessInstanceId(),
INTERNAL_ACTIVITY_RELATION_ASSIGNEE_LIST_INFO_SNAPSHOT + delegateTask.getTaskDefinitionKey(), INTERNAL_ACTIVITY_RELATION_ASSIGNEE_LIST_INFO_SNAPSHOT + delegateTask.getTaskDefinitionKey(),
@ -48,7 +48,7 @@ public class SnapshotBpmnTaskTaskEventListener implements BpmnTaskEventListener,
delegateTask.setVariable(INTERNAL_TASK_RELATION_ASSIGNEE_INFO + delegateTask.getId(), i); delegateTask.setVariable(INTERNAL_TASK_RELATION_ASSIGNEE_INFO + delegateTask.getId(), i);
}); });
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("SnapshotBpmnTaskTaskEventListener#onAssigned...end"); log.debug("SnapshotBpmnTaskTaskEventListener#onAssigned...end: {}", delegateTask.getTaskDefinitionKey());
} }
} }
} }

View File

@ -41,7 +41,7 @@ public class StartNodeAutoCompleteEventListener implements BpmnTaskEventListener
@Override @Override
public void onCreated(DelegateTask delegateTask) { public void onCreated(DelegateTask delegateTask) {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("StartNodeAutoCompleteEventListener#onCreated..."); log.debug("StartNodeAutoCompleteEventListener#onCreated...{}", delegateTask.getTaskDefinitionKey());
} }
Process mainProcess = repositoryService.getBpmnModel(delegateTask.getProcessDefinitionId()).getMainProcess(); Process mainProcess = repositoryService.getBpmnModel(delegateTask.getProcessDefinitionId()).getMainProcess();
UserTask userTask = (UserTask) mainProcess.getFlowElement(delegateTask.getTaskDefinitionKey()); UserTask userTask = (UserTask) mainProcess.getFlowElement(delegateTask.getTaskDefinitionKey());
@ -59,7 +59,7 @@ public class StartNodeAutoCompleteEventListener implements BpmnTaskEventListener
} }
}); });
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("StartNodeAutoCompleteEventListener#onCreated...end"); log.debug("StartNodeAutoCompleteEventListener#onCreated...end: {}", delegateTask.getTaskDefinitionKey());
} }
} }
} }

View File

@ -2,6 +2,7 @@ package cn.axzo.workflow.server.controller.web.bpmn;
import cn.axzo.workflow.client.feign.bpmn.ProcessActivityApi; import cn.axzo.workflow.client.feign.bpmn.ProcessActivityApi;
import cn.axzo.workflow.core.service.BpmnProcessActivityService; import cn.axzo.workflow.core.service.BpmnProcessActivityService;
import cn.axzo.workflow.server.common.annotation.RepeatSubmit;
import cn.azxo.framework.common.model.CommonResponse; import cn.azxo.framework.common.model.CommonResponse;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
@ -36,6 +37,7 @@ public class BpmnProcessActivityController implements ProcessActivityApi {
*/ */
@GetMapping("/trigger") @GetMapping("/trigger")
@Override @Override
@RepeatSubmit
public CommonResponse<Boolean> trigger(@RequestParam @NotBlank(message = "触发 ID 不能为空") String triggerId) { public CommonResponse<Boolean> trigger(@RequestParam @NotBlank(message = "触发 ID 不能为空") String triggerId) {
bpmnProcessActivityService.trigger(triggerId); bpmnProcessActivityService.trigger(triggerId);
return CommonResponse.success(true); return CommonResponse.success(true);

View File

@ -15,6 +15,7 @@ import cn.axzo.workflow.common.model.response.bpmn.process.HistoricProcessInstan
import cn.axzo.workflow.common.model.response.bpmn.process.ProcessNodeDetailVO; import cn.axzo.workflow.common.model.response.bpmn.process.ProcessNodeDetailVO;
import cn.axzo.workflow.core.common.exception.WorkflowEngineException; import cn.axzo.workflow.core.common.exception.WorkflowEngineException;
import cn.axzo.workflow.core.service.BpmnProcessInstanceService; import cn.axzo.workflow.core.service.BpmnProcessInstanceService;
import cn.axzo.workflow.server.common.annotation.RepeatSubmit;
import cn.azxo.framework.common.model.CommonResponse; import cn.azxo.framework.common.model.CommonResponse;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.fasterxml.jackson.databind.node.ObjectNode; import com.fasterxml.jackson.databind.node.ObjectNode;
@ -67,6 +68,7 @@ public class BpmnProcessInstanceController implements ProcessInstanceApi {
*/ */
@PostMapping("/create") @PostMapping("/create")
@Override @Override
@RepeatSubmit
public CommonResponse<String> createProcessInstance(@Validated @RequestBody BpmnProcessInstanceCreateDTO dto) { public CommonResponse<String> createProcessInstance(@Validated @RequestBody BpmnProcessInstanceCreateDTO dto) {
log.info("发起审核createProcessInstance===>>>参数:{}", JSON.toJSONString(dto)); log.info("发起审核createProcessInstance===>>>参数:{}", JSON.toJSONString(dto));
String result = bpmnProcessInstanceService.createProcessInstance(dto); String result = bpmnProcessInstanceService.createProcessInstance(dto);
@ -89,6 +91,7 @@ public class BpmnProcessInstanceController implements ProcessInstanceApi {
*/ */
@DeleteMapping("/cancel") @DeleteMapping("/cancel")
@Override @Override
@RepeatSubmit
public CommonResponse<Boolean> cancelProcessInstance(@Validated @RequestBody BpmnProcessInstanceCancelDTO dto) { public CommonResponse<Boolean> cancelProcessInstance(@Validated @RequestBody BpmnProcessInstanceCancelDTO dto) {
log.info("取消审核cancelProcessInstant===>>>参数:{}", JSON.toJSONString(dto)); log.info("取消审核cancelProcessInstant===>>>参数:{}", JSON.toJSONString(dto));
if (!StringUtils.hasLength(dto.getId()) && !StringUtils.hasLength(dto.getBusinessKey())) { if (!StringUtils.hasLength(dto.getId()) && !StringUtils.hasLength(dto.getBusinessKey())) {