@mldong/jeeflow 1.8.7 → 1.8.8
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/engine.d.ts +2 -0
- package/dist/engine.js +4 -0
- package/dist/facade.d.ts +4 -1
- package/dist/facade.js +33 -13
- package/package.json +1 -1
package/dist/engine.d.ts
CHANGED
|
@@ -53,6 +53,8 @@ export declare class EngineImpl implements Engine {
|
|
|
53
53
|
private resolveActors;
|
|
54
54
|
private isAllowed;
|
|
55
55
|
private addUserInfo;
|
|
56
|
+
/** 用户提供者访问(issue 41 补强:nodeProgress 姓名解析用) */
|
|
57
|
+
getUserProvider(): UserProvider | undefined;
|
|
56
58
|
private nextId;
|
|
57
59
|
}
|
|
58
60
|
/** 会签判定(issue 42,对齐 Java ProcessTaskPerformTypeEnum.codeOf):
|
package/dist/engine.js
CHANGED
|
@@ -469,6 +469,10 @@ export class EngineImpl {
|
|
|
469
469
|
if (u.postName)
|
|
470
470
|
vars[KeyPostName] = u.postName;
|
|
471
471
|
}
|
|
472
|
+
/** 用户提供者访问(issue 41 补强:nodeProgress 姓名解析用) */
|
|
473
|
+
getUserProvider() {
|
|
474
|
+
return this.userProv;
|
|
475
|
+
}
|
|
472
476
|
nextId() {
|
|
473
477
|
if (this.idGen)
|
|
474
478
|
return this.idGen.nextId();
|
package/dist/facade.d.ts
CHANGED
|
@@ -48,8 +48,11 @@ export declare class JeeflowFacade {
|
|
|
48
48
|
private highLight;
|
|
49
49
|
/** 节点成员进度(issue 41,对齐 boot3 highLight):按任务状态 + 会签变量组装
|
|
50
50
|
* nodeProgress——会签节点带 type(PARALLEL/SEQUENTIAL),成员 done/active 标记;
|
|
51
|
-
* 动态参与人节点(无静态 actorIds)不返回;name
|
|
51
|
+
* 动态参与人节点(无静态 actorIds)不返回;name 走引擎 UserProvider SPI 解析
|
|
52
|
+
* realName(未注入/查不到时缺省空串,前端降级显示 id) */
|
|
52
53
|
private buildNodeProgress;
|
|
54
|
+
/** 成员姓名解析(issue 43/E15):UserProvider SPI 并行批量解析 realName,查不到缺省空串 */
|
|
55
|
+
private resolveMemberNames;
|
|
53
56
|
private collectPath;
|
|
54
57
|
/** 决策输出边表达式求值(args = 实例变量 + 决策节点前置任务变量) */
|
|
55
58
|
private evalDecisionExpr;
|
package/dist/facade.js
CHANGED
|
@@ -607,7 +607,7 @@ export class JeeflowFacade {
|
|
|
607
607
|
if (def) {
|
|
608
608
|
try {
|
|
609
609
|
const flow = JSON.parse(toStr(def.content));
|
|
610
|
-
nodeProgress = this.buildNodeProgress(flow, his);
|
|
610
|
+
nodeProgress = await this.buildNodeProgress(flow, his);
|
|
611
611
|
await this.collectPath(flow, 'start', '', active, history, edges, new Set(), inst.variables ?? {}, his);
|
|
612
612
|
}
|
|
613
613
|
catch { /* ignore */ }
|
|
@@ -616,8 +616,9 @@ export class JeeflowFacade {
|
|
|
616
616
|
}
|
|
617
617
|
/** 节点成员进度(issue 41,对齐 boot3 highLight):按任务状态 + 会签变量组装
|
|
618
618
|
* nodeProgress——会签节点带 type(PARALLEL/SEQUENTIAL),成员 done/active 标记;
|
|
619
|
-
* 动态参与人节点(无静态 actorIds)不返回;name
|
|
620
|
-
|
|
619
|
+
* 动态参与人节点(无静态 actorIds)不返回;name 走引擎 UserProvider SPI 解析
|
|
620
|
+
* realName(未注入/查不到时缺省空串,前端降级显示 id) */
|
|
621
|
+
async buildNodeProgress(flow, his) {
|
|
621
622
|
const progress = {};
|
|
622
623
|
const names = [...new Set(his.map(t => t.taskName))];
|
|
623
624
|
for (const name of names) {
|
|
@@ -641,16 +642,15 @@ export class JeeflowFacade {
|
|
|
641
642
|
// 会签判定:定义节点属性(引擎创建任务时 performType 未落任务表,取模型为准)
|
|
642
643
|
const nodeProps = node?.properties ?? {};
|
|
643
644
|
const isCs = isCountersign(nodeProps.performType) || nodeProps.countersignType != null;
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
};
|
|
645
|
+
// 姓名走 UserProvider SPI 解析(未注入/查不到缺省空串),done/active 按任务状态标记
|
|
646
|
+
const memberList = await this.resolveMemberNames(members);
|
|
647
|
+
for (const m of memberList) {
|
|
648
|
+
if (doneSet.has(m.id))
|
|
649
|
+
m.done = true;
|
|
650
|
+
else if (m.id === activeActor)
|
|
651
|
+
m.active = true;
|
|
652
|
+
}
|
|
653
|
+
const item = { members: memberList };
|
|
654
654
|
if (isCs && nodeProps.countersignType) {
|
|
655
655
|
item.type = nodeProps.countersignType;
|
|
656
656
|
}
|
|
@@ -658,6 +658,26 @@ export class JeeflowFacade {
|
|
|
658
658
|
}
|
|
659
659
|
return progress;
|
|
660
660
|
}
|
|
661
|
+
/** 成员姓名解析(issue 43/E15):UserProvider SPI 并行批量解析 realName,查不到缺省空串 */
|
|
662
|
+
async resolveMemberNames(ids) {
|
|
663
|
+
const userProv = this.engine.getUserProvider();
|
|
664
|
+
const nameMap = {};
|
|
665
|
+
if (userProv) {
|
|
666
|
+
const results = await Promise.all(ids.map(async (id) => {
|
|
667
|
+
try {
|
|
668
|
+
const u = await userProv.getUser(id);
|
|
669
|
+
return [id, u?.realName ?? ''];
|
|
670
|
+
}
|
|
671
|
+
catch {
|
|
672
|
+
return [id, '']; // 单用户失败不影响其余
|
|
673
|
+
}
|
|
674
|
+
}));
|
|
675
|
+
for (const [id, name] of results)
|
|
676
|
+
if (name)
|
|
677
|
+
nameMap[id] = name;
|
|
678
|
+
}
|
|
679
|
+
return ids.map(id => ({ id, name: nameMap[id] ?? '' }));
|
|
680
|
+
}
|
|
661
681
|
async collectPath(flow, nodeId, edgeName, active, history, edges, visited, vars, historyTasks) {
|
|
662
682
|
if (visited.has(nodeId))
|
|
663
683
|
return;
|