@mldong/jeeflow 1.8.42 → 1.8.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/facade.js CHANGED
@@ -436,10 +436,15 @@ export class JeeflowFacade {
436
436
  // (`String(err)`/`err.toString()` 都不含 cause,见 flow() 顶层 catch 的注释)。
437
437
  throw new Error('读取流程定义 JSON 失败', { cause: e });
438
438
  }
439
+ // audit8 R5/spec 06:redeploy 是原地替换内容——先读再写保留原 state/version
440
+ // (硬编码 state:1/version:0 会把停用定义复活、把原版本号打回 0)
441
+ const old = await this.repo.findDefineById(defineId);
439
442
  await this.repo.updateDefine({
440
443
  id: defineId, name: flow?.name ?? '', displayName: flow?.displayName ?? '',
441
- type: flow?.type ?? 'approval', state: 1, content, version: 0,
442
- createTime: new Date(), createUser: '', updateTime: new Date(),
444
+ type: flow?.type ?? 'approval', content,
445
+ state: old?.state ?? 1, version: old?.version ?? 1,
446
+ createTime: old?.createTime ?? new Date(), createUser: old?.createUser ?? '',
447
+ updateTime: new Date(),
443
448
  updateUser: String(args.operator ?? 'system'),
444
449
  });
445
450
  }
@@ -927,7 +932,13 @@ export class JeeflowFacade {
927
932
  nodeProgress = await this.buildNodeProgress(flow, his);
928
933
  await this.collectPath(flow, 'start', active, history, edges, new Set(), inst.variables ?? {}, his);
929
934
  }
930
- catch { /* ignore */ }
935
+ catch (e) {
936
+ // issues/162(口径=保留降级面+落一条可诊断日志,形状照 jeeflow-go v1.8.43 那枚):
937
+ // 坏定义只降级模型补全腿(边集/节点补全/nodeProgress 留空,实例与任务行不受影响、
938
+ // 对外仍 code=0),但不再一声不吭地吞掉——这条静默通道先后藏住过 156(php)与
939
+ // 160(python)两个真分叉。日志三件齐(实例号/定义号/原因),缺一件等于没落。
940
+ console.error(`[jeeflow] WARN highLight 模型补全腿解码失败,边集/节点补全/nodeProgress 已降级(实例与任务行不受影响): instanceId=${instanceId}, defineId=${inst.defineId}, err=${e}`);
941
+ }
931
942
  }
932
943
  return { activeNodeNames: active, historyNodeNames: history, historyEdgeNames: edges, nodeProgress };
933
944
  }
@@ -1090,7 +1101,12 @@ export class JeeflowFacade {
1090
1101
  }
1091
1102
  async updateCCStatus(args) {
1092
1103
  const instanceId = toId(args.processInstanceId);
1093
- const operator = operatorArg(args);
1104
+ // issues/142 B 批(spec 06 §2.11 写点表第四行「operator 入参归一后再比」漏收口)+ issues/172:
1105
+ // 逐字对齐 java `normalizeActor(operatorArg(args))`——`operatorArg` 只判空不落 trim
1106
+ // (`s.trim() !== '' ? s : 'user1'` 交出的仍是原串,`" 8601 "` 原样过关),门面这一层
1107
+ // 再补 `spi.normalizeActorValue`(trim;哨兵 `"0"` 是非空串照收),然后才交仓储做第二道兜底。
1108
+ // 两仓第二层归一(memory.ts / jdbc/shared.ts)会把缺的这一层掩住,故门面腿单点 spy 钉它。
1109
+ const operator = normalizeActorValue(operatorArg(args));
1094
1110
  await this.repo.updateCcStatus(instanceId, operator);
1095
1111
  }
1096
1112
  // ccList 我的抄送分页(v1.3.0):operator 作为抄送人过滤
@@ -150,11 +150,13 @@ export class JdbcRepository {
150
150
  }
151
151
  }
152
152
  async updateDefine(define) {
153
+ // audit8 R5:update 路径零值不再兜底成 1——0 是合法取值(停用态/版本 0),
154
+ // `|| 1` 会把停用定义复活、把原版本号打回 1;缺省(null/undefined)才回落 1
153
155
  const conn = await this.c();
154
156
  try {
155
157
  await conn.execute(this.sql('UPDATE wf_process_define SET name=?, display_name=?, type=?, state=?, content=?, ' +
156
- 'version=?, update_time=?, update_user=? WHERE id=?'), [define.name, define.displayName, define.type, define.state || 1,
157
- define.content, define.version || 1, new Date(), define.updateUser, define.id]);
158
+ 'version=?, update_time=?, update_user=? WHERE id=?'), [define.name, define.displayName, define.type, define.state ?? 1,
159
+ define.content, define.version ?? 1, new Date(), define.updateUser, define.id]);
158
160
  }
159
161
  finally {
160
162
  await this.done(conn);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mldong/jeeflow",
3
- "version": "1.8.42",
3
+ "version": "1.8.44",
4
4
  "description": "jeeflow workflow engine — Node.js / TypeScript implementation",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",