update 调整流程实例删除

This commit is contained in:
songgaoshuai 2023-12-07 18:14:42 +08:00
parent d998971d18
commit b2a82d5637

View File

@ -2,6 +2,7 @@ package org.dromara.workflow.flowable.cmd;
import org.flowable.common.engine.impl.interceptor.Command; import org.flowable.common.engine.impl.interceptor.Command;
import org.flowable.common.engine.impl.interceptor.CommandContext; import org.flowable.common.engine.impl.interceptor.CommandContext;
import org.flowable.engine.impl.persistence.entity.ExecutionEntity;
import org.flowable.engine.impl.persistence.entity.ExecutionEntityManager; import org.flowable.engine.impl.persistence.entity.ExecutionEntityManager;
import org.flowable.engine.impl.util.CommandContextUtil; import org.flowable.engine.impl.util.CommandContextUtil;
@ -12,7 +13,7 @@ import java.io.Serializable;
* *
* @author may * @author may
*/ */
public class DeleteExecutionCmd implements Command<String>, Serializable { public class DeleteExecutionCmd implements Command<Void>, Serializable {
/** /**
* 执行id * 执行id
@ -24,9 +25,12 @@ public class DeleteExecutionCmd implements Command<String>, Serializable {
} }
@Override @Override
public String execute(CommandContext commandContext) { public Void execute(CommandContext commandContext) {
ExecutionEntityManager executionEntityManager = CommandContextUtil.getExecutionEntityManager(); ExecutionEntityManager executionEntityManager = CommandContextUtil.getExecutionEntityManager();
executionEntityManager.delete(executionId); ExecutionEntity entity = executionEntityManager.findById(executionId);
if (entity != null) {
executionEntityManager.deleteExecutionAndRelatedData(entity, "", false, false);
}
return null; return null;
} }
} }