forked from aizuda/flowlong
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
129 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
flowlong-spring-boot-starter/src/test/java/test/mysql/TestSubProcessEnd.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright 2023-2025 Licensed under the AGPL License | ||
*/ | ||
package test.mysql; | ||
|
||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
|
||
/** | ||
* 测试子流程 | ||
* | ||
* @author xdg | ||
*/ | ||
public class TestSubProcessEnd extends MysqlTest { | ||
|
||
@BeforeEach | ||
public void before() { | ||
processId = this.deployByResource("test/subProcessEnd.json", testCreator); | ||
|
||
// 部署子流程 | ||
this.deployByResource("test/workHandover.json", testCreator); | ||
} | ||
|
||
@Test | ||
public void test() { | ||
// 发起,执行条件路由 | ||
flowLongEngine.startInstanceById(processId, testCreator, "这里是关联业务KEY").ifPresent(instance -> { | ||
|
||
// 人事审批 | ||
this.executeActiveTasks(instance.getId(), testCreator); | ||
|
||
// 找到子流程并执行【接收工作任务】完成启动父流程执行结束 | ||
flowLongEngine.queryService().getHisTasksByInstanceId(instance.getId()).ifPresent(flwHisTasks -> flwHisTasks.forEach(flwHisTask -> { | ||
if (null != flwHisTask.getCallInstanceId()) { | ||
this.executeActiveTasks(flwHisTask.getCallInstanceId(), test3Creator); | ||
} | ||
})); | ||
}); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
flowlong-spring-boot-starter/src/test/resources/test/subProcessEnd.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"key": "subProcessEnd", | ||
"name": "请假审批", | ||
"nodeConfig": { | ||
"nodeName": "发起人", | ||
"nodeKey": "k001", | ||
"type": 0, | ||
"nodeAssigneeList": [], | ||
"childNode": { | ||
"nodeName": "人事审批", | ||
"nodeKey": "k002", | ||
"type": 1, | ||
"setType": 1, | ||
"nodeAssigneeList": [ | ||
{ | ||
"tenantId": "1000", | ||
"id": "test001", | ||
"name": "魏磊" | ||
} | ||
], | ||
"examineLevel": 1, | ||
"directorLevel": 1, | ||
"selectMode": 1, | ||
"termAuto": false, | ||
"term": 0, | ||
"termMode": 1, | ||
"examineMode": 1, | ||
"directorMode": 0, | ||
"childNode": { | ||
"nodeName": "工作交接", | ||
"nodeKey": "k007", | ||
"type": 5, | ||
"callProcess": "workHandover" | ||
} | ||
} | ||
} | ||
} |