63 lines
2.0 KiB
Java
63 lines
2.0 KiB
Java
package com.cm.inspection.config;
|
|
|
|
import com.alibaba.druid.pool.DruidDataSource;
|
|
import com.cm.inspection.config.properties.DataSourceProperties;
|
|
import org.activiti.engine.*;
|
|
import org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
|
|
import org.springframework.context.annotation.Bean;
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
import javax.sql.DataSource;
|
|
|
|
/**
|
|
* When you feel like quitting. Think about why you started
|
|
* 当你想要放弃的时候,想想当初你为何开始
|
|
*
|
|
* @ClassName: ActivitiConfig
|
|
* @Description:
|
|
* @Author: WangGeng
|
|
* @Date: 2020/3/23 11:03
|
|
* @Version: 1.0
|
|
**/
|
|
@Configuration
|
|
@AutoConfigureAfter(DataSourceProperties.class)
|
|
public class ActivitiConfig {
|
|
|
|
@Autowired
|
|
private DataSourceProperties dataSourceProperties;
|
|
|
|
@Bean
|
|
public DataSource dataSource() {
|
|
DruidDataSource druidDataSource = new DruidDataSource();
|
|
druidDataSource.setUrl(dataSourceProperties.getUrl());
|
|
druidDataSource.setUsername(dataSourceProperties.getUsername());
|
|
druidDataSource.setPassword(dataSourceProperties.getPassword());
|
|
druidDataSource.setDriverClassName(dataSourceProperties.getDriverClassName());
|
|
return druidDataSource;
|
|
}
|
|
|
|
@Bean
|
|
public RuntimeService runtimeService(ProcessEngine processEngine) {
|
|
return processEngine.getRuntimeService();
|
|
}
|
|
|
|
@Bean
|
|
public TaskService taskService(ProcessEngine processEngine) {
|
|
return processEngine.getTaskService();
|
|
}
|
|
|
|
@Bean
|
|
public RepositoryService repositoryService(ProcessEngine processEngine) {
|
|
return processEngine.getRepositoryService();
|
|
}
|
|
|
|
@Bean
|
|
public HistoryService historyService(ProcessEngine processEngine) {
|
|
return processEngine.getHistoryService();
|
|
}
|
|
|
|
}
|