springBoot 2.X 整合 flowable6.7.1

该博客介绍了如何在Spring Boot应用中集成Flowable工作流引擎,包括在pom.xml中添加依赖,配置相关属性,并展示了详细的Flowable配置代码,涉及RuntimeService、HistoryService等核心组件的初始化。
摘要由CSDN通过智能技术生成

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);
    }
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值