zhengwr ac9812e0a1 P3-4: platform-flow-gateway 单体侧流程网关(Flowable REST 客户端 + 待办聚合 + 事件回写)
- FlowableClient:RestClient 调 flowable-service(eip4.flow.base-url,默认 8089);
  超时/重试(仅连接级)/熔断降级——引擎不可达 → 503 语义(非 500 堆栈),业务错 4xx/5xx 透传。
- 待办聚合(经 platform-app 暴露):GET /api/todo(JWT userId+roles 候选组)、GET /api/done、
  POST /api/task/{id}/complete、POST /api/process/start;聚合层把 Flowable 任务与业务摘要连接
  (businessKey → SYS_DATASTATUS.tablename → loadPOJO 只读标题字段;业务摘要数据源客户库只读,
  拼不到优雅降级为仅流程字段)。
- 事件回写:complete 后按老系统 ProcessCoreServiceImpl.passProcess + WfChangeStatus 语义更新
  SYS_DATASTATUS(结束→STATUS_PASS=3,未结束→STATUS_PROCESSING=2,守卫 oldstatus<status 单调递增;
  upsert UPDATE 命中或 0 行 INSERT);本地库验证,客户库只读。
- flowable-service 契约增强:Flowable 6.8.1 TaskInfo 无 getBusinessKey(),todo/done 出参由查询侧
  从实例补全 businessKey;新增 GET /api/flow/process/{id} 查实例(供办理后判定流程是否结束)。

验证(8089 连本地 eip4flow+客户库只读,8090 连本地 eip4m0,8084 未动):
- 待办聚合数=直查一致:真实用户 829cdcca /api/todo=4 == 8089 直查 count=4。
- 业务摘要拼接正确 + 优雅降级共存:命中条目拼到 SYS_USERGROUP 标题字段,同列表 3 条无映射降级为仅流程字段。
- 熔断:kill 8089 后 /api/todo 返回 503 干净 JSON,platform-app 进程存活不崩。
- 事件回写:本地构造 datastatus=1,经 8090 complete(流程结束)回写为 3;引擎侧实例确结束。
- 21 单测(客户端重试/降级、聚合拼接、回写守卫)+ 全模块 mvn test + ArchUnit 绿。

坑入手册 §6.8(TaskInfo 无 businessKey)/§6.9(503 熔断 + 回写守卫 + SYS_DATASTATUS 无主键)。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 15:12:03 +08:00

eip4-platform

EIP4 平台正式工程(路线 A'):双层制模块化单体——保真层供奉,现代层生长。 架构依据:docs/架构设计.md(必读);坑位台账:docs/迁移手册.md。

模块

模块 职责 纪律
platform-legacy-core 保真层:移植引擎原样,包名 com.dsasp.* 不动 不重写、不改包名,与 framework 源码 diff 最小;对拍=完成定义
platform-metadata 现代层 REST API/DTO/OpenAPI(com.eip4.*) 新代码须评审+单测
platform-auth 数据权限真实现(C2 已替换桩)+ P2 组织/权限
platform-converter 模板转换器(P4) 可独立 CLI 跑批
platform-flow-gateway P3 占位:Flowable 网关
platform-ai P5 占位:MCP Server
platform-parity C1 对拍框架:录制/重放/RowDiff/自对拍 CLI P1 一级交付物
platform-app Boot 启动器,组装全部模块 ArchUnit 规则在此模块测试里

边界纪律(ArchUnit 强制):com.eip4.* 可调 com.dsasp.*,反向禁止。

常用命令

export JAVA_HOME=/opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home
mvn test                                                    # 全模块测试(含 ArchUnit)
mvn spring-boot:run -pl platform-app -Dspring-boot.run.profiles=local   # 本地库(5433/eip4m0)
mvn spring-boot:run -pl platform-app                        # 客户库副本(5435,只读使用)

# 对拍(详见 platform-parity/C1实测报告.md)
CP="platform-parity/target/classes:$(mvn -q org.apache.maven.plugins:maven-dependency-plugin:build-classpath -pl platform-parity -Dmdep.outputFile=/dev/stdout -o | tail -1)"
java -cp "$CP" com.eip4.platform.parity.selfcheck.ParityCli --all            # 本地全量
java -cp "$CP" com.eip4.platform.parity.selfcheck.ParityCli --privilege      # C2 数据权限样本
# 客户库:--jdbc=... --user=... --pass=... [--sampleRows=N --perPage=N]

tools/

  • tools/s3_rewriter/ — C4 S3 脚本正则改写器(真实库自动化率 81.2%,P4 facade 扩容种子);run_eval.py --from-db 连客户库复测
  • tools/loadtest/load_p95.py — C3 压测 harness(零依赖)

本地自举

空库重建:platform-parity/src/main/resources/bootstrap/bootstrap-sys.sql + bootstrap-privilege.sql, 再 ParityCli --seed --all 建 21 个测试实体并灌数。

Description
No description provided
Readme 23 MiB
Languages
Java 77.7%
Groovy 17%
Python 3.8%
Shell 1.3%
JavaScript 0.1%