Skip to content

Commit bae1621

Browse files
committed
add flow & update event
1 parent b825aff commit bae1621

File tree

77 files changed

+7452
-30
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+7452
-30
lines changed

pom.xml

+32-9
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<groupId>com.codingapi.springboot</groupId>
1414
<artifactId>springboot-parent</artifactId>
15-
<version>2.8.11</version>
15+
<version>2.9.0</version>
1616

1717
<url>https://github.com/codingapi/springboot-framewrok</url>
1818
<name>springboot-parent</name>
@@ -31,18 +31,20 @@
3131
<nexus.staging.maven.plugin>1.6.13</nexus.staging.maven.plugin>
3232
<maven.gpg.plugin>3.1.0</maven.gpg.plugin>
3333
<codingapi.framework.version>${project.version}</codingapi.framework.version>
34-
<fastjson.version>2.0.42</fastjson.version>
35-
<jsonwebtoken.jjwt.version>0.12.5</jsonwebtoken.jjwt.version>
36-
<commons-io.version>2.15.0</commons-io.version>
34+
<fastjson.version>2.0.53</fastjson.version>
35+
<jsonwebtoken.jjwt.version>0.12.6</jsonwebtoken.jjwt.version>
36+
<commons-io.version>2.17.0</commons-io.version>
37+
<commons-lang3.version>3.17.0</commons-lang3.version>
3738
<commons-dbutils.version>1.8.1</commons-dbutils.version>
38-
<commons-text.version>1.11.0</commons-text.version>
39+
<commons-text.version>1.12.0</commons-text.version>
3940
<org.reflections.version>0.10.2</org.reflections.version>
4041
<perf4j.version>0.9.16</perf4j.version>
41-
<bcprov-jdk18on.version>1.77</bcprov-jdk18on.version>
42+
<bcprov-jdk18on.version>1.79</bcprov-jdk18on.version>
4243
<commons-crypto.version>1.2.0</commons-crypto.version>
4344
<snakeyaml.version>2.2</snakeyaml.version>
44-
<apache-groovy.version>4.0.15</apache-groovy.version>
45-
<h2.version>2.2.224</h2.version>
45+
<apache-groovy.version>4.0.24</apache-groovy.version>
46+
<h2.version>2.3.232</h2.version>
47+
<esotericsoftware.kryo.version>5.6.2</esotericsoftware.kryo.version>
4648
</properties>
4749

4850
<dependencies>
@@ -75,6 +77,12 @@
7577
<dependencyManagement>
7678
<dependencies>
7779

80+
<dependency>
81+
<groupId>com.esotericsoftware</groupId>
82+
<artifactId>kryo</artifactId>
83+
<version>${esotericsoftware.kryo.version}</version>
84+
</dependency>
85+
7886
<dependency>
7987
<groupId>com.h2database</groupId>
8088
<artifactId>h2</artifactId>
@@ -99,6 +107,18 @@
99107
<version>${commons-crypto.version}</version>
100108
</dependency>
101109

110+
<dependency>
111+
<groupId>commons-io</groupId>
112+
<artifactId>commons-io</artifactId>
113+
<version>${commons-io.version}</version>
114+
</dependency>
115+
116+
<dependency>
117+
<groupId>org.apache.commons</groupId>
118+
<artifactId>commons-lang3</artifactId>
119+
<version>${commons-lang3.version}</version>
120+
</dependency>
121+
102122
<dependency>
103123
<groupId>org.perf4j</groupId>
104124
<artifactId>perf4j</artifactId>
@@ -249,6 +269,7 @@
249269
</activation>
250270
<modules>
251271
<module>springboot-starter</module>
272+
<module>springboot-starter-flow</module>
252273
<module>springboot-starter-security</module>
253274
<module>springboot-starter-data-fast</module>
254275
</modules>
@@ -260,6 +281,7 @@
260281

261282
<modules>
262283
<module>springboot-starter</module>
284+
<module>springboot-starter-flow</module>
263285
<module>springboot-starter-security</module>
264286
<module>springboot-starter-data-fast</module>
265287
</modules>
@@ -289,7 +311,7 @@
289311
<plugin>
290312
<groupId>org.openclover</groupId>
291313
<artifactId>clover-maven-plugin</artifactId>
292-
<version>4.4.1</version>
314+
<version>4.5.2</version>
293315
<configuration>
294316
<generateHtml>true</generateHtml>
295317
<generateXml>true</generateXml>
@@ -309,6 +331,7 @@
309331

310332
<modules>
311333
<module>springboot-starter</module>
334+
<module>springboot-starter-flow</module>
312335
<module>springboot-starter-security</module>
313336
<module>springboot-starter-data-fast</module>
314337
</modules>

springboot-starter-data-fast/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>springboot-parent</artifactId>
77
<groupId>com.codingapi.springboot</groupId>
8-
<version>2.8.11</version>
8+
<version>2.9.0</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

springboot-starter-flow/README.md

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# springboot-starter-flow 流程引擎
2+
3+
流程引擎支持的功能需要包括:
4+
5+
支持的功能如下:
6+
7+
流程管理
8+
1. build模式的流程设计
9+
2. schema模式的流程设计
10+
3. 流程的启用与禁用
11+
4. 流程快照的存储
12+
13+
流程设计
14+
1. 支持自定义节点与节点关系
15+
2. 支持自定义节点的操作用户,可通过groovy脚本定义
16+
3. 支持流程消息标题的自定义能力,可通过groovy脚本定义
17+
4. 支持流程异常状态的自定义能力,可通过groovy脚本定义
18+
5. 提供流程操作过程中的事件,可以做业务定制与延伸
19+
20+
21+
流程能力
22+
1. 流程发起
23+
在设计完成以后并启用以后,可通过FlowService对象发起流程。
24+
2. 流程审批
25+
流程的审批支持同意与拒绝,以及审批意见的填写。
26+
3. 流程撤销
27+
流程的发起以后,在下一节点的流程待审批且未读之前可以撤销流程。
28+
4. 流程转办
29+
流程的审批过程中,可以将流程转办给其他人员审批。
30+
5. 流程委托
31+
可设置用户的委托人,委托人可以代理委托人审批流程。
32+
6. 流程催办
33+
流程的审批过程中,可以催办审批人员,催办将会发送催办事件消息。
34+
7. 流程查询
35+
可以查询流程的待办、已办、超时、延期、全部流程等数据。
36+
8. 流程干预
37+
设置流程管理员的人员,可以对流程进行干预,可以直接对其他人的流程进行审批。
38+
9. 流程延期
39+
流程的审批过程中,可以延期流程的审批时间。

springboot-starter-flow/pom.xml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
<parent>
7+
<artifactId>springboot-parent</artifactId>
8+
<groupId>com.codingapi.springboot</groupId>
9+
<version>2.9.0</version>
10+
</parent>
11+
12+
<name>springboot-starter-flow</name>
13+
<description>springboot-starter-flow project for Spring Boot</description>
14+
<artifactId>springboot-starter-flow</artifactId>
15+
16+
<properties>
17+
<java.version>8</java.version>
18+
</properties>
19+
20+
21+
<dependencies>
22+
23+
<dependency>
24+
<groupId>com.codingapi.springboot</groupId>
25+
<artifactId>springboot-starter</artifactId>
26+
</dependency>
27+
28+
<dependency>
29+
<groupId>com.esotericsoftware</groupId>
30+
<artifactId>kryo</artifactId>
31+
</dependency>
32+
33+
<dependency>
34+
<groupId>org.apache.groovy</groupId>
35+
<artifactId>groovy</artifactId>
36+
</dependency>
37+
38+
<dependency>
39+
<groupId>org.apache.groovy</groupId>
40+
<artifactId>groovy-json</artifactId>
41+
</dependency>
42+
43+
<dependency>
44+
<groupId>org.apache.groovy</groupId>
45+
<artifactId>groovy-xml</artifactId>
46+
</dependency>
47+
48+
</dependencies>
49+
50+
51+
52+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.codingapi.springboot.flow;
2+
3+
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
4+
import org.springframework.context.ApplicationContext;
5+
import org.springframework.context.annotation.Bean;
6+
import org.springframework.context.annotation.Configuration;
7+
8+
@Configuration
9+
public class FlowConfiguration {
10+
11+
@Bean
12+
@ConditionalOnMissingBean
13+
public FlowFrameworkRegister flowFrameworkRegister(ApplicationContext spring) {
14+
return new FlowFrameworkRegister(spring);
15+
}
16+
17+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.codingapi.springboot.flow;
2+
3+
import com.codingapi.springboot.flow.content.FlowSessionBeanProvider;
4+
import lombok.AllArgsConstructor;
5+
import org.springframework.beans.factory.InitializingBean;
6+
import org.springframework.context.ApplicationContext;
7+
8+
@AllArgsConstructor
9+
public class FlowFrameworkRegister implements InitializingBean {
10+
11+
private final ApplicationContext application;
12+
13+
@Override
14+
public void afterPropertiesSet() throws Exception {
15+
FlowSessionBeanProvider.getInstance().register(application);
16+
}
17+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
package com.codingapi.springboot.flow.bind;
2+
3+
import com.alibaba.fastjson.JSONObject;
4+
import lombok.AllArgsConstructor;
5+
import lombok.Getter;
6+
import lombok.Setter;
7+
8+
/**
9+
* 数据快照
10+
*/
11+
@Setter
12+
@Getter
13+
@AllArgsConstructor
14+
public class BindDataSnapshot {
15+
16+
/**
17+
* 数据快照id
18+
*/
19+
private long id;
20+
/**
21+
* 快照信息
22+
*/
23+
private String snapshot;
24+
/**
25+
* 创建时间
26+
*/
27+
private long createTime;
28+
29+
/**
30+
* 数据绑定类名称
31+
*/
32+
private String clazzName;
33+
34+
public BindDataSnapshot(long id,IBindData bindData) {
35+
if (bindData == null) {
36+
throw new IllegalArgumentException("bind data is null");
37+
}
38+
this.snapshot = bindData.toJsonSnapshot();
39+
this.clazzName = bindData.getClass().getName();
40+
this.createTime = System.currentTimeMillis();
41+
this.id = id;
42+
}
43+
44+
public BindDataSnapshot(IBindData bindData) {
45+
this(0,bindData);
46+
}
47+
48+
public IBindData toBindData() {
49+
try {
50+
return JSONObject.parseObject(snapshot, (Class<? extends IBindData>) Class.forName(clazzName));
51+
} catch (Exception e) {
52+
throw new IllegalArgumentException("bind data error");
53+
}
54+
}
55+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.codingapi.springboot.flow.bind;
2+
3+
import com.alibaba.fastjson.JSONObject;
4+
5+
/**
6+
* 数据绑定接口
7+
*/
8+
public interface IBindData {
9+
10+
/**
11+
* 数据快照
12+
*
13+
* @return 数据快照
14+
*/
15+
default String toJsonSnapshot() {
16+
return JSONObject.toJSONString(this);
17+
}
18+
}

0 commit comments

Comments
 (0)