Spring Boot Integration Activiti Modeler Preface a directory structure two integration process 1 copy file 2 modify file three Activiti Modeler import an existing process file
Spring Boot integrated Activiti Modeler Preface
Blind whole night plus one morning, finally integration completed, record for the next use
Spring Boot version: 1.5.3
Activiti version: 5.22.0 . Directory Structure
Where: ii. integration process 2.1 Copying Files
First download the activiti5.22.0 version of the full code package from the official, and extract it locally from the activiti-webapp-explorer2 copy src\main\java\org\activiti\explorer\ The file under the servlet path (part A of the figure) to the local project (if the static resource file cannot be accessed after startup, delete the Dispatherservletconfiguration.java file) Copy the Stencilset.json file under the src\main\resources path from Activiti-webapp-explorer2 to the resources directory of the Local project (I'm here for management resources/ Activiti/modeler directory) Copy the files under the Src\main\webapp path from the Activiti-webapp-explorer2 (part C of the figure) to the Resources/public/static directory of the Local project Copy files under Src\main\java\org\activiti\rest\editor path from Activiti-modeler (Part B of the figure) to a local project
The path of the above copy reference above Figure 2.2 modify the file
For the integration to be effective, we need to modify the following files
1) Modify the pom.xml of the local project and add the following dependencies
<dependency> <groupId>org.activiti</groupId> <artifactId> Activiti-spring-boot-starter-basic</artifactid> <version>${activiti.version}</version> </ dependency> <dependency> <groupId>org.activiti</groupId> <artifactid>activiti-spring-b
Oot-starter-actuator</artifactid> <version>${activiti.version}</version> </dependency> <dependency> <groupId>org.activiti</groupId> <artifactid>activiti-rest</artifactid > <version>${activiti.version}</version> </dependency> <dependency> <groupid>org .apache.xmlgraphics</groupid> <artifactId>batik-codec</artifactId> <version>1.7</ version> </dependency> <dependency> <groupId>org.apache.xmlgraphics</groupId> <artif Actid>batik-css</artifactid> <version>1.7</version> </dependency> <dependency> <groupId>org.apache.xmlgraphics</groupId> <artifactid>batik-svg -dom</artifactid> <version>1.7</version> </dependency> <dependency> <groupid>o Rg.apache.xmlgraphics</groupid> <artifactId>batik-svggen</artifactId> <version>1.7</ version> </dependency> <dependency> <groupId>org.activiti</groupId> <artifactid>a Ctiviti-explorer</artifactid> <version>${activiti.version}</version> </dependency> < Dependency> <groupId>org.activiti</groupId> <artifactid>activiti-diagram-rest</ artifactid> <version>${activiti.version}</version> </dependency> <dependency> <group Id>org.activiti</groupid> <artifactId>activiti-simple-workflow</artifactId> <version> ${activiti.version}</version> </dependency> <dependency> <groupId>org.activiti</groupId> <artifactid>activiti-spring</arti Factid> <version>${activiti.version}</version> </dependency>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
2) Modify Dispatcherservletconfiguration.java
Read as follows:
@Configuration @ComponentScan ({"Org.activiti.rest.editor", "Org.activiti.rest.diagram"}) public class dispatcherservletconfiguration {private final Logger log = Loggerfactory.getlogger (
Dispatcherservletconfiguration.class);
@Bean public Sessionlocaleresolver Localeresolver () {return new sessionlocaleresolver (); } @Bean Public Localechangeinterceptor localechangeinterceptor () {log.debug ("Configuring Localechangeinterceptor
");
Localechangeinterceptor localechangeinterceptor = new Localechangeinterceptor ();
Localechangeinterceptor.setparamname ("language");
return localechangeinterceptor; } @Bean Public requestmappinghandlermapping requestmappinghandlermapping () {log.debug ("Creating Requestmappingha
Ndlermapping ");
requestmappinghandlermapping requestmappinghandlermapping = new requestmappinghandlermapping ();
Requestmappinghandlermapping.setusesuffixpatternmatch (FALSE);
Object[] Interceptors = {localechangeinterceptor ()}; RequEstmappinghandlermapping.setinterceptors (interceptors);
return requestmappinghandlermapping; }
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
3) Modify the Stencilsetrestresource.java (if not placed in the resources directory when copying Stencilset.json)
Will
InputStream Stencilsetstream = This.getclass (). getClassLoader (). getResourceAsStream ("Stencilset.json");
1
Switch
InputStream Stencilsetstream = This.getclass ()