
package com.activiti6.config.event.listener.task;


import com.activiti6.domain.ProcessInstanceEvEntFrom;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.ExecutionListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

@Component
public class RejectListener implements ExecutionListener {
    protected final Logger logger = LoggerFactory.getLogger(RejectListener.class);

    @Override
    public void notify(DelegateExecution delegateExecution) {
        Long formId =Long.parseLong(delegateExecution.getVariable("formId").toString());
        String formKey =delegateExecution.getVariable("formKey").toString();
        ProcessInstanceEvEntFrom processInstanceEvEntFrom=new ProcessInstanceEvEntFrom();
        processInstanceEvEntFrom.setFormId(formId);
        processInstanceEvEntFrom.setFormKey(formKey);
//        RemoteActivitiOperationService remoteActivitiOperationService = SpringUtils.getBean(RemoteActivitiOperationService.class);
//        R end = remoteActivitiOperationService.reject(processInstanceEvEntFrom);
//        int code = end.getCode();
//        if(200!=code){
//            throw new RuntimeException("远程更新数据失败!");
//        }
        logger.info("执行了驳回监听");
}

}

