package com.zcxk.config;


import com.zcxk.process.activiti.listener.WorkOrderEventListener;
import org.activiti.engine.delegate.event.ActivitiEventListener;

import org.activiti.spring.SpringProcessEngineConfiguration;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>Activiti配置</p>
 *
 * @author wilian.peng
 * @date 2019/12/30
 */
@Configuration
public class ActivitiConfig  {
    @Autowired
    WorkOrderEventListener workOrderEventListener;


    public void configure(SpringProcessEngineConfiguration processEngineConfiguration) {
        List<ActivitiEventListener> activitiEventListener = new ArrayList<ActivitiEventListener>();

        //配置全局监听器
        activitiEventListener.add(workOrderEventListener);

        processEngineConfiguration.setEventListeners(activitiEventListener);
    }


}
