From 1abd2e7d7e2493481115758b07a9117f164649b4 Mon Sep 17 00:00:00 2001 From: songgaoshuai <1742057357@qq.com> Date: Wed, 17 Apr 2024 16:06:47 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=E5=88=B0=E6=9C=9F?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E7=94=9F=E6=88=90=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workflow/flowable/config/GlobalFlowableListener.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/flowable/config/GlobalFlowableListener.java b/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/flowable/config/GlobalFlowableListener.java index b59fb45b2..9bb971a8c 100644 --- a/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/flowable/config/GlobalFlowableListener.java +++ b/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/flowable/config/GlobalFlowableListener.java @@ -23,6 +23,7 @@ import org.flowable.job.service.impl.persistence.entity.TimerJobEntity; import org.flowable.task.api.Task; import org.flowable.task.service.impl.persistence.entity.TaskEntity; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Component; @@ -50,6 +51,9 @@ public class GlobalFlowableListener implements FlowableEventListener { @Lazy private RepositoryService repositoryService; + @Value("${flowable.async-executor-activate}") + private boolean asyncExecutorActivate; + @Override public void onEvent(FlowableEvent flowableEvent) { if (flowableEvent instanceof FlowableEngineEvent flowableEngineEvent) { @@ -60,7 +64,7 @@ public class GlobalFlowableListener implements FlowableEventListener { FlowableEntityEvent flowableEntityEvent = (FlowableEntityEvent) flowableEngineEvent; Object entityObject = flowableEntityEvent.getEntity(); TaskEntity task = (TaskEntity) entityObject; - if (task.getDueDate() != null && task.getDueDate().after(new Date())) { + if (asyncExecutorActivate && task.getDueDate() != null && task.getDueDate().after(new Date())) { //删除之前已经存在的定时任务 TimerJobService timerJobService = CommandContextUtil.getTimerJobService(); List timerJobEntityList = timerJobService.findTimerJobsByProcessInstanceId(task.getProcessInstanceId());