Skip to content

feat: 流程设计页支持强制同步运行中实例 (#281) - #81

Merged
xlorne merged 1 commit into
devfrom
feature/issue-281-force-sync-workflow-runtime
Nov 17, 2026
Merged

xlorne merged 1 commit into
devfrom
feature/issue-281-force-sync-workflow-runtime

Conversation

@xlorne

@xlorne xlorne commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

背景

关联后端 issue/PR:codingapi/flow-engine#281 / codingapi/flow-engine#282

流程设计页需要提供「把最新设计强制同步到运行中实例」的入口:只同步勾选的实例,未勾选的实例继续使用原运行时快照;后端会校验结构一致性。

改动

  • 设计页头部(design-panel/layout/header.tsx)在「重置流程」后新增「强制同步」按钮;
  • 新增 components/design-sync-instance:弹窗内分页表格展示当前流程编码下的运行中实例(标题 / 发起人 / 创建时间),支持跨页多选,未选择时提示;
  • 新增接口封装(api/workflow.ts):
    • GET /api/query/record/running?workCode=&current=&pageSize=(分页查询运行中实例)
    • POST /api/cmd/record/forceSync(workCode + 选中的 processIds)
  • flow-core/message.ts 新增 DESIGN_FORCE_SYNC_SUCCESS / DESIGN_FORCE_SYNC_NO_SELECTED 文案;
  • 新增 selection.ts 与单元测试:选中实例按 processId 去重、过滤空值。

交互说明

弹窗顶部提示:同步使用已保存的最新设计;仅勾选实例改用新配置;新增/删除节点、调整节点顺序、删除已有按钮时后端会拒绝同步并返回原因。

验证

  • packages/flow-design:npx rstest run → 14 个测试文件、43 个用例全部通过(含新增 4 例);
  • packages/flow-design:npx tsc -p tsconfig.json --noEmit → 0 error;
  • rslib build 在本地被 IDE 的 node-safe-delete shim 拦截(--file parameter is required,dev 分支同样复现),未能完成打包验证。

- 设计页头部新增「强制同步」入口,弹窗分页展示当前流程编码的运行中实例,支持跨页多选;
- 新增运行中实例查询与强制同步接口封装(GET /api/query/record/running、
  POST /api/cmd/record/forceSync);
- 补充同步成功、未选择实例的提示文案;
- 新增选择结果去重与空值过滤单元测试。

Closes #281
@xlorne
xlorne merged commit 913b56a into dev Nov 17, 2026
1 check passed
@xlorne
xlorne deleted the feature/issue-281-force-sync-workflow-runtime branch November 17, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant