Skip to content

feat: 默认取人脚本返回 OperatorKey + 身份文档补齐 (#303) - #305

Merged
xlorne merged 1 commit into
feature/issue-303-operator-script-resolverfrom
feature/issue-303-default-script
Dec 3, 2026
Merged

xlorne merged 1 commit into
feature/issue-303-operator-script-resolverfrom
feature/issue-303-default-script

Conversation

@xlorne

@xlorne xlorne commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

背景

issue #303 第二部分:在 #304 提供解析器与脚本 API 之后,把系统默认取人脚本从「返回人员 id」升级为「返回 OperatorKey」,并同步文档。

改动

后端

  • ScriptDefaultConstants.SCRIPT_DEFAULT_OPERATOR_LOAD:
// @SCRIPT_TITLE 流程创建者
// @SCRIPT_META {"type":"creator"}
def run(request){
    return [request.getCreatedOperatorKey()]
}

新建节点的「流程创建者」审批人将携带发起时的身份,不再退化为默认身份。

  • docs/Integration/operator-identity.md
    • §3.4 重写:读取身份 / 产出参与人的三种返回形态(含是否回查)、默认模板、OperatorKey 构造 API 一览、按身份取人示例、复用上一节点审批人示例;
    • §5 兼容性表补「默认取人脚本」一行,并说明升级前后实例身份可能不同(不做迁移、不自动改写存量脚本)。

前端(codingapi/flow-frontend feature/issue-303-default-script @ 848b149)

  • default-script.ts:SCRIPT_DEFAULT_OPERATOR_LOAD 改为 request.getCreatedOperatorKey()(设计器「指定人员 → 流程创建者」新建的脚本直接带身份);
  • varibale.ts:变量列表补 getCreatedOperatorKey / getCurrentOperatorKey / getSubmitOperatorKey / findPreviousNodeOperators;
  • 未改 current-workflow-presenter.ts:「子流程发起人」选项产出的是人员 id 参数(不是取人脚本返回值),改成 Key 会破坏后端对子流程发起人的解析,属于另一条链路。

验证

  • 后端 ./mvnw -pl flow-engine-framework test:515 例通过(默认脚本变更无回归);
  • 前端 npx rstest run --root packages/flow-design:49 例通过;pnpm -F @coding-flow/flow-design build:287 文件生成成功。

行为变化(需知悉)

默认模板改为 OperatorKey 后,创建者节点的审批身份 = 发起时的身份。已启用多身份、且一直用默认模板的业务,同一流程在升级前后发起的实例身份会不同;存量流程定义中的脚本文本不会被自动改写。

依赖

基于 feature/issue-303-operator-script-resolver(#304),需先合并 #304。

Closes #303

- ScriptDefaultConstants 默认取人脚本改为 [request.getCreatedOperatorKey()]
- operator-identity.md §3.4 补齐三种返回形态、默认模板、Key 构造 API 与
  findPreviousNodeOperators 用法;§5 补默认脚本升级的兼容说明

Closes #303
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