package com.sifang.modules.flowable.tasks;


import com.sifang.modules.flowable.service.ApplicationDetailService;
import org.flowable.engine.delegate.TaskListener;
import org.flowable.task.service.delegate.DelegateTask;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component("rejectStartListener")
public class RejectStartListener implements TaskListener {

    private static Logger logger = LoggerFactory.getLogger(RejectStartListener.class);

    @Autowired
    private ApplicationDetailService detailService;

    @Override
    public void notify(DelegateTask execution) {
        logger.info("notify exec of RejectStartListener");
        String processInstanceId=execution.getProcessInstanceId();
        logger.info(" >>>>>> 审批驳回到提交节点的流程Id processInstanceId : {}"+processInstanceId);
        detailService.editApplyStatus(processInstanceId);
    }
}
