-
Notifications
You must be signed in to change notification settings - Fork 56
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
3 changed files
with
81 additions
and
1 deletion.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
flowlong-spring-boot-starter/src/test/java/test/mysql/TestAutoClaimRole.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,37 @@ | ||
/* | ||
* Copyright 2023-2025 Licensed under the AGPL License | ||
*/ | ||
package test.mysql; | ||
|
||
import com.aizuda.bpm.engine.entity.FlwHisInstance; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
|
||
/** | ||
* 测试自动认领角色审批 | ||
*/ | ||
@Slf4j | ||
public class TestAutoClaimRole extends MysqlTest { | ||
|
||
@BeforeEach | ||
public void before() { | ||
processId = this.deployByResource("test/testAutoClaimRole.json", testCreator); | ||
} | ||
|
||
@Test | ||
public void test() { | ||
flowLongEngine.startInstanceById(processId, testCreator).ifPresent(instance -> { | ||
|
||
// 先认领角色(假设 test02 为项目经理) | ||
this.executeActiveTasks(instance.getId(), t -> this.flowLongEngine.taskService().claimRole(t.getId(), test2Creator)); | ||
|
||
// 执行任务 | ||
executeActiveTasks(instance.getId(), test2Creator); | ||
|
||
FlwHisInstance hisInstance = flowLongEngine.queryService().getHistInstance(instance.getId()); | ||
Assertions.assertEquals(1, hisInstance.getInstanceState()); | ||
}); | ||
} | ||
} |
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
33 changes: 33 additions & 0 deletions
33
flowlong-spring-boot-starter/src/test/resources/test/testAutoClaimRole.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,33 @@ | ||
{ | ||
"key": "testAutoClaimRole", | ||
"name": "测试自动认领角色审批", | ||
"nodeConfig": { | ||
"nodeName": "发起人", | ||
"nodeKey": "flk1725161262899", | ||
"type": 0, | ||
"childNode": { | ||
"nodeName": "审核人", | ||
"nodeKey": "flk1724860316169", | ||
"callProcess": null, | ||
"type": 1, | ||
"setType": 3, | ||
"nodeAssigneeList": [ | ||
{ | ||
"id": "100200", | ||
"name": "项目经理" | ||
} | ||
], | ||
"examineLevel": 1, | ||
"directorLevel": 1, | ||
"selectMode": 1, | ||
"termAuto": false, | ||
"term": 0, | ||
"termMode": 1, | ||
"examineMode": 2, | ||
"directorMode": 0, | ||
"typeOfApprove": 1, | ||
"remind": false, | ||
"approveSelf": 1 | ||
} | ||
} | ||
} |