package com.jeeplus.modules.sg.managementcenter.activiti.utils;

import com.jeeplus.modules.sg.managementcenter.project.service.ProjectService;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.ExecutionListener;
import org.springframework.beans.factory.annotation.Autowired;

import java.beans.Expression;
import java.io.Serializable;

public class EndTaskListen implements Serializable, ExecutionListener {
    /**
     * @Fields serialVersionUID : TODO(用一句话描述这个变量表示什么)
     */
    private static final long serialVersionUID = 8513750196548027535L;

    @Autowired
    private ProjectService projectService;

    @Override
    public void notify(DelegateExecution delegateExecution) throws Exception {
        try {
            String processInstanceId = delegateExecution.getProcessInstanceId();
            projectService.updateStatusBy("2", processInstanceId);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
