Commit 75167383304c9f5c392af8553bc7e1e70736d043
1 parent
0ab54a9f
【缺陷修复】BPM:修复 task 的 category 不正确的问题
Showing
1 changed file
with
14 additions
and
0 deletions
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/behavior/BpmUserTaskActivityBehavior.java
| @@ -10,7 +10,10 @@ import org.flowable.common.engine.impl.el.ExpressionManager; | @@ -10,7 +10,10 @@ import org.flowable.common.engine.impl.el.ExpressionManager; | ||
| 10 | import org.flowable.engine.delegate.DelegateExecution; | 10 | import org.flowable.engine.delegate.DelegateExecution; |
| 11 | import org.flowable.engine.impl.bpmn.behavior.UserTaskActivityBehavior; | 11 | import org.flowable.engine.impl.bpmn.behavior.UserTaskActivityBehavior; |
| 12 | import org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl; | 12 | import org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl; |
| 13 | +import org.flowable.engine.impl.persistence.entity.ProcessDefinitionEntity; | ||
| 14 | +import org.flowable.engine.impl.util.CommandContextUtil; | ||
| 13 | import org.flowable.engine.impl.util.TaskHelper; | 15 | import org.flowable.engine.impl.util.TaskHelper; |
| 16 | +import org.flowable.engine.interceptor.CreateUserTaskBeforeContext; | ||
| 14 | import org.flowable.task.service.TaskService; | 17 | import org.flowable.task.service.TaskService; |
| 15 | import org.flowable.task.service.impl.persistence.entity.TaskEntity; | 18 | import org.flowable.task.service.impl.persistence.entity.TaskEntity; |
| 16 | import org.springframework.transaction.annotation.Transactional; | 19 | import org.springframework.transaction.annotation.Transactional; |
| @@ -69,4 +72,15 @@ public class BpmUserTaskActivityBehavior extends UserTaskActivityBehavior { | @@ -69,4 +72,15 @@ public class BpmUserTaskActivityBehavior extends UserTaskActivityBehavior { | ||
| 69 | return CollUtil.get(candidateUserIds, index); | 72 | return CollUtil.get(candidateUserIds, index); |
| 70 | } | 73 | } |
| 71 | 74 | ||
| 75 | + @Override | ||
| 76 | + protected void handleCategory(CreateUserTaskBeforeContext beforeContext, ExpressionManager expressionManager, | ||
| 77 | + TaskEntity task, DelegateExecution execution) { | ||
| 78 | + ProcessDefinitionEntity processDefinitionEntity = CommandContextUtil.getProcessDefinitionEntityManager().findById(execution.getProcessDefinitionId()); | ||
| 79 | + if (processDefinitionEntity == null) { | ||
| 80 | + log.warn("[handleCategory][任务编号({}) 找不到流程定义({})]", task.getId(), execution.getProcessDefinitionId()); | ||
| 81 | + return; | ||
| 82 | + } | ||
| 83 | + task.setCategory(processDefinitionEntity.getCategory()); | ||
| 84 | + } | ||
| 85 | + | ||
| 72 | } | 86 | } |