Repository navigation
fix: 退回候选节点改为基于执行历史并收紧退回校验 (#270) - #271
Merged
Merged
Conversation
- FlowContent 新增 backNodes:只包含当前记录真实执行过的历史节点, 倒序去重保证"最近经过的节点"优先(停留在 C 时为 B、A), 且没有候选时不向展示按钮集合下发 RETURN,修正开始节点 "退回按钮可点但提交必然失败"的错误交互(issue #270) - BackNodeHelper 新增 historyBackNodes,按记录 id 正序倒序遍历历史记录, 同一节点多次执行只保留最近一次,未执行的分支节点天然被排除 - ActionManager 收紧 RETURN 校验:开始节点不支持退回; 退回目标必须存在于当前记录的历史执行链(并行/条件分支中 "结构上不是下游但从未执行"的节点同样被拒绝) - FlowStateException 新增 nodeNotSupportReturn / backNodeNotInHistory - BaseAction.show 兼容缺少 display 配置的旧流程数据,避免详情接口空指针 - 新增 FlowIssue270ReturnNodeControlTest(历史候选、最近优先、未执行分支拒绝、开始节点) Closes #270
Closed
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## dev #271 +/- ##
============================================
+ Coverage 74.58% 74.76% +0.18%
- Complexity 1871 1895 +24
============================================
Files 238 238
Lines 7670 7717 +47
Branches 895 903 +8
============================================
+ Hits 5721 5770 +49
+ Misses 1510 1502 -8
- Partials 439 445 +6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
退回(RETURN)候选节点由前端从流程定义的全量节点(
FlowContent.nodes)中截取到当前节点为止,存在三个问题(issue #270):ActionManager.verifySession()只校验"非结束 / 非当前 / 非下游 / 类型白名单",并行、条件分支中"结构上不是下游但从未执行"的节点仍可退回;改动
FlowContent新增backNodes:只包含当前记录真实执行过的历史节点,倒序去重保证最近优先;没有候选时不向展示按钮集合下发RETURN(nodes字段保持不变)。BackNodeHelper新增historyBackNodes(...):按记录 id 正序倒序遍历历史记录,同一节点多次执行只保留最近一次,未执行的分支节点天然被排除。ActionManager收紧RETURN校验:开始节点不支持退回;退回目标必须存在于当前记录的历史执行链。FlowStateException新增nodeNotSupportReturn/backNodeNotInHistory。BaseAction.show兼容缺少display配置的旧流程数据,避免详情接口空指针。FlowIssue270ReturnNodeControlTest:历史候选与最近优先、未执行分支拒绝、开始节点不展示退回。验证
./mvnw -o -pl flow-engine-framework test:375 个用例全部通过(含新增 3 个)./mvnw -o install -DskipTests:全模块编译通过Closes #270