package cn.axzo.workflow.core.engine.tx.listener;

import cn.axzo.workflow.common.model.dto.SimpleTaskDTO;
import cn.axzo.workflow.core.service.ExtAxProcessLogService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.flowable.common.engine.impl.cfg.TransactionListener;
import org.flowable.common.engine.impl.interceptor.CommandContext;

import java.util.List;

/**
 * 恢复创建机器人节点时暂停的审批人任务
 *
 * @author wangli
 * @since 2024-12-09 14:26
 */
@Slf4j
@AllArgsConstructor
public class RobotTaskTransactionListener implements TransactionListener {
    private final List<SimpleTaskDTO> tasks;
    private final ExtAxProcessLogService processLogService;

    @Override
    public void execute(CommandContext commandContext) {
        processLogService.batchRestore(tasks);
    }
}
