Merge remote-tracking branch 'refs/remotes/origin/REQ-2324' into feature/merged_all_req

This commit is contained in:
yangqicheng 2024-05-24 17:06:18 +08:00
commit 0a3942a282
4 changed files with 12 additions and 3 deletions

View File

@ -71,6 +71,11 @@ public class CustomApproveTaskCmd implements Command<Void>, Serializable {
this.nodeTypes = dto.getNodeTypes();
}
public CustomApproveTaskCmd(String taskId, String advice, String operationDesc, List<AttachmentDTO> attachmentList,
BpmnTaskDelegateAssigner approver, BpmnTaskDelegateAssigner nextApprover) {
this(taskId, advice, operationDesc, attachmentList, approver, nextApprover, null);
}
public CustomApproveTaskCmd(String taskId, String advice, String operationDesc, List<AttachmentDTO> attachmentList,
BpmnTaskDelegateAssigner approver, BpmnTaskDelegateAssigner nextApprover,
List<BpmnFlowNodeType> nodeTypes) {
@ -96,6 +101,9 @@ public class CustomApproveTaskCmd implements Command<Void>, Serializable {
Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
validTask(historicTaskInstance, (TaskEntity) task, approver, nodeTypes);
// TODO 所有的跟 Task 相关的动作都可以在这里进行扩展用于扩展八大按钮标准动作以外的一些逻辑但这里需要结合 Spring 能力需设计好扩展点否则无法进行扩展
// 其他动态也应该在类似的地方预留扩展点
if (StringUtils.hasLength(advice)) {
Authentication.setAuthenticatedUserId(approver.buildAssigneeId());
addComment(commandContext, task, COMMENT_TYPE_ADVICE, advice);

View File

@ -53,6 +53,7 @@ public class ApproveErrorReporterEventListener implements BpmnAsyncJobEventListe
@Override
public void notify(FlowableEvent flowableEvent) {
log.info("ApproveErrorReporterEventListener-flowableEvent: {}", JSONUtil.toJsonStr(flowableEvent));
if (!(flowableEvent instanceof FlowableEntityExceptionEventImpl)) {
return;
}

View File

@ -14,7 +14,7 @@ import org.springframework.stereotype.Component;
import java.util.Objects;
import static org.flowable.common.engine.api.delegate.event.FlowableEngineEventType.JOB_EXECUTION_FAILURE;
import static org.flowable.common.engine.api.delegate.event.FlowableEngineEventType.JOB_MOVED_TO_DEADLETTER;
/**
* 异步任务执行异常的扩展监听器
@ -33,7 +33,7 @@ public class ErrorReporterEventListener implements BpmnAsyncJobEventListener {
@Override
public boolean support(FlowableEngineEventType eventType) {
return Objects.equals(JOB_EXECUTION_FAILURE, eventType);
return Objects.equals(JOB_MOVED_TO_DEADLETTER, eventType);
}
@Override

View File

@ -305,7 +305,7 @@ public class AutoOperatorEvent_101_Listener extends AbstractBpmnEventListener<Ta
BpmnTaskDelegateAssigner assigner = BpmnTaskDelegateAssigner.toObjectCompatible(
delegateTask.getVariable(INTERNAL_TASK_RELATION_ASSIGNEE_INFO + delegateTask.getId()));
commandExecutor.execute(new CustomApproveTaskCmd(delegateTask.getId(), null, "自动通过",
Collections.emptyList(), assigner, null, null));
Collections.emptyList(), assigner, null));
}
}