From c92437402ece68dd4df59750d3bd238d0b32a7ac Mon Sep 17 00:00:00 2001 From: orange-form <3510245832@qq.com> Date: Fri, 12 Jul 2024 15:29:13 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B5=81=E7=A8=8B=E5=B9=B2?= =?UTF-8?q?=E9=A2=84=E5=9C=BA=E6=99=AF=E4=B8=8B=E8=AE=BE=E7=BD=AE=E5=AE=A1?= =?UTF-8?q?=E6=89=B9=E4=BA=BA=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: orange-form <3510245832@qq.com> --- .../common/flow/listener/FlowUserTaskListener.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/OrangeFormsOpen-MybatisFlex/common/common-flow/src/main/java/com/orangeforms/common/flow/listener/FlowUserTaskListener.java b/OrangeFormsOpen-MybatisFlex/common/common-flow/src/main/java/com/orangeforms/common/flow/listener/FlowUserTaskListener.java index 6760fcc4..3dad5ed1 100644 --- a/OrangeFormsOpen-MybatisFlex/common/common-flow/src/main/java/com/orangeforms/common/flow/listener/FlowUserTaskListener.java +++ b/OrangeFormsOpen-MybatisFlex/common/common-flow/src/main/java/com/orangeforms/common/flow/listener/FlowUserTaskListener.java @@ -4,6 +4,7 @@ import com.orangeforms.common.core.util.ApplicationContextHolder; import com.orangeforms.common.flow.constant.FlowConstant; import lombok.extern.slf4j.Slf4j; import org.flowable.engine.RuntimeService; +import org.flowable.engine.TaskService; import org.flowable.engine.delegate.TaskListener; import org.flowable.task.service.delegate.DelegateTask; @@ -13,19 +14,21 @@ import java.util.Map; * 流程任务通用监听器。 * * @author Jerry - * @date 2024-07-02 + * @date 2024-04-15 */ @Slf4j public class FlowUserTaskListener implements TaskListener { private final transient RuntimeService runtimeService = ApplicationContextHolder.getBean(RuntimeService.class); + private final transient TaskService taskService = + ApplicationContextHolder.getBean(TaskService.class); @Override public void notify(DelegateTask delegateTask) { Map variables = delegateTask.getVariables(); if (variables.get(FlowConstant.DELEGATE_ASSIGNEE_VAR) != null) { - delegateTask.setAssignee(variables.get(FlowConstant.DELEGATE_ASSIGNEE_VAR).toString()); + taskService.setAssignee(delegateTask.getId(), variables.get(FlowConstant.DELEGATE_ASSIGNEE_VAR).toString()); runtimeService.removeVariableLocal(delegateTask.getExecutionId(), FlowConstant.DELEGATE_ASSIGNEE_VAR); } }