資源簡介
spring boot整合activiti,包含最全的實例、并且有詳細步驟,不能運行你找我。
代碼片段和文件信息
package?com.ligl.demo;
import?com.ligl.demo.activiti.modeler.JsonpCallbackFilter;
import?com.ligl.demo.firstFlow.*;
import?org.springframework.beans.factory.annotation.Autowired;
import?org.springframework.boot.CommandLineRunner;
import?org.springframework.boot.SpringApplication;
import?org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import?org.springframework.boot.autoconfigure.SpringBootApplication;
import?org.springframework.boot.autoconfigure.domain.EntityScan;
import?org.springframework.context.annotation.Bean;
import?org.springframework.context.annotation.ComponentScan;
import?org.springframework.context.annotation.Configuration;
import?org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import?org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
/**
?*?參考資料:
?http://blog.csdn.net/chenhai201/article/details/72668275 ACTIVITI整合介紹
?http://blog.csdn.net/chq1988/article/details/75699792 ACTIVITI加入數據庫
?http://blog.csdn.net/hj7jay/article/details/51302829??? ACTIVITI涉及的表介紹
?http://doc.okbase.net/wiselyman/archive/209439.html 整合實戰
?*/
@SpringBootApplication
@Configuration???//標注一個類是配置類,spring?boot在掃到這個注解時自動加載這個類相關的功能,比如前面的文章中介紹的配置AOP和攔截器時加在類上的Configuration
@ComponentScan({“org.activiti.rest.diagram“?“com.ligl.demo“})//掃描組建
@EntityScan(“com.ligl.demo.firstFlow“)?//entity對應的包路徑
@EnableJpaRepositories(basePackages={“com.ligl.demo.firstFlow“})//dao層對應的包路徑
//@EnableAutoConfiguration()??//啟用自動配置?該框架就能夠進行行為的配置,以引導應用程序的啟動與運行?根據導入的starter-pom?自動加載配置
@EnableAutoConfiguration(exclude?=?{
org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration.class
org.activiti.spring.boot.SecurityAutoConfiguration.class
org.springframework.boot.actuate.autoconfigure.ManagementWebSecurityAutoConfiguration.class
})
//@EnableAsync
public?class?BootWithActivitiApplication?extends?WebMvcConfigurerAdapter?{
@Autowired
private?PersonRepository?personRepository;
@Autowired
private?CompRepository?compRepository;
public?static?void?main(String[]?args)?{
SpringApplication.run(BootWithActivitiApplication.class?args);
}
@Bean
public?JsonpCallbackFilter?filter(){
return?new?JsonpCallbackFilter();
}
// //初始化模擬數據
@Bean
public?CommandLineRunner?init(final?ActivitiService?myService){
return?new?CommandLineRunner(){
public?void?run(String...?strings)throws?Exception?{
if(personRepository.findAll().size()?==?0){
personRepository.save(new?Person(“wtr“));
personRepository.save(new?Person(“wyf“));
personRepository.save(new?Person(“admin“));
}
if(compRepository.findAll().size()?==?0){
Comp?group?=?new?Comp(“great?company“);
compRepository.save(group);
Person?admin?=?personRepository.findByPersonName(“admin“);
Person?wtr?=?personRepository.findByPersonName(“wtr“);
admin.setComp(group);
wtr.setComp(group);
personRepository.save(admin);
personRepository.save(wtr);
}
}
};
}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2017-11-14?14:39??springBoot-with-activiti\
?????目錄???????????0??2017-11-14?14:52??springBoot-with-activiti\.git\
?????文件?????????310??2017-08-30?11:08??springBoot-with-activiti\.gitignore
?????文件???????????7??2017-11-14?14:52??springBoot-with-activiti\.git\COMMIT_EDITMSG
?????文件?????????325??2017-11-14?14:46??springBoot-with-activiti\.git\config
?????文件??????????73??2017-11-14?14:36??springBoot-with-activiti\.git\desc
?????文件??????????23??2017-11-14?14:36??springBoot-with-activiti\.git\HEAD
?????目錄???????????0??2017-11-14?14:36??springBoot-with-activiti\.git\hooks\
?????文件?????????478??2017-11-14?14:36??springBoot-with-activiti\.git\hooks\applypatch-msg.sample
?????文件?????????896??2017-11-14?14:36??springBoot-with-activiti\.git\hooks\commit-msg.sample
?????文件?????????189??2017-11-14?14:36??springBoot-with-activiti\.git\hooks\post-update.sample
?????文件?????????424??2017-11-14?14:36??springBoot-with-activiti\.git\hooks\pre-applypatch.sample
?????文件????????1642??2017-11-14?14:36??springBoot-with-activiti\.git\hooks\pre-commit.sample
?????文件????????1348??2017-11-14?14:36??springBoot-with-activiti\.git\hooks\pre-push.sample
?????文件????????4951??2017-11-14?14:36??springBoot-with-activiti\.git\hooks\pre-reba
?????文件?????????544??2017-11-14?14:36??springBoot-with-activiti\.git\hooks\pre-receive.sample
?????文件????????1239??2017-11-14?14:36??springBoot-with-activiti\.git\hooks\prepare-commit-msg.sample
?????文件????????3610??2017-11-14?14:36??springBoot-with-activiti\.git\hooks\update.sample
?????文件???????49983??2017-11-14?14:52??springBoot-with-activiti\.git\index
?????目錄???????????0??2017-11-14?14:36??springBoot-with-activiti\.git\info\
?????文件?????????240??2017-11-14?14:36??springBoot-with-activiti\.git\info\exclude
?????目錄???????????0??2017-11-14?14:45??springBoot-with-activiti\.git\logs\
?????文件?????????324??2017-11-14?14:52??springBoot-with-activiti\.git\logs\HEAD
?????目錄???????????0??2017-11-14?14:46??springBoot-with-activiti\.git\logs\refs\
?????目錄???????????0??2017-11-14?14:45??springBoot-with-activiti\.git\logs\refs\heads\
?????文件?????????324??2017-11-14?14:52??springBoot-with-activiti\.git\logs\refs\heads\master
?????目錄???????????0??2017-11-14?14:46??springBoot-with-activiti\.git\logs\refs\remotes\
?????目錄???????????0??2017-11-14?14:46??springBoot-with-activiti\.git\logs\refs\remotes\origin\
?????文件?????????314??2017-11-14?14:52??springBoot-with-activiti\.git\logs\refs\remotes\origin\master
?????目錄???????????0??2017-11-14?14:52??springBoot-with-activiti\.git\ob
?????目錄???????????0??2017-11-14?14:52??springBoot-with-activiti\.git\ob
............此處省略1582個文件信息
評論
共有 條評論