springboot Integration activity encountered

1. First, given the various dependent maven added.

<!-- https://mvnrepository.com/artifact/org.activiti/activiti-spring-boot-starter-basic -->
 
<dependency>    
 
<groupId>org.activiti</groupId>    
 
<artifactId>activiti-spring-boot-starter-basic</artifactId>    
 
<version>5.22.0</version>
 
</dependency>

 

Try several times invalid, try again another day, success.

 

2. Later use version 5.17, successful

<dependency>
    <groupId>org.activiti</groupId>
    <artifactId>spring-boot-starter-basic</artifactId>
    <version>5.17</version>
</dependency>

Many of the package can not be introduced directly into the rack, you need to manually import. See manual import maven carrier package.

 

Mybitis3.25 version 5.17 and is compatible with other versions have a problem, the problem is specific sql will be more of a order by. Finally use version 5.22

 

3. After a good environment to build, deploy corresponding activiti process, activiti desingner I have already said that. Start the project, for .bpmn file system will help you direct the flow automatically posted out.

 

4.spring boot integrated unit testing

@RunWith (SpringJUnit4Cla *** unner.class) // SpringJUnit support, thus introducing Spring-Test Framework support! 
@SpringApplicationConfiguration (classes = Application.class) // specify the Application class we start SpringBoot engineering 
@WebAppConfiguration // Because it is Web project, Junit need to simulate ServletContext, so we need to test our classes plus @WebAppConfiguration.

 

The project was later found that if the same instance, springboot can not create 25 tables in other table spaces, use the add-activiti.cfg.xml way to create the table.

<beans xmlns="http://www.springframework.org/schema/beans"   
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
       xsi:schemaLocation="http://www.springframework.org/schema/beans   
       http://www.springframework.org/schema/beans/spring-beans.xsd">  
  
	   <!-- Activiti处理引擎的配置,交由Spring管理 -->  
  
  	   <bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">  
          <!-- 配置数据源,和系统使用同一个数据源 -->  
          <property name="dataSource" ref="dataSource" />  
          <property name="databaseSchemaUpdate" value="true" />  
          <property name="jobExecutorActivate" value="false" />  
          <!-- 统一的事务管理 -->  
          <property name="transactionManager" ref="transactionManager" />  
          <property name="activityFontName"  value="宋体" />  
          <property name="labelFontName"  value="宋体" />  
          <property name="databaseSchema" value="ACT"/>
  	   </bean>  
  
	   <bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean">  
	      <property name="processEngineConfiguration" ref="processEngineConfiguration" />  
	   </bean> 
	   <!-- 
	   <bean id="testService2" class="com.imm.amo.controller.ActivitiTest"></bean> 
	   -->
</beans>  
package com.imm.config;
 
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
 
 
@Configuration
@ImportResource(locations={"classpath:activiti.cfg.xml"})
public class config {
 
}

启动项目,创建activiti表。

但是因为使用了xml方式加载activiti,所以无法自动发布流程定义。固加载成功之后,去除@ImportResource即可。

springboot 整合activiti6 案例:www.b123.com

6.删除activiti表时,注意要删除SEQUENCE ACT_EVT_LOG_SEQ。


Guess you like

Origin blog.51cto.com/14622073/2471658