package org.springblade.flow.engine.custom.engine;

import org.flowable.engine.impl.persistence.deploy.ProcessDefinitionInfoCache;
import org.flowable.spring.SpringProcessEngineConfiguration;
import org.springblade.flow.engine.custom.event.logger.ElasticSearchEventLogger;

/**
 * @author LoveMyOrange
 * @create 2022-02-02 11:58
 */
public class CustomSpringProcessEngineConfiguration extends SpringProcessEngineConfiguration {
    /**
     * 自定义自己的日志清洗器 这样可以接管数据到其他地方中
     */
    @Override
    public void initDatabaseEventLogging() {
        if(enableDatabaseEventLogging){
            getEventDispatcher().addEventListener(new ElasticSearchEventLogger(clock,objectMapper));
        }
    }


    // 设置processDefinitionInfoCache对象的值
    public void setProcessDefinitionInfoCache(ProcessDefinitionInfoCache cache) {
        this.processDefinitionInfoCache = cache;
    }

}
