springboot+flowable-ui步骤
参考⽂章
1,引⽤jar
<!-- mysql 数据库 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId&batis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>${mybatis-spring-boot}</version>
</dependency>
<!-- springboot + flowable 时⽤-->
<dependency>
<groupId>org.flowable</groupId>
<artifactId>flowable-spring-boot-starter-basic</artifactId>
<version>${flowable.version}</version>
</dependency>
<!-- flowable-ui start -->
<dependency>
<groupId>org.flowable</groupId>
<artifactId>flowable-ui-common</artifactId>
<version>${flowable.version}</version>
</dependency>
<dependency>
<groupId>org.flowable</groupId>
<artifactId>flowable-ui-modeler-rest</artifactId>
<version>${flowable.version}</version>
</dependency>
<dependency>
<groupId>org.flowable</groupId>
<artifactId>flowable-idm-spring-configurator</artifactId>
<version>${flowable.version}</version>
</dependency>
<dependency>
<groupId>org.flowable</groupId>
<artifactId>flowable-ui-idm-rest</artifactId>
<version>${flowable.version}</version>
</dependency>
<dependency>
<groupId>org.flowable</groupId>
<artifactId>flowable-ui-idm-conf</artifactId>
<version>${flowable.version}</version>
</dependency>
<dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-core</artifactId>
<version>3.6.2</version>
</dependency>
<!-- flowable-ui end -->
2,添加UI静态⽂件
从flowable官⽹中下载ui的war包,解压⾥⾯的 idm, modeler war包,导⼊两个war中的 static 包下的⽂件。或者直接从 获取
3,⽂件配置
3.l
spring:
datasource:
url: jdbc:mysql://127.0.0.1:3306/flowable?autoReconnect=true&useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=CTT username: root
password:111111
flowable:
#关闭定时任务JOB
async-executor-activate:false
common:
app:
idm-url: localhost:9091/demo-flowable/idm/index.html
idm:
app:
admin:
user-id: admin
password: test
first-name: admin
last-name: admin
rest:
app:
authentication-mode: verify-privilege
modeler:
app:
rest-enabled:true
database-schema-update:true
mybatis:
mapper-locations: classpath:/META-INF/modeler-mybatis-mappings/*.xml
config-location: classpath:/l
configuration-properties:
prefix:
blobType: BLOB
boolValue:TRUE
3.l
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration
PUBLIC "-////DTD Config 3.0//EN"
"/dtd/mybatis-3-config.dtd">
<configuration>
<!-- 配置mybatis的⼀些参数 -->
<settings>
<!-- 是否开启⼆级缓存 -->
<setting name="cacheEnabled"value="false"/>
<!-- 延时加载的配置 -->
<setting name="lazyLoadingEnabled"value="false"/>
<setting name="multipleResultSetsEnabled"value="true"/>
<setting name="useColumnLabel"value="true"/>
<setting name="defaultStatementTimeout"value="25000"/>
<setting name="useGeneratedKeys"value="true"/>
<setting name="defaultExecutorType"value="REUSE"/>
<setting name="callSettersOnNulls"value="true"/>
</settings>
</configuration>
3.3 stencilset 国际化⽂件
stencilset_bpmn.json ,内容太多,请看源码
4,Java配置
import org.RemoteAccountResource;
import org.st.app.EditorGroupsResource;
import org.st.app.EditorUsersResource;
import org.st.app.StencilSetResource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.web.servlet.WebMvcRegistrations;
import t.annotation.Bean;
import t.annotation.ComponentScan;
import t.annotation.Configuration;
import t.annotation.FilterType;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.web.servlet.i18n.LocaleChangeInterceptor;
import org.springframework.web.servlet.i18n.SessionLocaleResolver;
import org.springframework.web.hod.annotation.RequestMappingHandlerMapping;
@Configuration
@ComponentScan(value ={
"org.flowable.st.app",
"org.st.exception",
"org.st.app",
"org.st"},
excludeFilters ={
@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = RemoteAccountResource.class), @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = StencilSetResource.class),
@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = EditorUsersResource.class),
@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = EditorGroupsResource.class) })
@EnableAsync
public class AppDispatcherServletConfiguration implements WebMvcRegistrations {
private static final Logger LOGGER = Logger(AppDispatcherServletConfiguration.class);
@Bean
public SessionLocaleResolver localeResolver(){
return new SessionLocaleResolver();
}
@Bean
public LocaleChangeInterceptor localeChangeInterceptor(){
LOGGER.debug("Configuring localeChangeInterceptor");
LocaleChangeInterceptor localeChangeInterceptor =new LocaleChangeInterceptor();
localeChangeInterceptor.setParamName("language");
return localeChangeInterceptor;
}
@Override
public RequestMappingHandlerMapping getRequestMappingHandlerMapping(){
LOGGER.debug("Creating requestMappingHandlerMapping");
RequestMappingHandlerMapping requestMappingHandlerMapping =new RequestMappingHandlerMapping(); requestMappingHandlerMapping.setUseSuffixPatternMatch(false);
requestMappingHandlerMapping.setRemoveSemicolonContent(false);
Object[] interceptors ={localeChangeInterceptor()};
requestMappingHandlerMapping.setInterceptors(interceptors);
return requestMappingHandlerMapping;
}
springboot中文}
import org.flowable.ui.idm.properties.FlowableIdmAppProperties;
import org.flowable.ui.idm.servlet.ApiDispatcherServletConfiguration;
import org.deler.properties.FlowableModelerAppProperties;
import org.t.properties.EnableConfigurationProperties;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import t.ApplicationContext;
import t.annotation.Bean;
import t.annotation.ComponentScan;
import t.annotation.Configuration;
import t.annotation.FilterType;
import org.t.support.AnnotationConfigWebApplicationContext;
import org.springframework.web.servlet.DispatcherServlet;
@Configuration
@EnableConfigurationProperties({FlowableIdmAppProperties.class, FlowableModelerAppProperties.class})
@ComponentScan(basePackages ={
"org.flowable.f",
"org.flowable.ui.idm.security",
"org.flowable.ui.idm.service",
"org.pository",
"org.deler.service",
"org.flowable.uimon.filter",
"org.flowable.uimon.service",
"org.pository",
"org.flowable.uimon.security",
"org.ant"}, excludeFilters ={
@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = org.flowable.f.ApplicationConfiguration.class)}) public class ApplicationConfiguration {
@Bean
public ServletRegistrationBean apiServlet(ApplicationContext applicationContext){
AnnotationConfigWebApplicationContext dispatcherServletConfiguration =new AnnotationConfigWebApplicationContext();
dispatcherServletConfiguration.setParent(applicationContext);
DispatcherServlet servlet =new DispatcherServlet(dispatcherServletConfiguration);
ServletRegistrationBean registrationBean =new ServletRegistrationBean(servlet,"/api/*");
registrationBean.setName("Flowable IDM App API Servlet");
registrationBean.setLoadOnStartup(1);
registrationBean.setAsyncSupported(true);
return registrationBean;
}
}
import org.flowable.spring.SpringProcessEngineConfiguration;
import org.flowable.spring.boot.EngineConfigurationConfigurer;
import t.annotation.Configuration;
/**
* @Author: fumin
* @Description:
* @Date: Create in 2019/5/20 10:26
*/
@Configuration
public class FlowableConfig implements EngineConfigurationConfigurer<SpringProcessEngineConfiguration>{
@Override
public void configure(SpringProcessEngineConfiguration springProcessEngineConfiguration){
springProcessEngineConfiguration.setActivityFontName("宋体");
springProcessEngineConfiguration.setLabelFontName("宋体");
springProcessEngineConfiguration.setAnnotationFontName("宋体");
}
}
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论