@mldong/jeeflow 1.8.55 → 1.8.58
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.js +7 -0
- package/dist/facade.d.ts +5 -0
- package/dist/facade.js +35 -9
- package/package.json +7 -3
package/dist/engine.js
CHANGED
|
@@ -1260,6 +1260,13 @@ function mergeExecIntoInstance(base, execVars) {
|
|
|
1260
1260
|
for (const [k, v] of Object.entries(execVars)) {
|
|
1261
1261
|
if (k.startsWith('u_'))
|
|
1262
1262
|
continue;
|
|
1263
|
+
// isFirstTaskNode 同是**行级**建单标记(建单不变量②):随共享执行池进 execVars,不挡就
|
|
1264
|
+
// 逐节点漂移写进实例变量,把「最近办结那行」的标记透成实例级——issues/240 实测两向同错
|
|
1265
|
+
// (审批行被标成申请节点、退回后申请行被标成非申请节点)。go mergeExecIntoInstance 同款
|
|
1266
|
+
// 挡法(issues/121 P1 已落);submitType 不在此列:java ProcessInstance.completeTask 的
|
|
1267
|
+
// variables.putAll(args) 同样把它落进实例列。
|
|
1268
|
+
if (k === 'isFirstTaskNode')
|
|
1269
|
+
continue;
|
|
1263
1270
|
// 「退回修改、重提直返」的两枚保留键(spec 04)是**行级**引擎内部状态:_branchCtx 是分支
|
|
1264
1271
|
// 归属栈、_reapplyContext 只出现在申请待办上,实例层没有对应语义。若不挡,任务办结时它们
|
|
1265
1272
|
// 会随执行上下文写进实例变量并落库 ⇒ 每个出口(任务行 instanceExt/实例行 ext)都透出内部
|
package/dist/facade.d.ts
CHANGED
|
@@ -103,6 +103,11 @@ export declare class JeeflowFacade {
|
|
|
103
103
|
/** 成员姓名解析(issue 43/E15):UserProvider SPI 并行批量解析 realName,查不到缺省空串 */
|
|
104
104
|
private resolveMemberNames;
|
|
105
105
|
private collectPath;
|
|
106
|
+
/** issues/241:决策节点选边——先按表达式求值(issues/06/153 旧口径),
|
|
107
|
+
* **当表达式给出的非空结果与任务行佐证相矛盾时,以任务行为准**;求值失败/零命中时保持
|
|
108
|
+
* 既有降级面(issues/164/201 的口径不被本规则改写)。
|
|
109
|
+
* 直返单重提后实例变量已改,按当前值重放会选出没走过的分支;走过的分支在任务表里有行。 */
|
|
110
|
+
private selectDecisionEdges;
|
|
106
111
|
/** 决策输出边表达式求值(args = 实例变量 + 决策节点前置任务变量)
|
|
107
112
|
*
|
|
108
113
|
* instanceId/defineId 只作日志归因用(issues/201)——求值失败那条腿不许再一声不吭。 */
|
package/dist/facade.js
CHANGED
|
@@ -1037,15 +1037,13 @@ export class JeeflowFacade {
|
|
|
1037
1037
|
return;
|
|
1038
1038
|
visited.add(nodeId);
|
|
1039
1039
|
const src = (flow.nodes ?? []).find((n) => n.id === nodeId);
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
continue;
|
|
1048
|
-
}
|
|
1040
|
+
let outs = (flow.edges ?? []).filter((e) => e.sourceNodeId === nodeId);
|
|
1041
|
+
// issues/241:决策节点选边以任务行佐证为准(活跃目标 → 有任务行的目标),
|
|
1042
|
+
// 一条佐证都没有才回落到按当前实例变量求值
|
|
1043
|
+
if (src?.type === 'snaker:decision') {
|
|
1044
|
+
outs = await this.selectDecisionEdges(flow, src, outs, active, vars, historyTasks, instanceId, defineId);
|
|
1045
|
+
}
|
|
1046
|
+
for (const e of outs) {
|
|
1049
1047
|
if (e.id && !edges.includes(e.id))
|
|
1050
1048
|
edges.push(e.id);
|
|
1051
1049
|
const target = (flow.nodes ?? []).find((n) => n.id === e.targetNodeId);
|
|
@@ -1059,6 +1057,34 @@ export class JeeflowFacade {
|
|
|
1059
1057
|
await this.collectPath(flow, tid, active, history, edges, visited, vars, historyTasks, instanceId, defineId);
|
|
1060
1058
|
}
|
|
1061
1059
|
}
|
|
1060
|
+
/** issues/241:决策节点选边——先按表达式求值(issues/06/153 旧口径),
|
|
1061
|
+
* **当表达式给出的非空结果与任务行佐证相矛盾时,以任务行为准**;求值失败/零命中时保持
|
|
1062
|
+
* 既有降级面(issues/164/201 的口径不被本规则改写)。
|
|
1063
|
+
* 直返单重提后实例变量已改,按当前值重放会选出没走过的分支;走过的分支在任务表里有行。 */
|
|
1064
|
+
async selectDecisionEdges(flow, decision, outs, active, vars, historyTasks, instanceId, defineId) {
|
|
1065
|
+
const selected = [];
|
|
1066
|
+
for (const e of outs) {
|
|
1067
|
+
const expr = e.properties?.expr;
|
|
1068
|
+
if (!expr || await this.evalDecisionExpr(flow, decision, expr, vars, historyTasks, instanceId, defineId)) {
|
|
1069
|
+
selected.push(e);
|
|
1070
|
+
}
|
|
1071
|
+
}
|
|
1072
|
+
if (selected.length === 0)
|
|
1073
|
+
return selected;
|
|
1074
|
+
const taskNames = new Set((historyTasks ?? []).map((t) => t.taskName));
|
|
1075
|
+
for (const e of selected) {
|
|
1076
|
+
if (active.includes(e.targetNodeId) || taskNames.has(e.targetNodeId)) {
|
|
1077
|
+
return selected; // 表达式与执行事实一致,维持原口径
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
const activeHits = outs.filter(e => active.includes(e.targetNodeId));
|
|
1081
|
+
if (activeHits.length > 0)
|
|
1082
|
+
return activeHits;
|
|
1083
|
+
const evidenced = outs.filter(e => taskNames.has(e.targetNodeId));
|
|
1084
|
+
if (evidenced.length > 0)
|
|
1085
|
+
return evidenced;
|
|
1086
|
+
return selected;
|
|
1087
|
+
}
|
|
1062
1088
|
/** 决策输出边表达式求值(args = 实例变量 + 决策节点前置任务变量)
|
|
1063
1089
|
*
|
|
1064
1090
|
* instanceId/defineId 只作日志归因用(issues/201)——求值失败那条腿不许再一声不吭。 */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mldong/jeeflow",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.58",
|
|
4
4
|
"description": "jeeflow workflow engine — Node.js / TypeScript implementation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -46,5 +46,9 @@
|
|
|
46
46
|
"dist",
|
|
47
47
|
"LICENSE",
|
|
48
48
|
"README.md"
|
|
49
|
-
]
|
|
50
|
-
|
|
49
|
+
],
|
|
50
|
+
"repository": {
|
|
51
|
+
"type": "git",
|
|
52
|
+
"url": "git+https://github.com/mldong/jeeflow-node.git"
|
|
53
|
+
}
|
|
54
|
+
}
|