赞
踩
公司最近想要使用flowable作为我们工作流引擎,主要用于各类流程审批上。在网上搜索到了很多有参考意义的文章,但有些实现细节还需要自己去摸索。本文的实战包括:
sample源码地址: https://github.com/ChangeChe/flowable
flowable的集成有两部分:flowable-api与flowable-ui。flowable-api主要管创建好流程后怎么使用,flowable-ui就是通过页面去编排我们的流程。
这里的是较新的版本6.7.0。因为自身的框架用的是springboot
,所以需要引入一个starter
。引入的包里有flowable-ui-xxx
是flowable-ui需要的包;其他是我们使用flowable-api需要的包。
<properties> <flowable.version>6.7.0</flowable.version> </properties> <dependencies> <dependency> <groupId>org.flowable</groupId> <artifactId>flowable-spring-boot-starter-process</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-json-converter</artifactId> <version>${flowable.version}</version> </dependency> <dependency> <groupId>org.flowable</groupId> <artifactId>flowable-ui-modeler-rest</artifactId> <version>${flowable.version}</version> <exclusions> <exclusion> <groupId>org.flowable</groupId> <artifactId>flowable-json-converter</artifactId> </exclusion> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-log4j2</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.flowable</groupId> <artifactId>flowable-ui-modeler-conf</artifactId> <version>${flowable.version}</version> <exclusions> <exclusion> <groupId>org.flowable</groupId> <artifactId>flowable-json-converter</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.flowable</groupId> <artifactId>flowable-ui-idm-conf</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-form-engine</artifactId> <version>${flowable.version}</version> </dependency> <dependency> <groupId>org.flowable</groupId> <artifactId>flowable-form-spring</artifactId> <version>${flowable.version}</version> </dependency> <dependency> <groupId>org.flowable</groupId> <artifactId>flowable-form-engine-configurator</artifactId> <version>${flowable.version}</version> </dependency> <dependency> <groupId>org.flowable</groupId> <artifactId>flowable-form-spring-configurator</artifactId> <version>${flowable.version}</version> </dependency> <dependency> <groupId>org.flowable</groupId> <artifactId>flowable-app-engine</artifactId> <version>${flowable.version}</version> </dependency> <dependency> <groupId>org.liquibase</groupId> <artifactId>liquibase-core</artifactId> <version>4.3.5</version> <exclusions> <exclusion> <groupId>javax.xml.bind</groupId> <artifactId>jaxb-api</artifactId> </exclusion> </exclusions> </dependency> </dependencies>
# flowable配置
flowable.common.app.idm-url = /idm
flowable.modeler.app.rest-enabled = true
flowable.database-schema-update = true
flowable.process.definition-cache-limit = 1
flowable.xml.encoding = UTF-8
# mybatis配置
mybatis.mapper-locations = classpath:/META-INF/modeler-mybatis-mappings/*.xml
mybatis.config-location = classpath:/META-INF/mybatis-config.xml
mybatis.configuration-properties.blobType = BLOB
mybatis.configuration-properties.boolValue = TRUE
mybatis.configuration-properties.prefix =
@Configuration @EnableConfigurationProperties({FlowableIdmAppProperties.class, FlowableModelerAppProperties.class}) @ComponentScan(basePackages = { "org.flowable.ui.idm.conf", // "org.flowable.ui.idm.security", "org.flowable.ui.idm.service", "org.flowable.ui.modeler.repository", "org.flowable.ui.modeler.service", // "org.flowable.ui.common.filter", "org.flowable.ui.common.service", "org.flowable.ui.common.repository", // "org.flowable.ui.common.security", "org.flowable.ui.common.tenant", "org.flowable.form" }, excludeFilters = { @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = org.flowable.ui.idm.conf.ApplicationConfiguration.class) }) public class ApplicationConfiguration implements BeanPostProcessor { @Bean public ServletRegistrationBean apiServlet(ApplicationContext applicationContext) { AnnotationConfigWebApplicationContext dispatcherServletConfiguration = new AnnotationConfigWebApplicationContext(); dispatcherServletConfiguration.setParent(applicationContext); dispatcherServletConfiguration.register(ApiDispatcherServletConfiguration.class); DispatcherServlet servlet = new DispatcherServlet(dispatcherServletConfiguration); ServletRegistrationBean registrationBean = new ServletRegistrationBean(servlet, "/api/*"); registrationBean.
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。