Compare commits

...

2 Commits

Author SHA1 Message Date
345f55898d fix - 修复驳回功能导致卡片异常 2025-12-11 15:38:52 +08:00
e6cb590f6a fix - 异步撤回功能修复 2025-12-10 19:53:07 +08:00
2 changed files with 10 additions and 5 deletions

View File

@ -17,6 +17,8 @@ import org.flowable.task.api.Task;
import org.flowable.task.api.history.HistoricTaskInstance;
import org.flowable.task.api.history.HistoricTaskInstanceQuery;
import org.flowable.task.service.impl.persistence.entity.TaskEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.Serializable;
import java.util.HashMap;
@ -28,6 +30,7 @@ import static cn.axzo.workflow.common.constant.BpmnConstants.CLOSE_PROCESS_ASSIG
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_DELETE_PROCESS_FLAG;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_PROCESS_DELETE_REASON;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_PROCESS_TYPE_REJECT;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_TASK_RELATION_ASSIGNEE_INFO;
import static cn.axzo.workflow.common.constant.BpmnConstants.SKIP_MQ;
import static cn.axzo.workflow.common.constant.BpmnConstants.TASK_COMPLETE_OPERATION_TYPE;
import static cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum.DELETED;
@ -44,7 +47,7 @@ import static cn.axzo.workflow.core.engine.cmd.helper.CustomTaskHelper.validTask
* @since 2024/1/4 13:36
*/
public class CustomRejectionTaskCmd extends AbstractCommand<Void> implements Serializable {
private static final Logger log = LoggerFactory.getLogger(CustomRejectionTaskCmd.class);
private final String taskId;
private final String advice;
private String operationDesc;
@ -101,10 +104,13 @@ public class CustomRejectionTaskCmd extends AbstractCommand<Void> implements Ser
validTask(historicTaskInstance, task, approver, nodeTypes);
BpmnTaskDelegateAssigner originAssignee = BpmnTaskDelegateAssigner.toObjectCompatible(task.getVariable(INTERNAL_TASK_RELATION_ASSIGNEE_INFO + task.getId()));
log.info("origin assignee is : {}", JSON.toJSONString(originAssignee));
task.setTransientVariable(TASK_COMPLETE_OPERATION_TYPE + task.getId(), DELETED.getStatus());
TaskEntity virtualTask = createVirtualTask(commandContext, extAxHiTaskInstService, task.getProcessInstanceId(), task.getName(),
task.getTaskDefinitionKey(), advice,
Objects.equals(operationDesc, "自动驳回") ? null : approver, REJECTED.getStatus(),
Objects.equals(operationDesc, "自动驳回") ? null : Objects.isNull(originAssignee) ? approver : originAssignee, REJECTED.getStatus(),
new AddComment(operationDesc));
virtualTask.setTransientVariable(SKIP_MQ, true);

View File

@ -1,6 +1,5 @@
package cn.axzo.workflow.core.engine.job;
import cn.axzo.workflow.common.model.request.bpmn.process.BpmnProcessInstanceCancelDTO;
import cn.axzo.workflow.common.model.request.bpmn.process.SuperBpmnProcessInstanceCancelDTO;
import cn.axzo.workflow.core.engine.cmd.CustomCancelProcessInstanceCmd;
import cn.axzo.workflow.core.service.ExtAxHiTaskInstService;
@ -34,8 +33,8 @@ public class AsyncCancelProcessInstanceJobHandler extends AbstractExecuteWithLoc
log.info("AsyncCancelProcessInstanceHandler executing...,jobInfo:{}", JSONUtil.toJsonStr(job));
log(job);
ProcessEngineConfigurationImpl processEngineConfiguration = CommandContextUtil.getProcessEngineConfiguration(commandContext);
BpmnProcessInstanceCancelDTO dto = JSONUtil.toBean(job.getCustomValues(), BpmnProcessInstanceCancelDTO.class);
processEngineConfiguration.getCommandExecutor().execute(new CustomCancelProcessInstanceCmd((SuperBpmnProcessInstanceCancelDTO) dto, extAxHiTaskInstService));
SuperBpmnProcessInstanceCancelDTO dto = JSONUtil.toBean(job.getCustomValues(), SuperBpmnProcessInstanceCancelDTO.class);
processEngineConfiguration.getCommandExecutor().execute(new CustomCancelProcessInstanceCmd(dto, extAxHiTaskInstService));
}
}