package ink.wgink.module.activiti.listener.task;

import ink.wgink.module.activiti.handler.task.IOaUserTaskCompleteHandler;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.DelegateTask;
import org.activiti.engine.delegate.JavaDelegate;
import org.activiti.engine.delegate.TaskListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @ClassName: OaUserTaskCompleteListener
 * @Description: OA用户任务节点完成监听器
 * @Author: wanggeng
 * @Date: 2022/3/28 10:31
 * @Version: 1.0
 */
@Component
public class OaUserTaskCompleteListener implements TaskListener, JavaDelegate {

    @Autowired(required = false)
    private IOaUserTaskCompleteHandler oaUserTaskCompleteHandler;

    @Override
    public void notify(DelegateTask delegateTask) {
        if (oaUserTaskCompleteHandler != null) {
            oaUserTaskCompleteHandler.handle(delegateTask);
        }
    }

    @Override
    public void execute(DelegateExecution execution) {

    }

}
