1.在pom.xml 中添加依赖
<!-- flowable -->
<dependency>
<groupId>org.flowable</groupId>
<artifactId>flowable-spring-boot-starter</artifactId>
<version>6.7.1</version>
<exclusions>
<exclusion>
<groupId>org.flowable</groupId>
<artifactId>flowable-spring-boot-starter-app</artifactId>
</exclusion>
<exclusion>
<groupId>org.flowable</groupId>
<artifactId>flowable-form-spring-configurator</artifactId>
</exclusion>
<exclusion>
<groupId>org.flowable</groupId>
<artifactId>flowable-idm-spring-configurator</artifactId>
</exclusion>
<exclusion>
<groupId>org.flowable</groupId>
<artifactId>flowable-spring-boot-starter-cmmn</artifactId>
</exclusion>
<exclusion>
<groupId>org.flowable</groupId>
<artifactId>flowable-cmmn-spring-configurator</artifactId>
</exclusion>
</exclusions>
</dependency>
2.添加配置文件
flowable:
app:
enabled: true
idm:
enabled: true
cmmn:
enabled: true
common:
app:
idm-admin:
user: root
password: root
idm-url: http://localhost:8080/expense/
database-schema-update: true
async-executor-activate: false
content:
enabled: false
3.添加flowable 配置信息
@Configuration
@ComponentScan(value = {
"org.flowable.ui.modeler.repository",
"org.flowable.ui.modeler.service",
"org.flowable.ui.common.tenant",
"org.flowable.ui.common.repository"})
public class FlowableBpmnConfig implements EngineConfigurationConfigurer<SpringProcessEngineConfiguration> {
public static final String FONT="宋体";
@Bean
public ProcessEngineFactoryBean processEngineFactoryBean(SpringProcessEngineConfiguration springProcessEngineConfiguration) {
ProcessEngineFactoryBean processEngineFactoryBean = new ProcessEngineFactoryBean();
processEngineFactoryBean.setProcessEngineConfiguration(springProcessEngineConfiguration);
return processEngineFactoryBean;
}
@Bean
public RuntimeService runtimeService(ProcessEngine processEngine) {
return processEngine.getRuntimeService();
}
@Bean
public HistoryService historyService(ProcessEngine processEngine) {
return processEngine.getHistoryService();
}
@Bean
public DynamicBpmnService dynamicBpmnService(ProcessEngine processEngine) {
return processEngine.getDynamicBpmnService();
}
@Bean
public TaskService taskService(ProcessEngine processEngine) {
return processEngine.getTaskService();
}
@Bean
public RepositoryService repositoryService(ProcessEngine processEngine) {
return processEngine.getRepositoryService();
}
@Bean
public IdentityService identityService(ProcessEngine processEngine) {
return processEngine.getIdentityService();
}
@Bean
public ManagementService managementService(ProcessEngine ProcessEngine) {
return ProcessEngine.getManagementService();
}
@Bean
public ProcessMigrationService processMigrationService(ProcessEngine ProcessEngine) {
return ProcessEngine.getProcessMigrationService();
}
@Bean
public FormService formService(ProcessEngine ProcessEngine) {
return ProcessEngine.getFormService();
}
@Override
public void configure(SpringProcessEngineConfiguration engineConfiguration) {
engineConfiguration.setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE);
engineConfiguration.setDatabaseType(ProcessEngineConfiguration.DATABASE_TYPE_MYSQL);
engineConfiguration.setActivityFontName(FONT);
engineConfiguration.setAnnotationFontName(FONT);
engineConfiguration.setLabelFontName(FONT);
}