flowable(二)——spring boot 部署

build.gradle配置

buildscript {
    ext {
        springBootVersion = '1.5.7.RELEASE'
    }

    repositories {
        mavenCentral()

    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
    }
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'

group 'org'
version '1.0-SNAPSHOT'

sourceCompatibility = 1.8

repositories {
    mavenCentral()
}

dependencies {
    testCompile group: 'junit', name: 'junit', version: '4.12'
    //流程
    compile 'org.flowable:flowable-engine:6.3.0'
    compile ('org.flowable:flowable-spring-boot-starter-rest:6.3.0')
    compile ('org.flowable:flowable-spring-boot-starter-actuator:6.3.0')
    compile ('org.springframework.boot:spring-boot-starter-data-jpa')

    //spring boot
    compile('org.springframework.boot:spring-boot-starter-web')
    compile('org.springframework.boot:spring-boot-starter-aop')
    
    compile("com.alibaba:fastjson:1.2.33")
    compile 'com.google.guava:guava:23.0'
    compile 'mysql:mysql-connector-java:5.1.45'
    //云谷
    //k3
    compile group: 'org.json', name: 'json', version: '20190722'
}

application.yml 配置:

server:
  port: 8888
spring:
  datasource: 
      url: 'jdbc:mysql://127.0.0.1:3306/abb?characterEncoding=UTF-8'
      username: 'root'
      password: '123456'
      driver-class-name: 'com.mysql.jdbc.Driver'
      filters: 'config,stat,wall'
  jpa:
    hibernate:
      ddl-auto: update
  activiti:
      # 自动部署验证设置:true-开启(默认)、false-关闭
      check-process-definitions: false
      #配置项可以设置流程引擎启动和关闭时数据库执行的策略
      database-schema-update: true
      #保存历史数据级别设置为full最高级别,便于历史数据的追溯
      history-level: full
      
management:
  endpoint:
    flowable:
      enabled: true
      

logging:
  level:
    root: 'info'
    org.yungu: 'debug'
  config: 'classpath:logback-slf4j.xml'
  path: '../opt/logs/process'
  
flowable:
  #关闭定时任务JOB
  async-executor-activate: false
#  将databaseSchemaUpdate设置为true。当Flowable发现库与数据库表结构不一致时,会自动将数据库表结构升级至新版本。
  database-schema-update: true

启动类配置

package org;

import org.flowable.spring.boot.SecurityAutoConfiguration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;

/**
 * @author lm
 * @version 1.0.0
 * ${tags}
 * @date ${date}
 */
@SpringBootApplication(exclude = SecurityAutoConfiguration.class)
@ComponentScan("org")
public class ProcessorApplication {
    private Logger logger = LoggerFactory.getLogger(YunGuProcessorApplication.class);

    public static void main(String[] args) {
        SpringApplication.run(ProcessorApplication.class, args);
    }

    @Bean
    public ApplicationRunner applicationRunner(ApplicationContext ctx) {

        return args -> {
            logger.info("==============项目启动初始化方法==============");
            logger.info("==============update at 20181227==============");
        };
    }

}

一个简单的Flowable spring boot 部署就配置好了,赶快试一试吧!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值