1. 程式人生 > >Activiti5.22引數配置原始碼解析

Activiti5.22引數配置原始碼解析

package org.activiti.spring.boot;

import org.activiti.spring.SpringProcessEngineConfiguration;

/**
 * Interface to be implemented by a bean that does some extra configuration of the SpringProcessEngineConfiguration.
 * If such a bean is defined, it will be called when the process engine configuration is created 
 * and the default values have been set. 
 * 
 * @author Joram Barrez
 */
public interface ProcessEngineConfigurationConfigurer {
	
	void configure(SpringProcessEngineConfiguration processEngineConfiguration);

}

Interface to be implemented by a bean that does some extra configuration of the SpringProcessEngineConfiguration.

介面要被一個做一些對SpringProcessEngineConfiguration額外配置bean實現。

If such a bean is defined, it will be called when the process engine configuration is created and the default values have been set.

如果配置了一個這樣的bean,建立流程的時候將會被呼叫,並且預設值已經被設定好。

看上邊註釋可知,建立一個配置類實現該介面,可以在初始化流程引擎的時候增加自定義配置。

然後再往裡看,介面方法configure,引數SpringProcessEngineConfiguration類

繼承ProcessEngineConfigurationImpl實現ApplicationContextAware

而類ProcessEngineConfigurationImpl又繼承了類ProcessEngineConfiguration

綜合以上,大概這些類中就會有我們需要的配置內容了,先來看看我們需要哪些必要的配置

模型字型、資料來源、事務、歷史記錄等級、執行器任務非同步等、資料庫使用者相關表驗證、主鍵生成策略、mail伺服器設定、jpa等等

在此就不一一列舉,下圖為ProcessEngineConfiguration部分截圖

總之,流程引擎相關配置都能從以上類中找到出處,具體配置時可以去以上幾個類中去找,舉一反三,配置命名都很清晰。