@stalfh233/omc-cli 0.6.80 → 0.6.81
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/coverage/m1-coverage-manifest-v1.json +2 -0
- package/dist/capability-overview.js +2 -2
- package/dist/lanes/businessrule-contract.js +1 -1
- package/dist/lanes/businessrule.js +161 -18
- package/dist/lanes/workflow-contract.js +8 -0
- package/dist/lanes/workflow-coverage.js +1 -0
- package/dist/lanes/workflow.js +123 -0
- package/dist/read-shapes.js +4 -0
- package/dist/tool-search.js +3 -0
- package/package.json +3 -3
- package/skills/omc-capabilities.md +2 -2
|
@@ -333,6 +333,7 @@
|
|
|
333
333
|
],
|
|
334
334
|
"lane": "W7-S29-greenfield",
|
|
335
335
|
"tools": [
|
|
336
|
+
"workflow.list",
|
|
336
337
|
"workflow.get_draft",
|
|
337
338
|
"workflow.get_published",
|
|
338
339
|
"workflow.create",
|
|
@@ -368,6 +369,7 @@
|
|
|
368
369
|
"org.user.departments"
|
|
369
370
|
],
|
|
370
371
|
"scopes": [
|
|
372
|
+
"application workflow inventory (model-indexed)",
|
|
371
373
|
"greenfield workflow authoring",
|
|
372
374
|
"workflow node form-button checkboxes",
|
|
373
375
|
"workflow start permission (who may originate)",
|
|
@@ -141,8 +141,8 @@ const SURFACES = [
|
|
|
141
141
|
id: "workflow",
|
|
142
142
|
title: "流程模板 + 组织与权限",
|
|
143
143
|
lane: LANES.workflow,
|
|
144
|
-
description: "流程模板生命周期:get_draft/get_published、create、update、publish、bindRule、delete、workitem.list。**含组织/部门/角色/权限范围(org.* 工具)**:部门树、角色组/角色、用户搜索、成员与管理范围(userScope)——流程参与人/可见性的候选来源。",
|
|
145
|
-
operations: ["create", "update", "publish", "bindRule", "delete"],
|
|
144
|
+
description: "流程模板生命周期:workflow.list(应用内流程清单)、get_draft/get_published、create、update、publish、bindRule、delete、workitem.list。**含组织/部门/角色/权限范围(org.* 工具)**:部门树、角色组/角色、用户搜索、成员与管理范围(userScope)——流程参与人/可见性的候选来源。",
|
|
145
|
+
operations: ["list", "create", "update", "publish", "bindRule", "delete"],
|
|
146
146
|
requires: ["model"],
|
|
147
147
|
intent: { level: "partial", note: "声明式支持 workflow.create/update/publish 与 bindRules(事件处理器规则绑定,merge/ensure-present);runtime workitem(提交/审批)仍走 escape hatch。" },
|
|
148
148
|
notes: "greenfield 首版;publish/bindRule 不得在 ValidateMessage[] 拒绝时报告成功。组织读写(org.*)挂在本能力下,别名 org/organization/organisation。r64 起含**流程运维三件套**(workflow.transfer 换审批人 / workflow.activate 跳转节点 / workflow.finish 手动结束·end 规则照常触发)——测试提速定位:运维过的实例权限语义已变,不能用于真实流程/权限验证。",
|
|
@@ -166,7 +166,7 @@ export const BUSINESSRULE_LANE_CONTRACT = Object.freeze({
|
|
|
166
166
|
// 295,400B,HEAD 4c524b83 实测 295,331 仅余 69B——加对照句即红门)。对照
|
|
167
167
|
// 教学住 read-shapes 的 notes[0](默认 describe 面即回,不进 tools/list);
|
|
168
168
|
// MCP 面的同款对照由 omc_graph_explore 的 description 承担。
|
|
169
|
-
description: "跨规则引用检索:一次调用替代 agent 逐 schema×ruleCode 全平台枚举 rule.get
|
|
169
|
+
description: "跨规则引用检索:一次调用替代 agent 逐 schema×ruleCode 全平台枚举 rule.get(删服务/模型/字段/规则前的影响面)。kind=service 查 BIZ_ACTION 的 methodMapping.serviceCode;kind=model 查 CREATE/UPDATE/DELETE 的 targetObjectCode 与 methodMapping.schemaCode(删模型前的影响面);kind=field 查 dataActions.targetDataItem、inputMappings/outputMappings 的 bizCode、规则条件叶子(filterCondition/BRANCH 出口等,只认主模型字段)与 datarule(propertyCodes + options 文本;字段 code 跨模型不唯一,建议配 schemaCodes 限范围);kind=rule 查流程事件绑定(flow 级 handler 与节点级 nodeEvent 的 bizActions,按模型枚举流程面)。实现为客户端聚合(应用树模型清单→逐模型 rule.list/rule.get 或 get_published),输出只回命中行;各 kind 的覆盖面与协议局限见回执 coverage。",
|
|
170
170
|
}),
|
|
171
171
|
"rule.save": Object.freeze({
|
|
172
172
|
scope: "dead-state CRUD conditional node graphs",
|
|
@@ -8,6 +8,8 @@ import { applicationResolutionOf, applicationScopeHint, flattenTreeRows, resolve
|
|
|
8
8
|
import { assertRuleNamePlatformAcceptable, executeRuleSaveWrite, lintRuleGraphForWrite, lintRuleSaveWrite, ruleNodeGraphArg } from "../rule-support.js";
|
|
9
9
|
import { defineTool, isRequiredAlternativePlaceholder, ToolInputError, ToolRefusalError } from "../tool-types.js";
|
|
10
10
|
import { resolveRuleRowId } from "../identity.js";
|
|
11
|
+
import { extractDataRuleEdges, extractReferenceEdges } from "../graph.js";
|
|
12
|
+
import { scanModelWorkflowBindings } from "./workflow.js";
|
|
11
13
|
import { wireCall, wireCallWith404Fallback, wireRows } from "../wire.js";
|
|
12
14
|
import { readModelRecord } from "../model-record.js";
|
|
13
15
|
import { BUSINESSRULE_LANE_CONTRACT } from "./businessrule-contract.js";
|
|
@@ -704,7 +706,7 @@ export function registerBusinessRuleLane(tools) {
|
|
|
704
706
|
description: RULE_TOOLS["rule.references"].description,
|
|
705
707
|
inputSchema: {
|
|
706
708
|
environment: environmentArg,
|
|
707
|
-
kind: z.enum(["service", "model", "field"]).describe("按什么找引用:service=BIZ_ACTION methodMapping.serviceCode;model=CREATE/UPDATE/DELETE targetObjectCode 与 methodMapping.schemaCode;field=dataActions.targetDataItem
|
|
709
|
+
kind: z.enum(["service", "model", "field", "rule"]).describe("按什么找引用:service=BIZ_ACTION methodMapping.serviceCode;model=CREATE/UPDATE/DELETE targetObjectCode 与 methodMapping.schemaCode;field=dataActions.targetDataItem、映射 bizCode、规则条件叶子与 datarule;rule=流程事件绑定的规则码(flow 级 handler + 节点级 nodeEvent,扫应用内模型的流程面)"),
|
|
708
710
|
code: z.string().min(1).describe("要查引用的编码(服务/模型/字段 code);kind=field 可用 schemaCode.field 消歧"),
|
|
709
711
|
schemaCodes: z.union([z.array(z.string().min(1)), z.string()]).optional().describe("只扫这些模型(省 wire 读);省略=全平台模型"),
|
|
710
712
|
capability: capabilityArg,
|
|
@@ -787,16 +789,82 @@ export function registerBusinessRuleLane(tools) {
|
|
|
787
789
|
fieldScope = prefix;
|
|
788
790
|
}
|
|
789
791
|
}
|
|
792
|
+
// R79 三期 T-B:kind=rule——查一条规则被哪些流程事件绑定。绑定数据住流程
|
|
793
|
+
// 模板(flow 级四 handler + 节点级八事件的 bizActions),与 rule 图无关,
|
|
794
|
+
// 因此本 kind 不走 rule.list/rule.get 扫描,改扫与 workflow.list 同源的
|
|
795
|
+
// 模型→流程面(scanModelWorkflowBindings 复用 get_published 的
|
|
796
|
+
// ruleBindings/nodeRuleBindings 投影,读回面与检索面同一谓词)。模型没有
|
|
797
|
+
// 流程 = 该模型不可能绑定,如实跳过(scanned.withoutWorkflow 计数)。
|
|
798
|
+
if (args.kind === "rule") {
|
|
799
|
+
const wantedRule = String(args.code);
|
|
800
|
+
const ruleHits = [];
|
|
801
|
+
let scannedWorkflows = 0;
|
|
802
|
+
let withoutWorkflow = 0;
|
|
803
|
+
let readFailures = 0;
|
|
804
|
+
for (const schemaCode of scoped) {
|
|
805
|
+
let face;
|
|
806
|
+
try {
|
|
807
|
+
face = await scanModelWorkflowBindings(session, schemaCode);
|
|
808
|
+
}
|
|
809
|
+
catch {
|
|
810
|
+
readFailures += 1; // 单模型读失败不中断整轮扫描
|
|
811
|
+
continue;
|
|
812
|
+
}
|
|
813
|
+
if (face === null) {
|
|
814
|
+
withoutWorkflow += 1;
|
|
815
|
+
continue;
|
|
816
|
+
}
|
|
817
|
+
scannedWorkflows += 1;
|
|
818
|
+
for (const binding of face.ruleBindings)
|
|
819
|
+
if (binding.ruleCodes.includes(wantedRule))
|
|
820
|
+
ruleHits.push({ schemaCode, workflowCode: face.workflowCode, handler: binding.handler, ruleCodes: binding.ruleCodes, published: face.published, via: "workflow-bindRule" });
|
|
821
|
+
for (const binding of face.nodeRuleBindings)
|
|
822
|
+
if (binding.ruleCodes.includes(wantedRule))
|
|
823
|
+
ruleHits.push({ schemaCode, workflowCode: face.workflowCode, activityCode: binding.activityCode, nodeEvent: binding.nodeEvent, ruleCodes: binding.ruleCodes, published: face.published, via: "workflow-bindRule" });
|
|
824
|
+
}
|
|
825
|
+
return {
|
|
826
|
+
kind: "rule",
|
|
827
|
+
code: wantedRule,
|
|
828
|
+
scanned: { models: scoped.length, workflows: scannedWorkflows, withoutWorkflow, ...(readFailures > 0 ? { readFailures } : {}) },
|
|
829
|
+
matches: ruleHits,
|
|
830
|
+
wire: { plan: "1 模型清单 + 每模型 isworkflow(无流程即止)→ 有流程再 getWorkflow + get_published" },
|
|
831
|
+
coverage: {
|
|
832
|
+
scanned: ["workflow.get_published:ruleBindings+nodeRuleBindings"],
|
|
833
|
+
notScanned: [],
|
|
834
|
+
note: "matches:[] = 扫描范围内没有任何流程事件(flow 级四 handler + 节点级八事件)绑定该规则;流程面按 get_published 读回,未发布流程读回草稿形态(命中行的 published:false 标注,不是已发布证据)",
|
|
835
|
+
},
|
|
836
|
+
...(args.schemaCodes === undefined && scope !== undefined
|
|
837
|
+
? { applicationResolution: { ...applicationResolutionOf(scope), mode: scanMode, models: scoped.length } }
|
|
838
|
+
: {}),
|
|
839
|
+
...(ruleHits.length === 0
|
|
840
|
+
? {
|
|
841
|
+
note: "零命中(流程绑定面)= " +
|
|
842
|
+
(args.schemaCodes !== undefined
|
|
843
|
+
? `仅扫描了 schemaCodes 收窄的 ${scoped.length} 个模型(${scoped.slice(0, 5).join(", ")}${scoped.length > 5 ? "…" : ""})——绑定常在**其他**模型的流程上;要全平台结论请去掉 schemaCodes`
|
|
844
|
+
: "扫描范围内没有流程事件绑定该规则") +
|
|
845
|
+
"。规则是否存在于规则面用 rule.list;绑定写法用 workflow.bindRule",
|
|
846
|
+
...(args.schemaCodes === undefined && scope !== undefined ? { hint: applicationScopeHint(scope, "绑定") } : {}),
|
|
847
|
+
}
|
|
848
|
+
: {
|
|
849
|
+
hint: "在线扫描完成;命中行的流程细节(参与人/节点)用 workflow.get_published {workflowCode} 读回;改绑定走 workflow.bindRule(merge 语义,不会清掉其它绑定)",
|
|
850
|
+
}),
|
|
851
|
+
};
|
|
852
|
+
}
|
|
790
853
|
const matches = [];
|
|
791
854
|
let scannedRules = 0;
|
|
792
855
|
let parseFailures = 0;
|
|
856
|
+
let scannedDataRules = 0;
|
|
857
|
+
let dataRuleReadFailures = 0;
|
|
858
|
+
let childRefsSkipped = 0;
|
|
793
859
|
for (const schemaCode of scoped) {
|
|
794
860
|
let rows = [];
|
|
795
861
|
try {
|
|
796
862
|
rows = wireRows((await wireCall(session, { path: ENDPOINTS.businessRuleListBySchemaCode, query: { schemaCode } })).data);
|
|
797
863
|
}
|
|
798
864
|
catch {
|
|
799
|
-
|
|
865
|
+
// 模型无规则面(读失败/空)按无规则处理,不让单个模型挡住全扫。
|
|
866
|
+
// R79 三期:kind=field 时仍要扫该模型的 datarule 面——不再 continue,
|
|
867
|
+
// 落到循环尾部的 datarule 块。
|
|
800
868
|
}
|
|
801
869
|
for (const row of rows) {
|
|
802
870
|
const ruleCode = String(row.code ?? "");
|
|
@@ -818,6 +886,27 @@ export function registerBusinessRuleLane(tools) {
|
|
|
818
886
|
parseFailures += 1;
|
|
819
887
|
continue;
|
|
820
888
|
}
|
|
889
|
+
// R79 三期 T-C①:条件叶子(filterCondition/BRANCH 出口/route 兜底/定时
|
|
890
|
+
// filterConditionGroups 的 currentSchemaDataItem、targetSchemaDataItem 与
|
|
891
|
+
// value {字段} 模板)。复用 graph 索引的权威抽取器(含宿主归属与日期偏移
|
|
892
|
+
// 噪音过滤),在线/离线两面同一定义——只取 via==="rule.condition" 边,
|
|
893
|
+
// 动作/映射命中仍由下方在线匹配产出(via 不变)。第一版只认主模型字段:
|
|
894
|
+
// 点号引用(子表)不匹配、计入 childRefsSkipped(不静默)。
|
|
895
|
+
if (args.kind === "field") {
|
|
896
|
+
const routes = decodeJsonColumn(record.route, JSON_COLUMN_NULL_COALESCE);
|
|
897
|
+
const schedulerSetting = decodeJsonColumn(record.schedulerSetting, JSON_COLUMN_NULL_COALESCE);
|
|
898
|
+
for (const edge of extractReferenceEdges(schemaCode, ruleCode, nodes, Array.isArray(routes) ? routes : [], schedulerSetting)) {
|
|
899
|
+
if (edge.via !== "rule.condition" || edge.code !== wanted)
|
|
900
|
+
continue;
|
|
901
|
+
if (edge.code.includes(".")) {
|
|
902
|
+
childRefsSkipped += 1;
|
|
903
|
+
continue;
|
|
904
|
+
}
|
|
905
|
+
if (fieldScope !== undefined && edge.schemaCode !== fieldScope)
|
|
906
|
+
continue;
|
|
907
|
+
matches.push({ schemaCode, ruleCode, nodeCode: edge.nodeCode, nodeType: edge.nodeType, via: "condition-leaf", hostSchemaCode: edge.schemaCode });
|
|
908
|
+
}
|
|
909
|
+
}
|
|
821
910
|
for (const rawNode of nodes) {
|
|
822
911
|
const nodeCode = String(rawNode.nodeCode ?? "");
|
|
823
912
|
const nodeType = String(rawNode.nodeType ?? "");
|
|
@@ -849,21 +938,72 @@ export function registerBusinessRuleLane(tools) {
|
|
|
849
938
|
}
|
|
850
939
|
}
|
|
851
940
|
}
|
|
941
|
+
// R79 三期 T-C②:datarule 面(每模型 +1 wire bizdatarule/list)。命中两源:
|
|
942
|
+
// propertyCodes[](权威目标字段绑定)与 options 里的 {字段code} 文本(跨字段
|
|
943
|
+
// 公式/条件引用;matchedBy 区分)。options 是自由文本协议——字面匹配可能漏
|
|
944
|
+
// JSON 形引用({"valueType":"currentModel","value":…}),协议局限在 coverage
|
|
945
|
+
// note 声明;单模型读失败不中断扫描。第一版只认主模型字段(点号引用跳过)。
|
|
946
|
+
if (args.kind === "field") {
|
|
947
|
+
try {
|
|
948
|
+
const dataRuleRows = wireRows((await wireCall(session, { path: ENDPOINTS.dataRuleList, query: { schemaCode } })).data);
|
|
949
|
+
scannedDataRules += dataRuleRows.length;
|
|
950
|
+
for (const row of dataRuleRows) {
|
|
951
|
+
const matched = extractDataRuleEdges(schemaCode, row).find((edge) => {
|
|
952
|
+
if (edge.code !== wanted)
|
|
953
|
+
return false;
|
|
954
|
+
if (edge.code.includes(".")) {
|
|
955
|
+
childRefsSkipped += 1;
|
|
956
|
+
return false;
|
|
957
|
+
}
|
|
958
|
+
return true;
|
|
959
|
+
});
|
|
960
|
+
if (matched)
|
|
961
|
+
matches.push({
|
|
962
|
+
schemaCode,
|
|
963
|
+
kind: "datarule",
|
|
964
|
+
ref: String(row.id ?? row.name ?? ""),
|
|
965
|
+
name: row.name ?? null,
|
|
966
|
+
dataRuleType: row.dataRuleType ?? null,
|
|
967
|
+
matchedBy: matched.via === "datarule.targets" ? "propertyCodes" : "options",
|
|
968
|
+
via: "datarule",
|
|
969
|
+
});
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
catch {
|
|
973
|
+
dataRuleReadFailures += 1;
|
|
974
|
+
}
|
|
975
|
+
}
|
|
852
976
|
}
|
|
853
977
|
return {
|
|
854
978
|
kind: args.kind,
|
|
855
979
|
code: wanted,
|
|
856
980
|
...(fieldScope !== undefined ? { requestedCode: rawCode, resolvedScope: { schemaCode: fieldScope, code: wanted } } : {}),
|
|
857
|
-
scanned:
|
|
981
|
+
scanned: args.kind === "field"
|
|
982
|
+
? {
|
|
983
|
+
models: scoped.length,
|
|
984
|
+
rules: scannedRules,
|
|
985
|
+
datarules: scannedDataRules,
|
|
986
|
+
...(parseFailures > 0 ? { parseFailures } : {}),
|
|
987
|
+
...(dataRuleReadFailures > 0 ? { dataRuleReadFailures } : {}),
|
|
988
|
+
...(childRefsSkipped > 0 ? { childRefsSkipped } : {}),
|
|
989
|
+
}
|
|
990
|
+
: { models: scoped.length, rules: scannedRules, ...(parseFailures > 0 ? { parseFailures } : {}) },
|
|
858
991
|
matches,
|
|
859
|
-
// r35a-F4
|
|
860
|
-
//
|
|
861
|
-
//
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
992
|
+
// r35a-F4:matches:[] 曾被当成「可安全删除」的依据,而该字段可能**被表单
|
|
993
|
+
// 引用**(form.get draftControlCodes)且出现在流程节点权限里——散文字段
|
|
994
|
+
// 不承担安全契约:结构化声明。R79 三期起 kind=field 的覆盖面扩为
|
|
995
|
+
// 动作/映射 + 条件叶子 + datarule;form/listview/流程字段权限仍不在。
|
|
996
|
+
coverage: args.kind === "field"
|
|
997
|
+
? {
|
|
998
|
+
scanned: ["businessrule:actions+mappings", "businessrule:condition-leaf", "datarule"],
|
|
999
|
+
notScanned: ["form", "listview", "onlinejs", "workflow.permissions", "子表字段(条件叶/datarule 的点号引用不匹配)"],
|
|
1000
|
+
note: "matches:[] 只代表上述三面零命中;form/listview/流程字段权限/子表字段未扫描(离线 graph references 覆盖更广,见其 coverage),不可据此判定可安全删除。datarule 的 options 是自由文本协议:matchedBy:options 按 {字段code} 字面匹配,可能漏掉 JSON 形引用(如 currentModel 值对象)——命中/零命中涉 datarule 时建议 datarule.list 复核",
|
|
1001
|
+
}
|
|
1002
|
+
: {
|
|
1003
|
+
scanned: ["businessrule"],
|
|
1004
|
+
notScanned: ["form", "workflow.permissions", "workflow.bindings", "onlinejs", "listview"],
|
|
1005
|
+
note: "matches:[] 只代表 businessrule 面零命中;form/流程权限/视图等未扫描(离线 graph references 覆盖更广,见其 coverage),不可据此判定可安全删除",
|
|
1006
|
+
},
|
|
867
1007
|
// r73 #3:app-scope 路径回显 applicationResolution(含 mode/models:扫了
|
|
868
1008
|
// 哪个应用、共几个模型)。显式 schemaCodes 路径维持原形状(无
|
|
869
1009
|
// applicationResolution/hint——显式范围自带出处,provenance 契约不变)。
|
|
@@ -872,15 +1012,18 @@ export function registerBusinessRuleLane(tools) {
|
|
|
872
1012
|
: {}),
|
|
873
1013
|
...(matches.length === 0
|
|
874
1014
|
? {
|
|
875
|
-
// r73 探针01-P1
|
|
876
|
-
//
|
|
877
|
-
//
|
|
878
|
-
//
|
|
879
|
-
note:
|
|
1015
|
+
// r73 探针01-P1:零命中首句必须先声明「本面」盲区再下结论——快读
|
|
1016
|
+
// 者会直接答「没有规则用它」。R79 三期起条件叶子与 datarule 已入
|
|
1017
|
+
// kind=field 扫描面,首句盲区随之收窄(form/listview/流程字段权限
|
|
1018
|
+
// /子表字段仍在盲区)。
|
|
1019
|
+
note: (args.kind === "field"
|
|
1020
|
+
? "零命中(本面扫 businessrule 的动作/映射/条件叶子 + datarule 的 propertyCodes/options 文本;**不含 form/listview/流程字段权限/子表字段**)"
|
|
1021
|
+
: "零命中(本在线面仅 businessrule 的 methodMapping/targetObjectCode/dataActions;**不含 form/listview**)") +
|
|
1022
|
+
"= " +
|
|
880
1023
|
(args.schemaCodes !== undefined
|
|
881
1024
|
? `仅扫描了 schemaCodes 收窄的 ${scoped.length} 个模型(${scoped.slice(0, 5).join(", ")}${scoped.length > 5 ? "…" : ""})——引用常发生在**其他**模型上;要全平台结论请去掉 schemaCodes`
|
|
882
|
-
: "
|
|
883
|
-
"。范围:service→methodMapping.serviceCode;model→targetObjectCode/methodMapping.schemaCode;field→dataActions.targetDataItem/映射 bizCode
|
|
1025
|
+
: "扫描范围内没有匹配引用") +
|
|
1026
|
+
"。范围:service→methodMapping.serviceCode;model→targetObjectCode/methodMapping.schemaCode;field→dataActions.targetDataItem/映射 bizCode/条件叶子(filterCondition、BRANCH 出口等)/datarule(子表字段不扫)。本工具是在线单点扫描;要离线毫秒级复询、字段级影响面或两跳爆炸半径,先 `omc graph pull --env <env>` 再 `omc graph references|impact <kind> <code>`",
|
|
884
1027
|
...(args.schemaCodes === undefined && scope !== undefined ? { hint: applicationScopeHint(scope, "引用") } : {}),
|
|
885
1028
|
}
|
|
886
1029
|
: {
|
|
@@ -156,6 +156,13 @@ export const WORKFLOW_LANE_CONTRACT = Object.freeze({
|
|
|
156
156
|
scope: WORKFLOW_SCOPE,
|
|
157
157
|
description: "Read the current PUBLISHED workflow template (`/api/api/workflow/get_published`). **默认返回 workflowSummary(activities + ruleBindings),不是整份正文**;节点级规则绑定按活动投影在 `workflowSummary.activities[].bizActions`({节点事件:[规则码]};流程级看 ruleBindings)。完整正文加 --full,或 `--jq 'data.activities[code=<活动>].<节点事件>.bizActions'` 这类**叶子**路径——对父节点 data.activities 取值会再次被折叠。在 workflow.publish / workflow.bindRule 之后用它确认发布后的绑定点。",
|
|
158
158
|
}),
|
|
159
|
+
// R79 三期 T-A:应用内流程清单(注意:不能放在 tools 的首位——
|
|
160
|
+
// lane-contracts 的 assertDescriptionsDerive 用首个 tool 的 scope 匹配契约
|
|
161
|
+
// markdown,首位必须是 workflow.get_draft 的 WORKFLOW_SCOPE)。
|
|
162
|
+
"workflow.list": Object.freeze({
|
|
163
|
+
scope: "application workflow inventory (model-indexed)",
|
|
164
|
+
description: "应用内流程清单。平台**没有**流程模板清单端点——本面以模型为索引(平台惯例每模型至多一条流程;workflowCode 通常是 `<模型code>_flow`,以逐模型解析为准):应用树取模型 → 逐模型解析流程(isworkflow→getWorkflow)→ 读 get_published 摘要。行 `{modelCode,workflowCode,exists,published,ruleBindingCount}`;无流程的模型如实列 exists:false(不是错误),ruleBindingCount 含 flow 级 handler 与节点级事件绑定的规则码总数。上限 50 模型:超出回 partial + omittedModels,点查用 workflow.get_published {schemaCode}。查某条规则被哪些流程绑定用 rule.references kind=rule。",
|
|
165
|
+
}),
|
|
159
166
|
"workflow.create": Object.freeze({
|
|
160
167
|
scope: WORKFLOW_SCOPE,
|
|
161
168
|
description: "创建工作流模板头(`/api/api/workflow/create`)。随后用 `workflow.update` 写入模板 JSON,再 `workflow.publish` 发布。**平台会自动生成含发起节点的草稿**(START → PARTICIPANT「填写申请单」participant={Originator} → PARTICIPANT「审批」participant 空 → END)——审批参与人必须显式补平台关键字(如 `{Originator}`=发起人),留空行为未知;get_draft 可核对自动草稿形状。",
|
|
@@ -248,6 +255,7 @@ export function assertWorkflowContract() {
|
|
|
248
255
|
if (!WORKFLOW_WIRE.renderCompat.includes("workflowRenderCompat"))
|
|
249
256
|
throw new Error("workflow contract must pin workflow render compatibility readback");
|
|
250
257
|
assertDescriptionCarries(WORKFLOW_LANE_CONTRACT, "workflow.get_draft", ["get_draft", "endEventHandler"]);
|
|
258
|
+
assertDescriptionCarries(WORKFLOW_LANE_CONTRACT, "workflow.list", ["模型为索引", "exists:false", "ruleBindingCount", "50", "kind=rule", "partial"]);
|
|
251
259
|
assertDescriptionCarries(WORKFLOW_LANE_CONTRACT, "workflow.get_published", ["get_published", "workflow.publish"]);
|
|
252
260
|
assertDescriptionCarries(WORKFLOW_LANE_CONTRACT, "workflow.create", ["workflow/create", "workflow.update", "workflow.publish"]);
|
|
253
261
|
assertDescriptionCarries(WORKFLOW_LANE_CONTRACT, "workflow.update", ["workflow/update", "template", "rules", "activityType", "propertyPermissions", "CLI_ARGS_MAX_BYTES", "workflow-merge-would-drop-routes"]);
|
|
@@ -10,6 +10,7 @@ export const WORKFLOW_COVERAGE = declareLaneCoverage(WORKFLOW_LANE_CONTRACT.lane
|
|
|
10
10
|
"r11 2026-10-23 (1.1.25): node form-button visibility = activity.buttonPermission.customBtns[].enabled; ActionPermissionHandler.setProcessButtonPermission filters FORM buttons by it (Playwright + backend source)",
|
|
11
11
|
],
|
|
12
12
|
tools: [
|
|
13
|
+
claim("workflow.list", T["workflow.list"].scope),
|
|
13
14
|
claim("workflow.get_draft", T["workflow.get_draft"].scope),
|
|
14
15
|
claim("workflow.get_published", T["workflow.get_published"].scope),
|
|
15
16
|
claim("workflow.create", T["workflow.create"].scope),
|
package/dist/lanes/workflow.js
CHANGED
|
@@ -15,10 +15,13 @@ import { WORKFLOW_EVENT_HANDLER_FIELDS, WORKFLOW_NODE_EVENT_HANDLER_FIELDS, WORK
|
|
|
15
15
|
import { PLATFORM_TRIGGER_RULE_CODES } from "./rule-graph.js";
|
|
16
16
|
import { executeRuleEnableWrite } from "./rule-lifecycle.js";
|
|
17
17
|
import { PLATFORM_ADMIN_START_BYPASS, resolvePermissionActor } from "../identity.js";
|
|
18
|
+
import { applicationResolutionOf, flattenTreeRows, resolveApplicationScope } from "../support.js";
|
|
18
19
|
const WORKFLOW_LANE = WORKFLOW_LANE_CONTRACT.lane;
|
|
19
20
|
const WORKFLOW_TOOLS = WORKFLOW_LANE_CONTRACT.tools;
|
|
20
21
|
const WORKFLOW_ACTIVITY_TYPES = new Set(["START", "END", "CONNECTION", "PARTICIPANT", "SUB_INSTANCE", "CIRCULATE", "SYSTEM_ACTIVITY", "AGENT_ACTIVITY"]);
|
|
21
22
|
const WORKFLOW_POINT = /^-?\d+(?:\.\d+)?,\s-?\d+(?:\.\d+)?$/;
|
|
23
|
+
/** workflow.list 的模型枚举上限:超出截断(partial + omittedModels + 点查指引)。 */
|
|
24
|
+
const WORKFLOW_LIST_MODEL_CAP = 50;
|
|
22
25
|
/** Keep workitem.list's external envelope aligned with data.list. */
|
|
23
26
|
export function workItemListCompactProjection(result) {
|
|
24
27
|
const compact = {};
|
|
@@ -2152,6 +2155,28 @@ async function resolveWorkflowArg(session, args) {
|
|
|
2152
2155
|
const workflowCode = code && typeof code.workflowCode === "string" && code.workflowCode ? code.workflowCode : null;
|
|
2153
2156
|
return workflowCode;
|
|
2154
2157
|
}
|
|
2158
|
+
export async function scanModelWorkflowBindings(session, schemaCode) {
|
|
2159
|
+
const workflowCode = await resolveWorkflowArg(session, { schemaCode });
|
|
2160
|
+
if (!workflowCode)
|
|
2161
|
+
return null;
|
|
2162
|
+
let pub;
|
|
2163
|
+
try {
|
|
2164
|
+
pub = await wireCall(session, { path: ENDPOINTS.workflowGetPublished, query: { workflowCode } });
|
|
2165
|
+
}
|
|
2166
|
+
catch (error) {
|
|
2167
|
+
if (isWorkflowAbsent(error))
|
|
2168
|
+
return null;
|
|
2169
|
+
throw error;
|
|
2170
|
+
}
|
|
2171
|
+
const data = (pub.data ?? null);
|
|
2172
|
+
const published = data !== null && (data.templateType === "PUBLISH" || data.published === true);
|
|
2173
|
+
const summary = workflowCompactProjection({ data: pub.data }).workflowSummary;
|
|
2174
|
+
const ruleBindings = summary?.ruleBindings ?? [];
|
|
2175
|
+
const nodeRuleBindings = summary?.nodeRuleBindings ?? [];
|
|
2176
|
+
const ruleBindingCount = ruleBindings.reduce((sum, binding) => sum + binding.ruleCodes.length, 0) +
|
|
2177
|
+
nodeRuleBindings.reduce((sum, binding) => sum + binding.ruleCodes.length, 0);
|
|
2178
|
+
return { workflowCode, published, ruleBindings, nodeRuleBindings, ruleBindingCount };
|
|
2179
|
+
}
|
|
2155
2180
|
async function getWorkflowHeaderOrNull(session, workflowCode) {
|
|
2156
2181
|
try {
|
|
2157
2182
|
return ((await wireCall(session, { path: ENDPOINTS.workflowGetHeader, query: { workflowCode } })).data ?? null);
|
|
@@ -2454,6 +2479,104 @@ export function registerWorkflowLane(tools) {
|
|
|
2454
2479
|
: { workflowCode, exists: true, data: draft };
|
|
2455
2480
|
}, { full: args.full === true, compact: workflowCompactProjection, target: `workflow.get_draft:${args.workflowCode ?? args.schemaCode}` }),
|
|
2456
2481
|
}));
|
|
2482
|
+
tools.push(defineTool({
|
|
2483
|
+
name: "workflow.list",
|
|
2484
|
+
search: { intents: ["流程清单", "应用有哪些流程", "列出流程", "查流程列表"] },
|
|
2485
|
+
layer: "low",
|
|
2486
|
+
kind: "read",
|
|
2487
|
+
lane: WORKFLOW_LANE,
|
|
2488
|
+
scope: WORKFLOW_TOOLS["workflow.list"].scope,
|
|
2489
|
+
description: WORKFLOW_TOOLS["workflow.list"].description,
|
|
2490
|
+
inputSchema: {
|
|
2491
|
+
environment: environmentArg,
|
|
2492
|
+
applicationCode: z.string().min(1).optional().describe("应用 code;省略按环境 profile / 租户首应用解析,回执 applicationResolution 回显实际扫了哪个应用"),
|
|
2493
|
+
capability: capabilityArg,
|
|
2494
|
+
},
|
|
2495
|
+
handler: async (ctx, args, self) => governedRead(ctx, self, args, async (session) => {
|
|
2496
|
+
// R79 三期 T-A:应用内流程清单。平台没有流程模板清单端点(只有
|
|
2497
|
+
// list_permission/search_workitems/list_instances 运行时面),流程发现
|
|
2498
|
+
// 只能以模型为索引:应用树取模型 → 逐模型解析流程(isworkflow →
|
|
2499
|
+
// getWorkflow)→ 读 get_published 摘要。模型枚举沿 rule.references 的
|
|
2500
|
+
// 应用解析骨架(裸 bizmodels/list 在部分平台回空行,必须走应用树)。
|
|
2501
|
+
const scope = await resolveApplicationScope(session, args.applicationCode);
|
|
2502
|
+
const tree = wireRows((await wireCall(session, { path: ENDPOINTS.applicationTree, query: { appCode: scope.code } })).data);
|
|
2503
|
+
const modelRows = flattenTreeRows(tree).filter((row) => row.type === "BizModel" && typeof row.code === "string" && row.code !== "");
|
|
2504
|
+
const totalModels = modelRows.length;
|
|
2505
|
+
if (totalModels === 0) {
|
|
2506
|
+
// 空扫描 fail closed(同 references-scan-empty 判例):空 workflows 会被
|
|
2507
|
+
// 读成「应用没有流程」,必须拒绝并回显应用解析出处。
|
|
2508
|
+
throw new ToolRefusalError({
|
|
2509
|
+
status: "refused",
|
|
2510
|
+
blocker: "workflow-list-scan-empty",
|
|
2511
|
+
message: `应用 ${scope.code} 的模型树为空(0 个 BizModel)——本次没有枚举任何模型,空清单不代表「应用没有流程」;通常是 applicationCode 传错或该应用尚未发布模型`,
|
|
2512
|
+
applicationResolution: { ...applicationResolutionOf(scope), models: 0 },
|
|
2513
|
+
nextCommand: `omc call workflow.list --args '{"applicationCode":"<应用code>"}'(换应用重试)`,
|
|
2514
|
+
});
|
|
2515
|
+
}
|
|
2516
|
+
const capped = totalModels > WORKFLOW_LIST_MODEL_CAP;
|
|
2517
|
+
const scanRows = capped ? modelRows.slice(0, WORKFLOW_LIST_MODEL_CAP) : modelRows;
|
|
2518
|
+
const workflows = [];
|
|
2519
|
+
let withWorkflow = 0;
|
|
2520
|
+
let publishedCount = 0;
|
|
2521
|
+
let absentCount = 0;
|
|
2522
|
+
let readFailures = 0;
|
|
2523
|
+
for (const row of scanRows) {
|
|
2524
|
+
const modelCode = String(row.code);
|
|
2525
|
+
try {
|
|
2526
|
+
const face = await scanModelWorkflowBindings(session, modelCode);
|
|
2527
|
+
if (face === null) {
|
|
2528
|
+
absentCount += 1;
|
|
2529
|
+
workflows.push({ modelCode, workflowCode: null, exists: false, published: false, ruleBindingCount: 0 });
|
|
2530
|
+
continue;
|
|
2531
|
+
}
|
|
2532
|
+
withWorkflow += 1;
|
|
2533
|
+
if (face.published)
|
|
2534
|
+
publishedCount += 1;
|
|
2535
|
+
workflows.push({ modelCode, workflowCode: face.workflowCode, exists: true, published: face.published, ruleBindingCount: face.ruleBindingCount });
|
|
2536
|
+
}
|
|
2537
|
+
catch {
|
|
2538
|
+
// 单模型读失败不中断整轮清单;行级 readFailed 标注,不让一次失败
|
|
2539
|
+
// 变成整面错误(同 participantSearch 的容错口径)。
|
|
2540
|
+
readFailures += 1;
|
|
2541
|
+
workflows.push({ modelCode, workflowCode: null, exists: null, published: null, ruleBindingCount: null, readFailed: true });
|
|
2542
|
+
}
|
|
2543
|
+
}
|
|
2544
|
+
return {
|
|
2545
|
+
applicationResolution: { ...applicationResolutionOf(scope), models: totalModels },
|
|
2546
|
+
modelsCount: totalModels,
|
|
2547
|
+
scannedModels: scanRows.length,
|
|
2548
|
+
withWorkflow,
|
|
2549
|
+
publishedCount,
|
|
2550
|
+
absentCount,
|
|
2551
|
+
...(readFailures > 0 ? { readFailures } : {}),
|
|
2552
|
+
workflows,
|
|
2553
|
+
wire: { plan: "1 应用树 + 每模型 isworkflow(无流程即止,1 wire)→ 有流程再 getWorkflow + get_published(共 3 wire)" },
|
|
2554
|
+
...(capped
|
|
2555
|
+
? {
|
|
2556
|
+
partial: true,
|
|
2557
|
+
omittedModels: totalModels - scanRows.length,
|
|
2558
|
+
note: `应用 ${scope.code} 共 ${totalModels} 个模型,超过 ${WORKFLOW_LIST_MODEL_CAP} 上限只扫前 ${WORKFLOW_LIST_MODEL_CAP} 个(按应用树序)——本清单不是全集`,
|
|
2559
|
+
nextCommand: `omc call workflow.get_published --args '{"schemaCode":"<模型code>"}'(点查未扫到的具体模型)`,
|
|
2560
|
+
}
|
|
2561
|
+
: {}),
|
|
2562
|
+
indexNote: "平台没有流程模板清单端点;本面以模型为索引(流程-模型一对一惯例,workflowCode 通常是 <模型code>_flow,以逐模型解析结果为准)——不在任何模型名下的流程不在本清单内",
|
|
2563
|
+
};
|
|
2564
|
+
}, {
|
|
2565
|
+
target: `workflow.list:${args.applicationCode ?? "*"}`,
|
|
2566
|
+
// 50 行 ≈ 4-5KB,超 2048B 通用读门会被折叠成 count+artifact——清单面恰恰
|
|
2567
|
+
// 要行内可扫(同 method.list 判例)。自带 compact 保整行;行数/体积超预算
|
|
2568
|
+
// 时显式 workflowsOmitted(不静默截断),正文在 detailArtifactId。
|
|
2569
|
+
compact: (result) => {
|
|
2570
|
+
const rows = Array.isArray(result.workflows) ? result.workflows : [];
|
|
2571
|
+
const keep = rows.length <= 50 && Buffer.byteLength(JSON.stringify(rows), "utf8") <= 8192;
|
|
2572
|
+
return {
|
|
2573
|
+
...result,
|
|
2574
|
+
...(keep ? {} : { workflowsOmitted: true, omittedWorkflows: rows.length, workflowsNote: "流程行超过内联预算(50 行 / 8KB)——完整行在 detailArtifactId" }),
|
|
2575
|
+
workflows: keep ? rows : [],
|
|
2576
|
+
};
|
|
2577
|
+
},
|
|
2578
|
+
}),
|
|
2579
|
+
}));
|
|
2457
2580
|
tools.push(defineTool({
|
|
2458
2581
|
name: "workflow.get_published",
|
|
2459
2582
|
search: { intents: ["查看流程模板", "看流程", "查流程"] },
|
package/dist/read-shapes.js
CHANGED
|
@@ -122,6 +122,10 @@ const READ_SHAPES = {
|
|
|
122
122
|
// activities[] 只是投影;完整模板在 data(>8KB 外置 detailArtifactId,配合
|
|
123
123
|
// artifact get --shape 先看骨架再 --jq)。published/draft 两面同形,仅 templateType
|
|
124
124
|
// 与 published 键不同。
|
|
125
|
+
"workflow.list": {
|
|
126
|
+
keys: ["applicationResolution", "modelsCount", "scannedModels", "withWorkflow", "publishedCount", "absentCount", "workflows:array<{modelCode,workflowCode,exists,published,ruleBindingCount,readFailed?}>", "wire", "partial?", "omittedModels?", "nextCommand?", "indexNote", "environmentFingerprint"],
|
|
127
|
+
notes: ["无流程的模型 workflowCode:null + exists:false(不是错误);平台无流程清单端点,本面按模型索引(流程-模型一对一惯例,workflowCode 常为 <模型code>_flow)", "ruleBindingCount = flow 级 handler 绑定 + 节点级事件绑定的规则码总数(比 get_published 摘要里的同名键多算节点级)"],
|
|
128
|
+
},
|
|
125
129
|
"workflow.get_published": {
|
|
126
130
|
keys: ["status", "workflowCode", "exists", "published", "workflowSummary:{workflowCode,templateType,activities:array<{index,code,type,name,bizActions?:{<nodeEvent>:[ruleCode]}}>,edges:array<{from,to}>,ruleBindings:array<{...}>,ruleBindingCount,originateActivity:{code,type,name,participant}}", "activities:array<{code,name,type,bizActions?}>(投影)", "propertyPermissionsCount", "version", "summaryHint", "truncatedKeys?", "omittedKeys?", "truncated?", "data?(外置时 null,完整模板在 detailArtifactId)", "omittedShape?", "omittedNote?", "environmentFingerprint", "detailArtifactId?", "detailSha256?", "fetch?"],
|
|
127
131
|
notes: ["节点绑定看 activities[].bizActions(默认 summary 已含,无绑定则键缺席);完整模板在 data(外置 detailArtifactId),要深层字段时投影写到叶子(如 --jq 'data.activities[].bizActions')——写整棵父节点会因总量超限再次被外置"],
|
package/dist/tool-search.js
CHANGED
|
@@ -221,6 +221,9 @@ const TOOL_PARENTS = Object.freeze({
|
|
|
221
221
|
"form.publish": ["model"], "form.get": ["model"], "form.draft": ["model"], "form.list": ["model"],
|
|
222
222
|
"listview.configure": ["model"], "listview.create": ["model"], "listview.get": ["model"], "listview.list": ["model"], "listview.delete": ["model"],
|
|
223
223
|
"datarule.create": ["model", "field"], "datarule.update": ["model", "field"], "datarule.list": ["model", "field"], "datarule.delete": ["model", "field"],
|
|
224
|
+
// R79 三期:流程清单以模型为索引(应用树→模型→逐模型解析流程)——句子里
|
|
225
|
+
// 点模型时给 workflow.list 父对象信号(与 listview/form 同族)。
|
|
226
|
+
"workflow.list": ["model"],
|
|
224
227
|
"method.create": ["service"], "method.update": ["service"], "method.get": ["service"], "method.delete": ["service"], "method.test": ["service"], "method.list": ["service"],
|
|
225
228
|
// r83(R79 二期):data.aggregate 是「模型数据的聚合」——句子里点模型时
|
|
226
229
|
// 与 data.list/data.load 同族给出父对象信号(此前只有 data 段命中)。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stalfh233/omc-cli",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.81",
|
|
4
4
|
"description": "CloudPivot 8.6 configuration capability CLI — governed, fail-closed, coverage-manifest bounded.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"commander": "14.0.3",
|
|
59
|
-
"omc-core": "0.6.
|
|
59
|
+
"omc-core": "0.6.81",
|
|
60
60
|
"proper-lockfile": "4.1.2",
|
|
61
61
|
"write-file-atomic": "6.0.0",
|
|
62
62
|
"zod": "^3.23.8",
|
|
@@ -74,6 +74,6 @@
|
|
|
74
74
|
"directory": "packages/omc-cli"
|
|
75
75
|
},
|
|
76
76
|
"optionalDependencies": {
|
|
77
|
-
"@stalfh233/omc-fake-platform": "0.6.
|
|
77
|
+
"@stalfh233/omc-fake-platform": "0.6.81"
|
|
78
78
|
}
|
|
79
79
|
}
|
|
@@ -168,8 +168,8 @@ only the section for the capability you need —
|
|
|
168
168
|
|
|
169
169
|
## 流程模板 `workflow`
|
|
170
170
|
|
|
171
|
-
- **能做哪些事**:流程模板 get_draft/get_published、create、update、publish、bindRule(事件处理器规则绑定)、delete、workitem.list、workflow.instanceActivity(实例节点状态诊断);参与人用组织对象。**流程运维三件套**(r64,测试提速定位):workflow.transfer 换审批人 / workflow.activate 跳转节点 / workflow.finish 手动结束(end 规则照常触发)——运维过的实例不能用于真实流程/权限验证。
|
|
172
|
-
- **工具**:`workflow.get_draft`、`workflow.setButtons`(节点「表单操作」按钮勾选)、`workflow.get_published`、`workflow.validate`、`workflow.create`、`workflow.update`、`workflow.publish`、`workflow.bindRule`、`workflow.delete`、`workflow.permissions`、`workflow.addPermission`、`workflow.removePermission`(发起权限:发布流程不会自动建这一行,缺它一律 40009)、`configure_workflow`、`workitem.list`、`workflow.instanceActivity`、`workflow.transfer`、`workflow.activate`、`workflow.finish`、`org.role.list`、`org.department.list`、`org.user.search`、`org.role.users`、`org.role.userScope`、`org.roleGroup.create`、`org.role.create`、`org.role.update`、`org.role.addUsers`、`org.role.removeUsers`、`org.role.setUserScope`、`org.department.create`、`org.department.update`、`org.department.delete`、`org.department.users`、`org.user.create`、`org.user.update`、`org.user.delete`、`org.user.info`、`org.user.departments`、`org.role.delete`、`org.roleGroup.delete`、`org.user.transferDepartment`
|
|
171
|
+
- **能做哪些事**:流程模板 workflow.list(应用内流程清单,以模型为索引)、get_draft/get_published、create、update、publish、bindRule(事件处理器规则绑定)、delete、workitem.list、workflow.instanceActivity(实例节点状态诊断);参与人用组织对象。**流程运维三件套**(r64,测试提速定位):workflow.transfer 换审批人 / workflow.activate 跳转节点 / workflow.finish 手动结束(end 规则照常触发)——运维过的实例不能用于真实流程/权限验证。
|
|
172
|
+
- **工具**:`workflow.list`、`workflow.get_draft`、`workflow.setButtons`(节点「表单操作」按钮勾选)、`workflow.get_published`、`workflow.validate`、`workflow.create`、`workflow.update`、`workflow.publish`、`workflow.bindRule`、`workflow.delete`、`workflow.permissions`、`workflow.addPermission`、`workflow.removePermission`(发起权限:发布流程不会自动建这一行,缺它一律 40009)、`configure_workflow`、`workitem.list`、`workflow.instanceActivity`、`workflow.transfer`、`workflow.activate`、`workflow.finish`、`org.role.list`、`org.department.list`、`org.user.search`、`org.role.users`、`org.role.userScope`、`org.roleGroup.create`、`org.role.create`、`org.role.update`、`org.role.addUsers`、`org.role.removeUsers`、`org.role.setUserScope`、`org.department.create`、`org.department.update`、`org.department.delete`、`org.department.users`、`org.user.create`、`org.user.update`、`org.user.delete`、`org.user.info`、`org.user.departments`、`org.role.delete`、`org.roleGroup.delete`、`org.user.transferDepartment`
|
|
173
173
|
- **recipe**:`omc describe workflow.bindRule --example workflow-handler-binding`;条件两级/一级:`omc describe workflow.update --example workflow-conditional-two-level-approval`
|
|
174
174
|
- **边界 / 陷阱**:greenfield 首版;`publish`/`bindRule` 不得在 `ValidateMessage[]` 拒绝时报告成功。运行时 workitem(提交/审批)走 `data.submit`;想知道实例停在哪/是否错派,用 `workflow.instanceActivity`(无 status=1=真停,参与人全是发起人=解析为空退回)。**发起权限**(`workflow.permissions` / `addPermission`)只有部门/角色/用户三种白名单,**没有「全员」选项**——缺权限行时非管理员通常不能发起(40009),想放开只能授一个够宽的部门/角色,不是「不建行=全员」。**行级数据权限 / 可见范围 / 申请人只看自己的单据不在工具覆盖内**(没有按登录人动态过滤的读面/写面);`org.role.setUserScope` 是角色成员的部门管理范围,不是单据行级可见范围。
|
|
175
175
|
|