美文网首页
Activiti 7.x 与Spring-Boot 整合

Activiti 7.x 与Spring-Boot 整合

作者: MaJiT | 来源:发表于2020-03-01 19:02 被阅读0次

    1.相关依赖

    <!--activiti7与SpringBoot整合的相关依赖-->
        <parent>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-parent</artifactId>
            <version>2.1.3.RELEASE</version>
            <relativePath/> <!-- lookup parent from repository -->
        </parent>
    
    <dependencies>
            <!-- 主要是引入以下spring-boot与activiti整合的依赖包 -->
            <dependency>
                <groupId>org.activiti</groupId>
                <artifactId>activiti-spring-boot-starter</artifactId>
                <version>7.0.0.Beta4</version>
            </dependency>
            <dependency>
                <groupId>org.activiti</groupId>
                <artifactId>activiti-image-generator</artifactId>
                <version>7.0.0.Beta4</version>
            </dependency>
        </dependencies>
    

    2.yml配置

    activiti:
        history-level: full
        db-history-used: true
        database-schema-update: true
    

    3.security配置不登陆验证

    import org.springframework.context.annotation.Configuration;
    import org.springframework.security.config.annotation.web.builders.HttpSecurity;
    import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
    import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
    
    @Configuration
    @EnableWebSecurity(debug = true)//已经自动配置了,此处只是为了打印debug信息
    public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter {
    
        @Override
        protected void configure(HttpSecurity http) throws Exception {
            http.csrf().disable().authorizeRequests().anyRequest().permitAll().and().logout().permitAll();
        }
    
    }
    

    项目中resources目录下创建processes文件夹。作用是Activiti7自动把processes目录下的流程定义文件同步到数据库中
    注意:此目录必要放做好的流程定义文件,不然都会同步到数据库中

    相关文章

      网友评论

          本文标题:Activiti 7.x 与Spring-Boot 整合

          本文链接:https://www.haomeiwen.com/subject/qeshkhtx.html