|
@@ -1,5 +1,7 @@
|
|
|
package cn.com.taiji;
|
|
|
|
|
|
+import java.io.File;
|
|
|
+import java.io.FileInputStream;
|
|
|
import java.sql.SQLException;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Collection;
|
|
@@ -14,9 +16,14 @@ import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import javax.sql.DataSource;
|
|
|
|
|
|
+import org.activiti.engine.ProcessEngine;
|
|
|
+import org.activiti.engine.ProcessEngines;
|
|
|
+import org.activiti.engine.RepositoryService;
|
|
|
+import org.activiti.engine.repository.Deployment;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.boot.Banner;
|
|
|
+import org.springframework.boot.CommandLineRunner;
|
|
|
import org.springframework.boot.SpringApplication;
|
|
|
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
|
|
|
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
|
@@ -109,7 +116,7 @@ import cn.com.taiji.sys.service.UserService;
|
|
|
* @date 2017年11月22日 下午3:45:29
|
|
|
*
|
|
|
*/
|
|
|
-public class Application extends WebMvcConfigurerAdapter {
|
|
|
+public class Application extends WebMvcConfigurerAdapter implements CommandLineRunner {
|
|
|
/*
|
|
|
* Caused by: org.springframework.beans.factory.NoUniqueBeanDefinitionException:
|
|
|
* No qualifying bean of type [org.springframework.core.task.TaskExecutor] is
|
|
@@ -126,6 +133,22 @@ public class Application extends WebMvcConfigurerAdapter {
|
|
|
System.setProperty("jasypt.encryptor.password", "123456");
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void run(String... strings) throws Exception {
|
|
|
+// String basePath = "/Users/hujie/Documents/dev/git-repo/taiji/tianjin-cgw/zyml/cn.com.taiji.system/src/main/resources/static/diagrams";
|
|
|
+//// 1、创建ProcessEngine
|
|
|
+// ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
|
|
|
+//// 2、得到RepositoryService实例
|
|
|
+// RepositoryService repositoryService = processEngine.getRepositoryService();
|
|
|
+//// 3、使用RepositoryService进行部署
|
|
|
+// Deployment deployment = repositoryService.createDeployment()
|
|
|
+// .addInputStream("dataPreparation.bpmn", new FileInputStream(new File(basePath + "/dataPreparation.bpmn")))
|
|
|
+// .addInputStream("dataPreparation.png", new FileInputStream(new File(basePath + "/dataPreparation.png")))
|
|
|
+// .name("dataPreparation")
|
|
|
+// .deploy();
|
|
|
+ }
|
|
|
+
|
|
|
@Bean
|
|
|
public ThreadPoolTaskExecutor threadPoolTaskExecutor() {
|
|
|
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|