Spring platform integrates activiti workflow engine instance

Spring combines the activiti workflow to complete a workflow example of leave and procurement functions. Department personnel apply for leave. After the application is completed, the department manager approves it. Finally, you can view the details of the application process. The procurement process is similar to the leave process, and the specific download example

Example download: http://www.wisdomdd.cn/Wisdom/resource/articleDetail.htm?resourceId=1058

The example code corresponding to the project can be downloaded through [click to download]

Project development tools Eclipse, JDK1.8, Maven3.0.4, tomcat8 and other tools can also be downloaded in the [Tools Download] column

The project contains the contents (see the picture below):

[Spring-activiti] Maven project

[activiti.sql] data script

Spring platform integrates activiti workflow engine instance

【Function introduction】

In the development of common ERP systems and OA systems, workflow engine is an essential tool. This project aims to integrate the industry's popular workflow engine Activiti based on the Spring platform, and establish two complete workflows for demonstration: leave OA and procurement process.

It contains the following:

1. Do not use the user and role functions that come with activiti, because it is too simple, and instead implement a three-level structure of users, roles, and permissions, users to roles, roles to permissions are many-to-many mapping, the persistence layer framework uses The collection and association tags of mybatis are nested;

2. After logging in with the default user (username xiaomi, password 1234), you can see the two processes that have been deployed, the leave request OA and the procurement process, where the leave request OA includes user tasks, exclusive gateways, start and end events , is relatively simple; in addition to the procurement process, the use of abnormal end events, sub-processes and boundary events is also used;

3. Both processes include the functions of signing the to-do task, tracking the progress of the running process, and viewing the history of the completed process. The running process progress is marked in red in the flowchart;

4. When using, separate the process data from the business data, and use the business key (businessKey) to establish a bridge between the process data and the business data so that they can access each other. The primary key of the business data is the business number;

5. All forms in this system use ordinary forms instead of activiti's dynamic forms and external forms. This is to store business data and process data in separate tables;

6. The front end of the system is built using Bootstrap-based template devoops.

7. Start page entry: http://localhost:8080/Spring-activiti/login

【running result】

Spring platform integrates activiti workflow engine instance

Spring platform integrates activiti workflow engine instance

Spring platform integrates activiti workflow engine instance

【Project Framework】

Spring platform integrates activiti workflow engine instance

[Configuration explanation]

1. Modify conf/spring-mybatis.xml and change the corresponding configuration information to local configuration information

1

2

3

4

5

6

7

8

9

10

<bean id="dataSource"class="com.mchange.v2.c3p0.ComboPooledDataSource"

destroy-method="close"

p:driverClass="com.mysql.jdbc.Driver"

p:jdbcUrl="jdbc:mysql://localhost:3306/activiti"

p:user="root"

p:password="ajqnhwvia"

p:maxPoolSize="40"

p:minPoolSize="2"

p:initialPoolSize="2"

p:maxIdleTime="30"/>

2. Set the JDK version to JDK1.8

3. Set the TOMCAT version to TOMCAT8

【data】

1. After importing the data script into the database, open the table user, the fields username and password are the username and password respectively

And the 24 tables corresponding to activiti are also in the data script (see the figure below)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325514562&siteId=291194637