jeecg-boot集成⼯作流(官⽅画布)1.引⼊maven依赖jar( l)
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-spring-boot-starter-basic</artifactId>
<version>${activiti.version}</version>
<exclusions>
<exclusion>
<artifactId>mybatis</artifactId>
<groupId&batis</groupId>
</exclusion>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-rest</artifactId>
<version>${activiti.version}</version>
<exclusions>
<exclusion>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-crypto</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-diagram-rest</artifactId>
<version>${activiti.version}</version>
<exclusions>
<exclusion>
springboot架构图<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-crypto</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-modeler</artifactId>
<version>${activiti.version}</version>
<exclusions>
<exclusion>
<groupId>org.springframework.security</groupId> <artifactId>spring-security-config</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.security</groupId> <artifactId>spring-security-crypto</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.security</groupId> <artifactId>spring-security-web</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-explorer</artifactId>
<version>${activiti.version}</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>org.vaadin.addons</groupId>
<artifactId>dcharts-widget</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-json-converter</artifactId>
<version>${activiti.version}</version>
</dependency>
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-spring</artifactId>
<version>${activiti.version}</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-engine</artifactId>
<version>${activiti.version}</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId&batis</groupId>
<artifactId>mybatis</artifactId>
</exclusion>
</exclusions>
</dependency>
<properties>
<activiti.version>5.22.0</activiti.version>
</properties>
spring:
activiti:
check-process-definitions:false
#启⽤作业执⾏器
async-executor-activate:false
#启⽤异步执⾏器
job-executor-activate:false
autoconfigure:
exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure,org.activiti.spring.boot.SecurityAutoConfiguration
shiro:
excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/service/**,/act/model/graphHistoryProcessInstance,/act/model/graphProcessDiagra m/**
3.修改启动类(JeecgApplication.java)
package;
import Slf4j;
import ProcessEngineConfiguration;
import SpringProcessEngineConfiguration;
import Context;
import Connector;
import StandardJarScanner;
import;
import Autowired;
import SpringApplication;
import SpringBootApplication;
import SpringApplicationBuilder;
import SpringApplicationBuilder;
import TomcatConnectorCustomizer;
import TomcatServletWebServerFactory;
import SpringBootServletInitializer;
import ConfigurableApplicationContext;
import Bean;
import Environment;
import DataSourceTransactionManager;
import PlatformTransactionManager;
import DataSource;
import InetAddress;
import UnknownHostException;
/
**
* 单体启动类(采⽤此类启动项⽬为单体模式)
*/
@Slf4j
@SpringBootApplication
public class JeecgSystemApplication extends SpringBootServletInitializer {
@Autowired
private DataSource dataSource;
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application){
return application.sources(JeecgSystemApplication.class);
}
public static void main(String[] args)throws UnknownHostException {
ConfigurableApplicationContext application = SpringApplication.run(JeecgSystemApplication.class, args); Environment env = Environment();
String ip = LocalHost().getHostAddress();
String port = Property("server.port");
String path = Property("t-path"));
log.info("\n----------------------------------------------------------\n\t"+
"Application Jeecg-Boot is running! Access URLs:\n\t"+
"Local: \t\tlocalhost:"+ port + path +"/\n\t"+
"External: \t"+ ip +":"+ port + path +"/\n\t"+
"Swagger⽂档: \t"+ ip +":"+ port + path +"/doc.html\n"+
"----------------------------------------------------------");
}
/**
* tomcat-embed-jasper引⽤后提⽰jar不到的问题
*/
@Bean
public TomcatServletWebServerFactory tomcatFactory(){
TomcatServletWebServerFactory factory =new TomcatServletWebServerFactory(){
@Override
protected void postProcessContext(Context context){
((StandardJarScanner) JarScanner()).setScanManifest(false);
}
};
factory.addConnectorCustomizers(new TomcatConnectorCustomizer(){
@Override
public void customize(Connector connector){
connector.setProperty("relaxedPathChars","\"<>[\\]^`{|}");
connector.setProperty("relaxedQueryChars","\"<>[\\]^`{|}");
}
});
return factory;
return factory;
}
/*
@AutoConfigureOrder(Ordered.LOWEST_PRECEDENCE)
*/
@Bean
public SpringProcessEngineConfiguration springProcessEngineConfiguration(){
SpringProcessEngineConfiguration configuration =new SpringProcessEngineConfiguration();
configuration.setDataSource(this.dataSource);
configuration.setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE);
//作业执⾏器
configuration.setJobExecutorActivate(false);
configuration.setDbIdentityUsed(false);
configuration.setTransactionManager(transactionManager());
configuration.setLabelFontName("宋体");
configuration.setActivityFontName("宋体");
configuration.setAnnotationFontName("宋体");
/* Map<Object, Object> beans = new HashMap<>();
beans.put("sysBaseAPI", sysBaseAPI);
configuration.setBeans(beans);*/
return configuration;
}
@Bean
public PlatformTransactionManager transactionManager(){
return new DataSourceTransactionManager(this.dataSource);
}
}
4.启动后端项⽬后查看⼯作流表是否⽣成
act_**(共21个表) 如果启动报错需要在数据库链接的url 拼接&nullCatalogMeansCurrent=true
5.所需库表创建(库表创建sql⽂件夹下有对应的sql⽂件)
1. act_expression 流程表达式
2. act_listener 流程监听
3. act_model_xml 流程模块相关
4. act_leave 请假demo 相关
5. bpmn_model_relation 流程业务关联
6. base_check_record 流程审核记录(可⾃⼰封装)
7. act_id_group (视图)
8. act_id_membership(视图)
9. act_id_user(视图)
⾄此 系统的⼯作流环境已经搭建完成
6.代码迁移–复制源码包中相应的⽂件⾄所需要集成的项⽬中
后端项⽬( jeecg-boot-module-sysytem)
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论