¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.flowable.config; |
| | | |
| | | import org.flowable.engine.ProcessEngine; |
| | | import org.flowable.engine.ProcessEngineConfiguration; |
| | | import org.flowable.engine.impl.cfg.StandaloneProcessEngineConfiguration; |
| | | import org.flowable.eventregistry.impl.EventRegistryEngine; |
| | | import org.flowable.eventregistry.impl.EventRegistryEngineConfiguration; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.context.annotation.DependsOn; |
| | | import org.springframework.jdbc.datasource.DriverManagerDataSource; |
| | | |
| | | import javax.sql.DataSource; |
| | | |
| | | @Configuration |
| | | public class FlowableConfig { |
| | | |
| | | @Value("${spring.datasource.dynamic.datasource.master.url}") |
| | | private String jdbcUrl; |
| | | @Value("${spring.datasource.dynamic.datasource.master.username}") |
| | | private String jdbcUsername; |
| | | @Value("${spring.datasource.dynamic.datasource.master.password}") |
| | | private String jdbcPassword; |
| | | @Value("${spring.datasource.dynamic.datasource.master.driver-class-name}") |
| | | private String jdbcDriver; |
| | | |
| | | @Bean |
| | | public DataSource dataSource() { |
| | | DriverManagerDataSource dataSource = new DriverManagerDataSource(); |
| | | dataSource.setUrl(jdbcUrl); |
| | | dataSource.setUsername(jdbcUsername); |
| | | dataSource.setPassword(jdbcPassword); |
| | | dataSource.setDriverClassName(jdbcDriver); |
| | | return dataSource; |
| | | } |
| | | |
| | | @Bean(name = "processEngine") |
| | | @DependsOn("dataSource") |
| | | public ProcessEngine createProcessEngine(DataSource dataSource) { |
| | | StandaloneProcessEngineConfiguration cfg = new StandaloneProcessEngineConfiguration(); |
| | | cfg.setDataSource(dataSource); |
| | | cfg.setDatabaseType("mssql"); |
| | | |
| | | // å¯ä»¥æ ¹æ®éè¦æ·»å æ´å¤é
ç½® |
| | | cfg.setActivityFontName("å®ä½"); |
| | | cfg.setLabelFontName("å®ä½"); |
| | | cfg.setAnnotationFontName("å®ä½"); |
| | | |
| | | // è®¾ç½®æ°æ®åºæ¨¡å¼æ´æ°çç¥ä¸ºèªå¨æ´æ° |
| | | cfg.setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE); |
| | | |
| | | return cfg.buildProcessEngine(); |
| | | } |
| | | |
| | | @Bean(name = "eventRegistryEngine") |
| | | public EventRegistryEngine eventRegistryEngine(DataSource dataSource) { |
| | | EventRegistryEngineConfiguration config = new EventRegistryEngineConfiguration(); |
| | | config.setDataSource(dataSource); |
| | | //flaseï¼activitiå¨å¯å¨æ¶ï¼ä¼å¯¹æ¯æ°æ®åºè¡¨ä¸ä¿åççæ¬ï¼å¦ææ²¡æè¡¨æè
çæ¬ä¸å¹é
ï¼å°æåºå¼å¸¸ãï¼ç产ç¯å¢å¸¸ç¨ï¼ |
| | | //trueï¼ activitiä¼å¯¹æ°æ®åºä¸ææè¡¨è¿è¡æ´æ°æä½ãå¦æè¡¨ä¸åå¨ï¼åèªå¨å建ãï¼å¼åæ¶å¸¸ç¨ï¼ |
| | | config.setDatabaseSchemaUpdate("true"); |
| | | return config.buildEventRegistryEngine(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |