@stalfh233/omc-cli 0.6.77 → 0.6.78
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.
|
@@ -38,7 +38,7 @@ export const RULE_NODE_GRAPH_WIRE = Object.freeze({
|
|
|
38
38
|
bizMethodMapping: `BIZ_ACTION / GET_LIST(BIZ_SERVICE) 的 methodMapping:{schemaCode,serviceCode,serviceMethodCode,methodCode?,inputMappings[],outputMappings[]};serviceCode+serviceMethodCode 是集成方法存在性对,methodCode 是模型级 BizMethod 注册槽。映射元素 = 8.6.26 MappingModel,codeType 按 int:${RULE_CODE_TYPES.map((t, i) => `${i}=${t}`).join("/")}(1=PROPERTY 须带 bizCode;0=CONST);**入参计算规则 = codeType:7(EXPRESSION) + bizCode(JSON 字符串)**:bizCode 形如 {"formula":"{amount}*0.13"} 的 JSON 字符串,{字段code} 引用;平台按 JSON.parse(bizCode).formula 求值(r79 真机 1.1.25:qty=3/price=7 → 服务收到 21.00);不是 expressionValue、也不是对象,缺失/空/非 JSON/无 formula 拒 rule-graph-bizaction-expression-missing——常量/字段/计算规则三选一。映射元素只校验语义键,其余键非语义透传(工具不按版本增删;index/required/displayName/bizCodeName 等 v2 键原样随行、模板不产出);required 以方法参数面为权威自动镜像(面缺席则映射保持缺席,显式矛盾本地拒绝)`,
|
|
39
39
|
bizMethodValidation: "rule.save 写前 wire 校验:图内每个 methodMapping 的服务+方法必须经 bizservice get_by_code + list_by_service_code 解析存在,且 inputMappings/outputMappings 的 serviceMethodParameterCode 必须命中方法声明的参数面,否则 refused(平台 update/publish 只拦服务缺失 BUSINESS_SERVICE_NOT_EXIST;publish 干门 550018 同语义拒参数面悬空——live 2026-09-12);RESTFUL/DATA_SQL 绑定目标必须带适配器必需 configJson 键——只有名字/参数面的注册壳 refused `rule-graph-bizmethod-registration-shell`(INTERNAL/扩展包方法不受此门)",
|
|
40
40
|
bizActionPersistence: "BIZ_ACTION 的 outputMappings 结果由 SYSTEM_CREATE/SYSTEM_UPDATE 持久化节点消费,故动作节点必须排在系统节点之前(Start→BizAction→SYSTEM_CREATE→End),否则合并结果不落库(live 2026-09-12 ticket 36 铁证:系统节点在动作前时 echoResult 恒 null,重排后回写生效——IntegrationServiceExecutor.mergeResult 只刷新 _input,SystemCreateActivityBehavior 持久化其 _input 输入);injectDefaultSystemNode 默认把系统节点补在 START 之后,有回写动作时须显式提供系统节点并置于动作之后",
|
|
41
|
-
triggerConditions: "节点触发条件(平台 i18n 模块 196233 节点属性表;evidence/form-conditions-and-rules-truth.md §4):UPDATE.filterCondition=**查找满足条件的主表数据**(要更新哪条;空 mainConditions=无条件下更新整表,bench23 病灶,干 lint 出 `rule-graph-filter-empty-main` warning)、UPDATE.filterSubCondition=子表条件;CREATE.findMainData=查找满足条件的主表数据(只影响是否新增)、CREATE.filterCondition=存在符合数据则不新增(aggregation 布尔=分组/单条新增);DELETE.filterCondition=删除满足条件的数据;ASSIGN.filterCondition=满足条件时赋值、triggerType∈CURRENT/RULE_VARIABLE;BIZ_ACTION.execConditionGroups=满足条件时执行业务方法;BRANCH.sourceInputMethod(PRE_OUT/OTHER_MODEL)/exitConditionGroups;通用 dataCondition=输入数据满足条件时执行、childTriggerConditionType∈ADD/MODIFY/DELETE;路由 routeCondition/matchType(ANY/ALL/CUSTOM)。除 BRANCH.exitConditionGroups 外,条件组与 filterCondition 同构 [[{targetSchemaDataItem,ruleConditionType,ruleValueType,...}]](DYNAMIC 来源键 currentSchemaDataItem);**BRANCH.exitConditionGroups 例外**:反序列化为 DataFilterCondition,出口叶用 [[{currentSchemaDataItem,ruleDataConditionType,ruleValueType,value}]](照抄 UI 键会 save+publish 过但运行时 50000
|
|
41
|
+
triggerConditions: "节点触发条件(平台 i18n 模块 196233 节点属性表;evidence/form-conditions-and-rules-truth.md §4):UPDATE.filterCondition=**查找满足条件的主表数据**(要更新哪条;空 mainConditions=无条件下更新整表,bench23 病灶,干 lint 出 `rule-graph-filter-empty-main` warning)、UPDATE.filterSubCondition=子表条件;CREATE.findMainData=查找满足条件的主表数据(只影响是否新增)、CREATE.filterCondition=存在符合数据则不新增(aggregation 布尔=分组/单条新增);DELETE.filterCondition=删除满足条件的数据;ASSIGN.filterCondition=满足条件时赋值、triggerType∈CURRENT/RULE_VARIABLE;BIZ_ACTION.execConditionGroups=满足条件时执行业务方法;BRANCH.sourceInputMethod(PRE_OUT/OTHER_MODEL)/exitConditionGroups;通用 dataCondition=输入数据满足条件时执行、childTriggerConditionType∈ADD/MODIFY/DELETE;路由 routeCondition/matchType(ANY/ALL/CUSTOM)。除 BRANCH.exitConditionGroups 外,条件组与 filterCondition 同构 [[{targetSchemaDataItem,ruleConditionType,ruleValueType,...}]](DYNAMIC 来源键 currentSchemaDataItem);**BRANCH.exitConditionGroups 例外**:反序列化为 DataFilterCondition,出口叶用 [[{currentSchemaDataItem,ruleDataConditionType,ruleValueType,value}]](照抄 UI 键会 save+publish 过但运行时 50000)。条件组内部语义:**叶组内各叶 AND**(同叶组 AND)、组间按 UI 组合表达;UPDATE/DELETE/ASSIGN 的 `mainConditions` 惯例是身份匹配 DYNAMIC + 固定条件 FIXED。",
|
|
42
42
|
example: RULE_NODE_GRAPH_EXAMPLE,
|
|
43
43
|
draftRowNote: "目标行查询不匹配 DRAFT 行。",
|
|
44
44
|
});
|
|
@@ -65,17 +65,18 @@ export function schedulerSettingDescription() {
|
|
|
65
65
|
return `SCHEDULER 规则的调度参数(对象或 JSON 字符串;写在规则行 schedulerSetting,不在节点上)。形状示例:${template}。枚举:triggerTimeType ∈ ${RULE_SCHEDULER_TRIGGER_TIME_TYPES.join("/")};executeType ∈ ${RULE_SCHEDULER_EXECUTE_TYPES.join("/")};cycleType ∈ ${RULE_SCHEDULER_CYCLE_TYPES.join("/")};endType ∈ ${RULE_SCHEDULER_END_TYPES.join("/")};dataSourceType ∈ ${RULE_DATA_SOURCE_TYPES.join("/")};triggerTimeType=DATE_FIELD 时必须带 triggerDataItem。证据:8.6.26 SchedulerSetting.java:27-52。`;
|
|
66
66
|
}
|
|
67
67
|
const RULE_SAVE_DESCRIPTION = describeTool("保存业务规则(upsert):`ruleCode` 已存在则 `businessrule/update`,否则 `businessrule/create`。", [
|
|
68
|
-
"这样可把规则配置进**平台预置触发规则**(`Create
|
|
68
|
+
"这样可把规则配置进**平台预置触发规则**(`Create`/`Update`/`Delete`/`Available`/`Cancel`/`GetList`/`Load`——数据增/改/删、流程生效/作废、取集合、加载详情),即在触发规则上追加动作节点。",
|
|
69
69
|
"`nodeGraph` 传 `{ nodes, routes, bizRuleType?, schedulerSetting? }`(可为数组或 JSON 字符串);工具拼成平台要求的 `node`/`route`/`schedulerSetting` JSON 字符串,保持 `enabled:false`/`status:DISABLED`。",
|
|
70
|
-
"**START/END
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"**BizMethod
|
|
70
|
+
"**START/END 必须显式给出(勿与 cp-model 的 scripts/rule.js 混淆——那套会自动补,本工具不补)**:`nodes` 必须含恰好 1 个 START 与 ≥1 个 END,缺了干 lint 直接拒(rule-graph-start-count / rule-graph-end-missing);工具只合成 CUSTOM_NODE/SYSTEM_* 预置节点。",
|
|
71
|
+
"**系统/定时/流程节点**:GET_LIST/LOAD/AVAILABLE/CANCEL/SCHEDULER/EXCEPTION/HINT 已入已知集并有形状模板;SCHEDULER 还须在 `nodeGraph.schedulerSetting` 传规则级调度形状(缺它则规则保存成功但永不触发;细节见 `--param nodeGraph`)。",
|
|
72
|
+
"**条件执行**:单分支→动作节点自身 `filterCondition`(UPDATE/DELETE/ASSIGN 的 `mainConditions`);多路→`BRANCH` 出口叶键 `{currentSchemaDataItem,ruleDataConditionType,ruleValueType,value}`(照抄 `targetSchemaDataItem`+`ruleConditionType` 会 save+publish 过但运行时 50000,`rule-graph-branch-condition-keys`);流程流转用 `ruleConditionGroup`(逐节点语义见 `--param nodeGraph`)。",
|
|
73
|
+
"**生命周期铁律**:update 只写 DRAFT 工作行,get/list 读 PUBLISH 面因此看不到变化——必须再 `rule.enable`(publish 出新版本 + 翻 DRAFT 启用开关)才会生效;DRAFT 保存不触发,submit(DRAFT→COMPLETED)触发 Create;`publish:true` 可同调发布(仅发布,启用仍走 `rule.enable`),readback 的 `published:false` 表示尚未发布。",
|
|
74
|
+
"**BizMethod 绑定**:BIZ_ACTION / GET_LIST(BIZ_SERVICE) 的 methodMapping 写前 wire 校验服务+方法真实存在(悬空即 refused `rule-graph-bizmethod-unresolved`——平台只拦服务不拦方法,绝不用注册壳冒充已发布 BizMethod);RESTFUL/DATA_SQL 只有名字/参数面的注册壳 refused `rule-graph-bizmethod-registration-shell`;映射 `required` 以方法参数面为权威镜像(逐键 DTO/codeType/非语义透传见 `--param nodeGraph`)。",
|
|
75
|
+
"**入参三选一**:`codeType:0` 常量 / `codeType:1` 字段 / `codeType:7` 计算规则(`bizCode` 必须是含 `formula` 的 JSON 字符串,不是 `expressionValue`、也不是对象);缺失/空串/非 JSON 即拒 `rule-graph-bizaction-expression-missing`(求值语义与映射全键见 `--param nodeGraph`)。",
|
|
75
76
|
"**EXPRESSION 值形状**:`ruleValueType:EXPRESSION` 时 `value` 必须是 {\"formula\":\"{字段A}+{字段B}\"}(大括号裸 code);门户设计器的 [code] 方括号式在这里不认。",
|
|
76
|
-
"**幻影 schema
|
|
77
|
-
"
|
|
78
|
-
"**跨模型 UPDATE
|
|
77
|
+
"**幻影 schema 门**:写前先以 bizmodels/get_all 探测模型存在(缺失 → refused `rule-schema-unresolved`,零规则面 wire 调用)——幻影 schema 的预置行一旦生成 API 不可删除(list 即重灌),必须在写前拒绝。",
|
|
78
|
+
"**输出回写排序**:BIZ_ACTION 的 outputMappings 由 SYSTEM_CREATE/SYSTEM_UPDATE 持久化节点消费——动作节点必须排在系统节点之前(`Start→BizAction→SYSTEM_CREATE→End`),否则合并结果不落库(echoResult 恒 null);系统节点注入位置见 `--param nodeGraph`。",
|
|
79
|
+
"**跨模型 UPDATE 三段语义**:`inputParam`=输入源(触发行或 QUERY 上游输出)→ `filterCondition` 按 `targetSchemaCode` 查目标行 → `dataActions` 写入目标行;QUERY 目标行不自动成为输入源,child fan-out 保持 fail-closed(见 `--example rule-cross-model-create`)。",
|
|
79
80
|
]);
|
|
80
81
|
export const BUSINESSRULE_LANE_CONTRACT = Object.freeze({
|
|
81
82
|
lane: LANES.businessrule,
|
|
@@ -147,6 +148,7 @@ export const BUSINESSRULE_LANE_CONTRACT = Object.freeze({
|
|
|
147
148
|
"ticket 02 (2026-09-11): update writes DRAFT; get/list read PUBLISH; rule.enable is required for the rule to take effect",
|
|
148
149
|
"ticket 27 (8.6.26 source): RuleNodeType enum has GET_LIST/LOAD/CANCEL/AVAILABLE/SCHEDULER/EXCEPTION/HINT (RuleNodeType.java:26-42); GetListNode.dataSourceType, ExceptionNode.errMsg, HintNode.content are the only semantic node fields; SchedulerSetting is a rule-row column (BusinessRuleModel.java:52-53)",
|
|
149
150
|
"ticket 35 + 96 (8.6.26 source): BizActionNode.methodMapping is BizMethodMappingModel{schemaCode,serviceCode,serviceName,serviceMethodCode,serviceMethodName,methodCode,businessRuleId,nodeCode,inputMappings,outputMappings}; MappingModel has NO index/required/displayName in 8.6.26 (fwb v2 keys ride along as NON-semantic passthrough — the tool neither adds nor drops them by version); CodeType serializes as int index (0=CONST,1=PROPERTY); BusinessRuleFacadeImpl.addBizMethodMapping gates SERVICE existence only (BUSINESS_SERVICE_NOT_EXIST) — a dangling serviceMethodCode is silently disabled at app import (BizModelExportImportService.parseBusinessRule:2063-2066); ticket 96: mapping `required` mirrors the method parameter face (absent face key keeps the mapping absent), and a RESTFUL/DATA_SQL binding whose method lacks adapter-required configJson keys is refused as a registration shell",
|
|
151
|
+
"r78 batch-3 provenance (removed from the tools/list description, kept here): START/END must be explicit — live 2026-09-22, the tool never auto-adds them (cp-model scripts/rule.js does); update writes DRAFT / get-list reads PUBLISH, rule.enable is required — live 2026-09-11 (ticket 02); BIZ_ACTION codeType:7 formula evaluation — AI-Platform 1.1.25 echo (qty=3/price=7 → 21.00), r79; phantom-schema auto-fill of 7 preset rules — ticket 96; outputMappings ordering vs SYSTEM_* — ticket 36",
|
|
150
152
|
]),
|
|
151
153
|
tools: Object.freeze({
|
|
152
154
|
"rule.list": Object.freeze({
|
|
@@ -164,7 +166,7 @@ export const BUSINESSRULE_LANE_CONTRACT = Object.freeze({
|
|
|
164
166
|
// 295,400B,HEAD 4c524b83 实测 295,331 仅余 69B——加对照句即红门)。对照
|
|
165
167
|
// 教学住 read-shapes 的 notes[0](默认 describe 面即回,不进 tools/list);
|
|
166
168
|
// MCP 面的同款对照由 omc_graph_explore 的 description 承担。
|
|
167
|
-
description: "
|
|
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(删字段前的影响面;字段 code 跨模型不唯一,建议配 schemaCodes 限范围)。实现为客户端聚合(model.list→rule.list→rule.get 全扫),输出只回命中行。第一版不含:条件叶子里的字段引用、datarule 引用、workflow.bindRule 绑定。",
|
|
168
170
|
}),
|
|
169
171
|
"rule.save": Object.freeze({
|
|
170
172
|
scope: "dead-state CRUD conditional node graphs",
|
|
@@ -11,7 +11,7 @@ import { LANES } from "./lane-ids.js";
|
|
|
11
11
|
* required per form" flags are a separate engine (CONTEXT: 两套引擎).
|
|
12
12
|
*/
|
|
13
13
|
export const DATARULE_WIRE = Object.freeze({
|
|
14
|
-
list: "GET bizdatarule/list?schemaCode=<schemaCode>[&dataRuleType=<1..5>] -> BizDataRuleModel[]",
|
|
14
|
+
list: "GET bizdatarule/list?schemaCode=<schemaCode>[&dataRuleType=<1..5>] -> BizDataRuleModel[]. 子表规则按**主表** schemaCode 查:8.6.26 真机 bench40_order_item 按子表查 2 行(缺 subtotal 的 type2 镜像行),按主表 bench40_order 查 16 行(含该 type2 行)——公式字段(FORMULA t100)的 type2 镜像行只在主表范围可见;普通数值字段的子表 type2 规则按子表查是有的。存量坏形状行由 datarule.list 以 shapeWarning 标出",
|
|
15
15
|
create: "POST bizdatarule/create body BizDataRuleModel {schemaCode,propertyCodes (array; real designer binding),propertyCode (legacy single),dataRuleType,options (JSON string),checkType?,childRule?,name?,sortKey?}; create requires schemaCode + dataRuleType + a target field; options.propertyCodes mirrors the binding (real 2026-09-23 rows bind via the ARRAY, not the singular column)",
|
|
16
16
|
update: "POST bizdatarule/update body BizDataRuleModel; requires id + schemaCode + dataRuleType; the full-row overwrite preserves the existing propertyCodes when the caller omits a target",
|
|
17
17
|
delete: "bizdatarule/delete?id=<ruleId> (@RequestParam String id) with list exact-absence readback",
|
|
@@ -23,7 +23,7 @@ export const DATARULE_WIRE = Object.freeze({
|
|
|
23
23
|
optionsEncoding: "the engine JSON-parses the `options` column and reads requiredFormula / readonlyCondition / displayFormula / verifyFormula / shortTextStitch (whose VALUE is itself a JSON string carrying `formula`); send options as a stringified object",
|
|
24
24
|
expressionSyntax: "field references are `{fieldCode}` (e.g. {amount}>5000). This CLI does NOT publish or validate an expression grammar: operators, functions, escaping, and coercion are unspecified here, and rule-action EXPRESSION must NOT be assumed to share FORMULA(100)'s parser without live evidence. A constant `\\\"true\\\"` is the known always-on form. Treat a saved expression as unverified until the portal form proves it.",
|
|
25
25
|
acceptanceBoundary: "types 3/4/5 are form-interaction rules; `data.*` does NOT run the form validation layer, so the CLI cannot prove a required/readonly/display rule true or false. Acceptance is a portal-form manual check — never report a saved rule as verified from `data.*` readback alone.",
|
|
26
|
-
formHistoryOpt: "same field-level rule engine as form attributes[].historyOpt; distinct from the per-form field-control rule engine (dataRuleType 3/4/5 must not be confused with form-control visible/readonly/required)",
|
|
26
|
+
formHistoryOpt: "same field-level rule engine as form attributes[].historyOpt; distinct from the per-form field-control rule engine (dataRuleType 3/4/5 must not be confused with form-control visible/readonly/required). 设计器**设计态** Set/Unset 读 bizdatarule/list(network capture 2026-09-23)",
|
|
27
27
|
});
|
|
28
28
|
const DATARULE_SCOPE = "create update delete readback";
|
|
29
29
|
export const DATARULE_LANE_CONTRACT = Object.freeze({
|
|
@@ -78,20 +78,20 @@ export const DATARULE_LANE_CONTRACT = Object.freeze({
|
|
|
78
78
|
description: describeTool("List field-level data rules of a model (bizdatarule/list), optionally filtered by `dataRuleType` 1–5.", [
|
|
79
79
|
"`schemaCode` is required; `dataRuleType` omits every type when absent.",
|
|
80
80
|
"Each row decodes to {id, schemaCode, propertyCode, dataRuleType, checkType, childRule, name, sortKey, options}.",
|
|
81
|
-
"**子表规则用主表 schemaCode 查**:平台对 `schemaCode=<子表>` 只返回部分行——公式字段(FORMULA t100)的 type2
|
|
81
|
+
"**子表规则用主表 schemaCode 查**:平台对 `schemaCode=<子表>` 只返回部分行——公式字段(FORMULA t100)的 type2 镜像行不返回,按主表查才含(bench40_* 案卷见 `omc contract G1-datarule --full`)。公式字段的公式读 `field.list` 的 `options.formulaConfig`(字段属性,不是独立规则);普通数值字段的子表 type2 规则按子表查是有的。",
|
|
82
82
|
]),
|
|
83
83
|
}),
|
|
84
84
|
"datarule.create": Object.freeze({
|
|
85
85
|
scope: DATARULE_SCOPE,
|
|
86
86
|
description: describeTool("Create a field-level data rule (bizdatarule/create) and read it back from the authoritative list. **表单运行时条件优先 `field.update`**(本工具=字段级引擎/设计器读面)。", [
|
|
87
|
-
"`dataRuleType` → options 键:
|
|
88
|
-
"`childRule:true` 仅用于已发布的子表列(propertyCode/propertyCodes 必须是子表列 code;主表字段省略)。子表列在发布面不可见时先用 field.create + field.publish 生成列,不要直接 POST datarule.create
|
|
89
|
-
"**⚠️ type3/4/5
|
|
90
|
-
"**类型3/4/5 条件串协议(平台 create 不校验,坏形状落库即雷,工具按此协议拒绝)**:`{字段code} 操作符 [值]`。操作符取 **bizdatarule 词表**(与字段 options 的表单交互引擎不同——那是符号式):**中文**
|
|
91
|
-
"`options` is a JSON object sent to the wire as a JSON string
|
|
92
|
-
"类型2(计算/拼接):`options.shortTextStitch`(或 `value`)的值**必须是含 `formula` 的 JSON
|
|
87
|
+
"`dataRuleType` → options 键:3→displayFormula、4→requiredFormula(无条件必填=`\"true\"`)、5→readonlyCondition;1/2 的键与逐类型白名单见 `dataRuleType` 参数。8 EXTENSION out of scope.",
|
|
88
|
+
"`childRule:true` 仅用于已发布的子表列(propertyCode/propertyCodes 必须是子表列 code;主表字段省略)。子表列在发布面不可见时先用 field.create + field.publish 生成列,不要直接 POST datarule.create。",
|
|
89
|
+
"**⚠️ type3/4/5 两个读面**:门户**运行时**读**字段 options**(`field.create/update` 写),设计器**设计态** Set/Unset 读 **bizdatarule/list**(本行)。**type3/4/5 规则单独不会让门户表单控件变必填/只读**,符号式经 `historyOpt` 镜像还会让表单渲染崩溃——运行时条件请用中文操作符;表单条件优先走 `field.update`(自动配对本行)。",
|
|
90
|
+
"**类型3/4/5 条件串协议(平台 create 不校验,坏形状落库即雷,工具按此协议拒绝)**:`{字段code} 操作符 [值]`。操作符取 **bizdatarule 词表**(与字段 options 的表单交互引擎不同——那是符号式):**中文** 等于/不等于/大于/小于/大于等于/小于等于/包含/不包含/包含全部/不包含全部/包含任意一个/不包含任意一个/等于任意一个/属于/不属于/介于/为空/不为空,也接受符号 `==` `!=` `>` `<` `>=` `<=` `Contains` `IsEmpty` 等。为空/不为空**不带值**(`{field} 不为空`);其余带值(JSON 对象或标量)。多条件 ` && `、多组 ` || `。示例 type4:`options:{requiredFormula:\"{amount} 等于 {\\\"valueType\\\":\\\"specifyOption\\\",\\\"value\\\":\\\"A\\\"}\"}`。**字段绑定用 `propertyCodes`(数组)**,工具自动把 `options.propertyCodes` 也补上。",
|
|
91
|
+
"`options` is a JSON object sent to the wire as a JSON string(逐类型必读键见 `options` 参数面)。",
|
|
92
|
+
"类型2(计算/拼接):`options.shortTextStitch`(或 `value`)的值**必须是含 `formula` 的 JSON 对象字符串**,裸串会被工具拒绝(否则引擎返回 null → 误报 305003 死循环);顶层没有 `expression` 键——它只是该嵌套 JSON 内部的字段名(可照抄 `--example field-compute-rule`)。",
|
|
93
93
|
"Missing type or schemaCode is refused before any write.",
|
|
94
|
-
"
|
|
94
|
+
"根因提示:类型2 CALCULATE 在未发布应用上会报假死循环 305003——工具反推后拒 app-not-published;类型 3/4/5 不受影响(误判机制见 `--example field-compute-rule`)。",
|
|
95
95
|
]),
|
|
96
96
|
}),
|
|
97
97
|
"datarule.update": Object.freeze({
|
|
@@ -23,7 +23,7 @@ export const RULE_SCHEMA_GATE = Object.freeze({
|
|
|
23
23
|
});
|
|
24
24
|
export function ruleEnableDescription() {
|
|
25
25
|
const chain = RULE_ENABLE_CHAIN;
|
|
26
|
-
return `启用业务规则(businessrule/publish + businessrule/enable
|
|
26
|
+
return `启用业务规则(businessrule/publish + businessrule/enable)。两步缺一不可:${chain.publish},${chain.enable}——${chain.dispatch},${chain.conclusion}。${chain.readbackRule}。${RULE_SCHEMA_GATE.reason}。`;
|
|
27
27
|
}
|
|
28
28
|
export function ruleDisableDescription() {
|
|
29
29
|
return `停用业务规则(businessrule/update)。读回规则行后以整行 + \`enabled:false\` 作为请求体提交。${RULE_ENABLE_CHAIN.readbackRule}。${RULE_SCHEMA_GATE.reason}。`;
|
package/dist/read-shapes.js
CHANGED
|
@@ -162,9 +162,9 @@ const READ_SHAPES = {
|
|
|
162
162
|
],
|
|
163
163
|
},
|
|
164
164
|
"datarule.list": {
|
|
165
|
-
keys: ["rules:array<{id,propertyCode,dataRuleType,checkType,optionsKeys?}>", "rulesCount", "modelPresent", "rulesOmitted?"],
|
|
165
|
+
keys: ["rules:array<{id,propertyCode,dataRuleType,checkType,optionsKeys?,shapeWarning?}>", "rulesCount", "modelPresent", "rulesOmitted?"],
|
|
166
166
|
notes: [
|
|
167
|
-
"超阈值时内联 rules 是库存摘要(rulesOmitted:true),完整 options 在 detailArtifactId",
|
|
167
|
+
"超阈值时内联 rules 是库存摘要(rulesOmitted:true),完整 options 在 detailArtifactId;存量坏形状行带 shapeWarning(条件串协议见 datarule.create)",
|
|
168
168
|
"模型不存在 → ok + modelPresent:false + rules:[](与 rule.list 同口径)",
|
|
169
169
|
],
|
|
170
170
|
},
|
|
@@ -422,8 +422,9 @@ const ruleCrossModelCreate = Object.freeze({
|
|
|
422
422
|
"**`originatorValueType:\"DYNAMIC\"` 的 `originatorValue` 必须指向人员字段**(STAFF_SELECTOR 等);指向文本/编号字段会致发起人错误或为空。",
|
|
423
423
|
"「当前时间」不是规则的 value 类型:`ruleValueType:\"SYSTEM\"` 不会填 now(真机 2026-10-08 落 null)。要让下游日期=生成时刻,把该**日期字段的默认值**设为「当前时间」(平台 `{value:\"current\"}`),或走二开;纯规则映射填不出 now。",
|
|
424
424
|
"上游是 QUERY 时 `inputParam=\"_<QUERY节点code>_output\"`(QUERY 查 N 行→CREATE 逐条生成即 N→N 扇出,真机验证支持,同/跨模型均可);否则 `\"_input\"`。",
|
|
425
|
-
"跨模型 UPDATE 三段:`inputParam`/`currentSchemaDataItem`=输入源(触发行或 QUERY 输出)→ `filterCondition` 查 `targetSchemaCode` 目标行 → `dataActions` 写入。QUERY 目标行非隐式输入源;child fan-out 保持 fail-closed
|
|
425
|
+
"跨模型 UPDATE 三段:`inputParam`/`currentSchemaDataItem`=输入源(触发行或 QUERY 输出)→ `filterCondition` 查 `targetSchemaCode` 目标行 → `dataActions` 写入。QUERY 目标行非隐式输入源;child fan-out 保持 fail-closed(用显式中间字段/映射/二开)。",
|
|
426
426
|
"`QUERY` 节点只能查**主模型行**:查子表 schema(`parent.child` 或子 schema 名)空条件返回 0 行、带条件 550018(真机 2026-10-08)——逐子表明细扇出才需要二开。",
|
|
427
|
+
"**删服务/模型/字段前先扫引用面**:`rule.references`(kind=service/model/field)一次聚合 model.list→rule.list→rule.get,替代 r23 现场的全平台枚举——agent 为查『谁引用了服务 X』枚举了 147 个 schema×ruleCode 组合、171 次 rule.get(229KB / ~50 回合)。跨模型规则正是这些引用的主要来源(targetObjectCode / methodMapping.schemaCode / bizCode),改服务方法或删目标字段前先跑它。",
|
|
427
428
|
"跨模型 CREATE/UPDATE 真机验证支持(2026-09-28 / 2026-10-08);承载规则的触发时机要对(Create 在提交时触发、Update 只在 data.update 触发、TIMING 定时触发)。",
|
|
428
429
|
"**必须回读目标行**:`errcode:0` ≠ dataActions 落库(r57:日志 successful 但业务字段全 null)。用 data.load 断言;不落库改走在线编码。",
|
|
429
430
|
"**CREATE 目标是已发布流程的模型时**(2026-10-27 真机四格矩阵):不传 startWorkflow → 建行**不发起流程**;要发起必须 startWorkflow:true + targetWorkflowCode:<该流程> + originatorValue 用户对象数组 [{\"id\":\"<userId>\",\"name\":\"<名>\"}](传对象 {} → 触发提交 50000 expect '[';无效 id → 50000 发起人不存在);设计器手工编辑可打开该开关,API 与设计器配置会漂移,rule.get 回读核对。",
|
package/dist/recipes/datarule.js
CHANGED
|
@@ -76,6 +76,7 @@ const dataruleCalcRule = Object.freeze({
|
|
|
76
76
|
{ code: "wire-business", action: "305003 假死循环常见于未发布应用或坏 formula 形状;确认应用已发布、formula 为合法引用" },
|
|
77
77
|
...commonRecovery,
|
|
78
78
|
],
|
|
79
|
+
notes: "305003 误判机制:未发布应用上 checkCalculateRulesDeadCycle 在 getAppFunctionByCode 为 null 时按 schemaCode.propertyCode 拼接、口径不一致 → 类型2 CALCULATE 报假死循环;工具反推后拒 app-not-published,类型 3/4/5 不受影响",
|
|
79
80
|
requiresEnvironmentDerivedIds: false,
|
|
80
81
|
});
|
|
81
82
|
const dataruleSubtableSum = Object.freeze({
|
|
@@ -137,6 +138,7 @@ const dataruleChildColumn = Object.freeze({
|
|
|
137
138
|
preconditions: ["**拼装器优先**:简单表达式用 `omc compute --formula '{a}*0.4+{b}*0.3'`;**条件聚合**用 `omc compute --formula '{<子表>.<子列>}' --where '<子列> = <值>'`(自动编译 COUNTIF/SUMIF)——两者都默认 dry-run、`--apply` 写入。本配方仅用于拼装器表达不了的条件分支等复杂场景。",
|
|
138
139
|
"**子表列 `amount` 是普通数值字段(不是「计算公式」字段)**,且是子表内的列(schemaCode=子表字段 code)"],
|
|
139
140
|
conditionalRequirements: [
|
|
141
|
+
"**子表列规则必须随 field.create + field.publish 生成**:子表列在发布面不可见时,`datarule.create` 的发布面校验会拒——childRule 的三种形态(propertyCode / propertyCodes / options.propertyCodes)全部被拒(r34a-F12 真机),不要直接 POST;先 field.create + field.publish 把子表列生成并发布,再建规则。主表字段不受此限。",
|
|
140
142
|
"**子表内列引用用 `{子表schemaCode.子列code}` 点号全限定**(真机 2026-10-08 设计器产出:`{prop_repair_detail.qty}*{prop_repair_detail.unit_price}`);不要写裸 `{qty}`。",
|
|
141
143
|
"**给全 `editorText`/`editorMark`**:`editorMark=\"field-omc0001\"`,每个引用包成 `<field-omc0001>子表.子列</field-omc0001>`(**标签内裸 token,不带花括号**——编辑器会自己套 `{}`);缺或带括号则设计器标红/已失效。",
|
|
142
144
|
"计算由门户前端执行、API 不回填(门户填表确认)。",
|
|
@@ -162,7 +164,7 @@ const dataruleRequired = Object.freeze({
|
|
|
162
164
|
sortKey: 1,
|
|
163
165
|
},
|
|
164
166
|
preconditions: ["目标字段已发布;amount 字段 code 已确认"],
|
|
165
|
-
conditionalRequirements: ["条件串必须是 {field} OP {JSON valueType} 三段单空格;多条件用
|
|
167
|
+
conditionalRequirements: ["条件串必须是 {field} OP {JSON valueType} 三段单空格;多条件用 &&/||。**中文操作符是主用法**(实测 146 条真实规则以此为主)——也接受符号 `==` `!=` `>` `<` `>=` `<=` `Contains` `IsEmpty`,但符号式经 `historyOpt` 镜像会让门户表单渲染崩溃。"],
|
|
166
168
|
priorToolReferences: [{ tool: "field.list", args: { environment, schemaCode: model, published: true }, purpose: "确认 leave_amount 与 leave_reason 已发布" }],
|
|
167
169
|
dryRun: { supported: true, command: `omc call datarule.create --env ${environment} --dry-run --args '<recipe.args>'`, notes: "dry-run 校验类型/条件协议,不写入" },
|
|
168
170
|
expectedReadback: { readback: { dataRuleType: 4, options: { requiredFormula: "<protocol>" } } },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stalfh233/omc-cli",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.78",
|
|
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.78",
|
|
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.78"
|
|
78
78
|
}
|
|
79
79
|
}
|