Spring Boot integrates Activiti-stepped pits (continuously updated)

Source: Internet
Author: User

1. First, Maven adds a variety of error-dependent errors.

<!--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, another day try again, success.


2. Later using the 5.17 version, the successful

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

Many of these packages cannot be introduced directly and need to be imported manually. See Manually importing Maven rack packs.

Version 5.17 is compatible with mybitis3.25, and other versions are problematic, specifically because SQL will have an order by. Finally, use version 5.22


3. After the environment is set up, deploy the corresponding Activiti process, Activiti Desingner has already said before. Start the project, and the. bpmn file system will help you to automatically publish the process directly.


4.spring Boot Integration Unit test

@RunWith (Springjunit4classrunner.class)//Springjunit support, which introduces Spring-test framework support. 
@SpringApplicationConfiguration (classes = application.class)//Specify the application startup class for our Springboot project
@ Webappconfiguration//Because it is a Web project, JUnit needs to simulate servletcontext, so we need to add @webappconfiguration to our test class.

5. Later the project found that, if the same instance, Springboot could not create 25 tables in the other tablespace and create the table using the load Activiti.cfg.xml method.

<beans xmlns= "Http://www.springframework.org/schema/beans" xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instan Ce "xsi:schemalocation=" Http://www.springframework.org/schema/beans Http://www.springframework.org/sche Ma/beans/spring-beans.xsd "> <!--activiti processing engine configuration, to spring management--<bean id=" Processenginecon  
          Figuration "class=" Org.activiti.spring.SpringProcessEngineConfiguration "> <!--Configure the data source, and the system uses the same data source-- <property name= "DataSource" ref= "DataSource"/> <property name= "Databaseschemaupdate" Val   
          Ue= "true"/> <property name= "Jobexecutoractivate" value= "false"/> <!--unified transaction Management- <property name= "TransactionManager" ref= "TransactionManager"/> <property name= "activity FontName "value=" song Body "/> <property name=" Labelfontname "value=" song Body "/> <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 {

}
Start the project and create the Activiti table.

However, the process definition cannot be published automatically because Activiti is loaded using XML. After the solid loading is successful, the @importresource can be removed.

6. When deleting the Activiti table, be careful to remove the sequence act_evt_log_seq.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.