@stalfh233/omc-cli 0.6.33 → 0.6.34
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/capability-overview.js +1 -1
- package/dist/field-families.js +55 -1
- package/dist/lanes/field.js +10 -1
- package/dist/lanes/runtime-data.js +20 -2
- package/dist/lanes/workflow-contract.js +1 -1
- package/dist/lanes/workflow.js +13 -4
- package/dist/recipes/field.js +19 -14
- package/dist/recipes/workflow.js +3 -2
- package/package.json +3 -3
- package/skills/omc-business-configuration.md +3 -1
- package/skills/omc-capabilities.md +1 -1
|
@@ -227,7 +227,7 @@ export const CAPABILITY_CUES = Object.freeze({
|
|
|
227
227
|
app: ["应用", "门户", "分组"],
|
|
228
228
|
dictionary: ["字典", "选项来源", "选项", "键值", "树型"],
|
|
229
229
|
model: ["模型", "对象", "主数据", "物理删除", "汇总表", "统计表", "汇总对象", "月度汇总表", "汇总模型"],
|
|
230
|
-
field: ["字段", "属性", "子表", "明细", "下拉", "单选", "多选", "附件", "人员", "部门", "日期", "数值", "文本", "关联", "公式", "计算", "计算字段", "求和", "汇总", "合计", "回主表", "超链接", "地址", "表单层", "必填", "只读", "条件必填", "恒必填", "条件只读", "恒只读", "表单必填", "表单只读"],
|
|
230
|
+
field: ["字段", "属性", "子表", "明细", "下拉", "单选", "多选", "附件", "人员", "部门", "日期", "数值", "文本", "关联", "公式", "计算", "计算字段", "求和", "汇总", "合计", "回主表", "超链接", "地址", "单据号", "流水号", "编号自动生成", "表单层", "必填", "只读", "条件必填", "恒必填", "条件只读", "恒只读", "表单必填", "表单只读"],
|
|
231
231
|
form: ["表单", "页面", "布局", "控件", "只读", "显示"],
|
|
232
232
|
// r10 (2026-10-22, issue §1.4): an ask for a FORM toolbar button was
|
|
233
233
|
// answered "CLI 无按钮能力" — the capability exists (`listview.configure`
|
package/dist/field-families.js
CHANGED
|
@@ -11,7 +11,7 @@ export { FIELD_FAMILY_LIST, FIELD_CONTROL_CODES };
|
|
|
11
11
|
export const propertyTypeArg = z
|
|
12
12
|
.string()
|
|
13
13
|
.min(1)
|
|
14
|
-
.describe(`field family. Accepted: ${FIELD_FAMILY_LIST}, CHILD_TABLE (requires \`subFields\`). **NUMERICAL 必填 options.scale**(0..8
|
|
14
|
+
.describe(`field family. Accepted: ${FIELD_FAMILY_LIST}, CHILD_TABLE (requires \`subFields\`). **NUMERICAL 必填 options.scale**(0..8)。单据号=SHORT_TEXT + options.formPropertyType:100 + options.seqNoSetting(段构建器),见配方 field-serial-number。WORK_SHEET=关联单选;RELEVANCE_DATA=引用关联列;MULT_WORK_SHEET=关联多选。Out of coverage: OCR/ELECTRONIC_SIGN/nested CHILD_TABLE. Selection→\`choices\`(dictionary 用 optionsSet);relation→\`relativeCode\`+\`options\`。`);
|
|
15
15
|
export const relativeCodeArg = z
|
|
16
16
|
.string()
|
|
17
17
|
.optional()
|
|
@@ -183,6 +183,8 @@ export const fieldOptionsArg = z
|
|
|
183
183
|
referenceField: z.string().optional().describe("RELEVANCE_DATA(16) required: referenced field code on the related model"),
|
|
184
184
|
referenceFieldPropertyType: z.number().int().optional().describe("RELEVANCE_DATA(16) required: referenced field propertyType (BizPropertyType int)"),
|
|
185
185
|
referenceFieldControlType: z.number().int().optional().describe("RELEVANCE_DATA(16): referenced field control type (BizFormPropertyType int)"),
|
|
186
|
+
formPropertyType: z.number().int().optional().describe("单据号控件使用 100(SHORT_TEXT 字段的 options 控件类型)"),
|
|
187
|
+
seqNoSetting: z.array(z.record(z.string(), z.unknown())).optional().describe("单据号段构建器:CONSTANT/DELIMITER/DATE/PROPERTY/SEQNO/UID;非空数组。DATAITEM 不是段类型"),
|
|
186
188
|
// r28b F1: scale is the hard NUMERICAL gate — declare it here so
|
|
187
189
|
// `describe field.create --param options` / `--param propertyType` both
|
|
188
190
|
// surface the constraint before preflight. Bounds stay in
|
|
@@ -256,6 +258,9 @@ export const FIELD_TYPE_SYNONYMS = Object.freeze({
|
|
|
256
258
|
金额: "NUMERICAL(2)(+ options.scale 小数位数)",
|
|
257
259
|
数值: "NUMERICAL(2)",
|
|
258
260
|
编号: "SHORT_TEXT(0)",
|
|
261
|
+
单据号: "序列号字段:SHORT_TEXT(0) + options.formPropertyType:100 + options.seqNoSetting(段构建器);见配方 field-serial-number",
|
|
262
|
+
流水号: "序列号字段:SHORT_TEXT(0) + options.formPropertyType:100 + options.seqNoSetting(段构建器);见配方 field-serial-number",
|
|
263
|
+
编号自动生成: "序列号字段:SHORT_TEXT(0) + options.formPropertyType:100 + options.seqNoSetting(段构建器);见配方 field-serial-number",
|
|
259
264
|
文本: "SHORT_TEXT(0) / LONG_TEXT(1)",
|
|
260
265
|
单选: "RADIO(12) / DROPDOWN_BOX(14)(字典来源)",
|
|
261
266
|
多选: "CHECKBOX(13) / DROPDOWN_MULTI_BOX(15)",
|
|
@@ -268,6 +273,55 @@ export const FIELD_TYPE_SYNONYMS = Object.freeze({
|
|
|
268
273
|
是或否: "LOGICAL(4)",
|
|
269
274
|
布尔: "LOGICAL(4)",
|
|
270
275
|
});
|
|
276
|
+
/** 8.6.26 SequenceNoRuleType.java: the only platform segment types. */
|
|
277
|
+
export const SEQUENCE_NO_SEGMENT_TYPES = Object.freeze(["CONSTANT", "DELIMITER", "DATE", "PROPERTY", "SEQNO", "UID"]);
|
|
278
|
+
/**
|
|
279
|
+
* Validate the field.create-only serial-number segment builder. DATAITEM is
|
|
280
|
+
* deliberately refused: in the designer it is a resetDate display value,
|
|
281
|
+
* not a SequenceNoRuleType (8.6.26 decompile, r50 live 2026-11-10).
|
|
282
|
+
*/
|
|
283
|
+
export function lintSequenceNoSetting(options) {
|
|
284
|
+
if (!options || typeof options !== "object" || Array.isArray(options))
|
|
285
|
+
return { warnings: [] };
|
|
286
|
+
const record = options;
|
|
287
|
+
if (record.seqNoSetting === undefined)
|
|
288
|
+
return { warnings: [] };
|
|
289
|
+
const setting = record.seqNoSetting;
|
|
290
|
+
if (!Array.isArray(setting) || setting.length === 0) {
|
|
291
|
+
throw new ToolRefusalError({ status: "refused", blocker: "sequence-setting-invalid", message: "options.seqNoSetting 必须是非空段数组;每段至少包含 type,序列号示例见配方 field-serial-number" });
|
|
292
|
+
}
|
|
293
|
+
const warnings = [];
|
|
294
|
+
for (const [index, raw] of setting.entries()) {
|
|
295
|
+
const path = `options.seqNoSetting[${index}]`;
|
|
296
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw)) {
|
|
297
|
+
throw new ToolRefusalError({ status: "refused", blocker: "sequence-segment-invalid", path, message: `${path} 必须是对象,且 type 必须为 ${SEQUENCE_NO_SEGMENT_TYPES.join("/")}` });
|
|
298
|
+
}
|
|
299
|
+
const segment = raw;
|
|
300
|
+
const type = segment.type;
|
|
301
|
+
if (type === "DATAITEM") {
|
|
302
|
+
throw new ToolRefusalError({ status: "refused", blocker: "sequence-segment-type-invalid", path, message: "DATAITEM 是设计师 UI 的 resetDate 显示值,不是段类型;分组计数写 SEQNO 段 resetDate:\"none\"+propertyCodes:[字段code];取行内字段值用 PROPERTY 段" });
|
|
303
|
+
}
|
|
304
|
+
if (typeof type !== "string" || !SEQUENCE_NO_SEGMENT_TYPES.includes(type)) {
|
|
305
|
+
throw new ToolRefusalError({ status: "refused", blocker: "sequence-segment-type-invalid", path, message: `${path}.type 不支持 ${String(type)};合法段类型:${SEQUENCE_NO_SEGMENT_TYPES.join("/")}` });
|
|
306
|
+
}
|
|
307
|
+
if (type === "SEQNO" && segment.value !== undefined && segment.value !== null) {
|
|
308
|
+
const value = segment.value;
|
|
309
|
+
if (typeof value === "object" && !Array.isArray(value)) {
|
|
310
|
+
const detail = value;
|
|
311
|
+
if (detail.resetDate !== undefined && !["NONE", "DAY", "MONTH", "YEAR", "none", "day", "month", "year"].includes(String(detail.resetDate))) {
|
|
312
|
+
throw new ToolRefusalError({ status: "refused", blocker: "sequence-reset-date-invalid", path: `${path}.value.resetDate`, message: `${path}.value.resetDate 必须是 NONE/DAY/MONTH/YEAR(或平台保存态小写 none/day/month/year)` });
|
|
313
|
+
}
|
|
314
|
+
if (detail.propertyCodes !== undefined && (!Array.isArray(detail.propertyCodes) || detail.propertyCodes.length === 0 || detail.propertyCodes.some((code) => typeof code !== "string" || code.trim() === ""))) {
|
|
315
|
+
throw new ToolRefusalError({ status: "refused", blocker: "sequence-property-codes-invalid", path: `${path}.value.propertyCodes`, message: `${path}.value.propertyCodes 若出现必须是非空字符串数组;分组计数示例:propertyCodes:[字段code]` });
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
if (type === "DATE" && typeof segment.value === "string" && /YYYY|DD/.test(segment.value)) {
|
|
320
|
+
warnings.push({ code: "sequence-date-format-advisory", path: `${path}.value`, message: `${path}.value 使用 Java 日期格式;大写 YYYY/DD 分别是 week-year/day-of-year,可能静默产错值(真机 r50 2026-11-10:YYYYMMDD→202611314)。请使用小写 yyyyMMdd。` });
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
return { warnings };
|
|
324
|
+
}
|
|
271
325
|
/** A "did you mean" hint for a family name that is actually a Chinese concept. */
|
|
272
326
|
export function fieldTypeHint(type) {
|
|
273
327
|
const commonAliases = {
|
package/dist/lanes/field.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { ENDPOINTS } from "../endpoints.js";
|
|
3
3
|
import { fieldChangeWireBody, fieldUpdateWireBody, prepareFieldChange, prepareFieldUpdate } from "../field-change.js";
|
|
4
|
-
import { aggregationSelfSchemaMessage, aggregationTargetsOwnSchema, choicesArg, childColumnsOf, FIELD_PROPERTY_TYPES, fieldOptionsArg, fieldTypeLabel, numericalScaleWarning, propertyTypeArg, relativeCodeArg, stripAggregationPrefix, subFieldArg, SYSTEM_FIELD_CODES, assertFieldFamilyAllowed, assertSelectionChoicesAllowed, assertRelationTargetExists, relationPublishFailureMessage, } from "../field-families.js";
|
|
4
|
+
import { aggregationSelfSchemaMessage, aggregationTargetsOwnSchema, choicesArg, childColumnsOf, FIELD_PROPERTY_TYPES, fieldOptionsArg, fieldTypeLabel, numericalScaleWarning, propertyTypeArg, relativeCodeArg, stripAggregationPrefix, subFieldArg, SYSTEM_FIELD_CODES, assertFieldFamilyAllowed, assertSelectionChoicesAllowed, assertRelationTargetExists, relationPublishFailureMessage, lintSequenceNoSetting, } from "../field-families.js";
|
|
5
5
|
import { capabilityArg, environmentArg } from "../args.js";
|
|
6
6
|
import { governedRead } from "../read.js";
|
|
7
7
|
import { writeTool } from "../write.js";
|
|
@@ -369,6 +369,10 @@ export function registerFieldLane(tools) {
|
|
|
369
369
|
...(conditions.length > 0 ? { conditions } : {}),
|
|
370
370
|
...(field.shapeWarning !== undefined ? { shapeWarning: field.shapeWarning } : {}),
|
|
371
371
|
...(field.origin !== undefined ? { origin: field.origin } : {}),
|
|
372
|
+
...((() => {
|
|
373
|
+
const serialNumber = options.formPropertyType === 100 || (Array.isArray(options.seqNoSetting) && options.seqNoSetting.length > 0);
|
|
374
|
+
return serialNumber ? { serialNumberField: true } : {};
|
|
375
|
+
})()),
|
|
372
376
|
...(args.full === true
|
|
373
377
|
? ("options" in field && field.options !== undefined
|
|
374
378
|
? { options: field.options, optionsPresent: true }
|
|
@@ -432,6 +436,7 @@ export function registerFieldLane(tools) {
|
|
|
432
436
|
...(conditions.length > 0 ? { conditions } : {}),
|
|
433
437
|
...(field.shapeWarning !== undefined ? { shapeWarning: field.shapeWarning } : {}),
|
|
434
438
|
...(field.origin !== undefined ? { origin: field.origin } : {}),
|
|
439
|
+
...(field.serialNumberField === true ? { serialNumberField: true } : {}),
|
|
435
440
|
// r46a 接线(2026-11-08,r45 普查 R5a):压缩占位行保留**标量判别键**
|
|
436
441
|
// optionsPresent——不然 >10 行的 full 读回内联面完全看不到 presence
|
|
437
442
|
// 信号,agent 误判「条件没写进去」(S1-G3 预言命中:通用层把「有值
|
|
@@ -542,12 +547,16 @@ export function registerFieldLane(tools) {
|
|
|
542
547
|
sideEffectsNote: "平台可能为文本/下拉字段自动生成一条 datarule type1 checkType=4(maxLength≈200);本调用未显式创建。清理/对账请用 datarule.list 核对,不要把自动行当成重复写入。",
|
|
543
548
|
}
|
|
544
549
|
: {}),
|
|
550
|
+
...(lintSequenceNoSetting(prepared.options).warnings.length > 0
|
|
551
|
+
? { warnings: lintSequenceNoSetting(prepared.options).warnings }
|
|
552
|
+
: {}),
|
|
545
553
|
},
|
|
546
554
|
};
|
|
547
555
|
},
|
|
548
556
|
preflight: (args) => {
|
|
549
557
|
assertSelectionChoicesAllowed(args);
|
|
550
558
|
assertFieldFamilyAllowed(args);
|
|
559
|
+
lintSequenceNoSetting(args.options);
|
|
551
560
|
},
|
|
552
561
|
rollback: fieldRollbackSpec("field.create"),
|
|
553
562
|
});
|
|
@@ -390,6 +390,12 @@ function parseOptions(value) {
|
|
|
390
390
|
}
|
|
391
391
|
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
392
392
|
}
|
|
393
|
+
const SERIAL_GENERATION_FAILURE_NOTE = "平台序列号生成失败是静默的(null 不报错);先 `field.list {schemaCode,code,full:true}` 核对段配置——段类型必须是 CONSTANT/DELIMITER/DATE/PROPERTY/SEQNO/UID(DATAITEM 不是段类型),字段引用必须存在;反编译 SequenceSettingServiceImpl catch→return null(:210-217),真机 r50(2026-11-10)复现。";
|
|
394
|
+
function serialGenerationFailures(serialNumberCodes, record, sequenceStatus) {
|
|
395
|
+
if (sequenceStatus !== "COMPLETED" || !record)
|
|
396
|
+
return [];
|
|
397
|
+
return serialNumberCodes.filter((code) => record[code] === null);
|
|
398
|
+
}
|
|
393
399
|
function choiceCodesFromFieldOptions(field, options) {
|
|
394
400
|
const asCodes = (value) => {
|
|
395
401
|
if (!Array.isArray(value))
|
|
@@ -718,17 +724,21 @@ async function loadPublishedFieldMeta(session, schemaCode) {
|
|
|
718
724
|
continue;
|
|
719
725
|
const type = Number(row.propertyType ?? row.type);
|
|
720
726
|
let format;
|
|
727
|
+
let serialNumber = false;
|
|
721
728
|
if (typeof row.options === "string" && row.options) {
|
|
722
729
|
try {
|
|
723
730
|
const parsed = JSON.parse(row.options);
|
|
724
731
|
if (typeof parsed.format === "string")
|
|
725
732
|
format = parsed.format;
|
|
733
|
+
serialNumber = parsed.formPropertyType === 100 || (Array.isArray(parsed.seqNoSetting) && parsed.seqNoSetting.length > 0);
|
|
726
734
|
}
|
|
727
735
|
catch {
|
|
728
736
|
// unparsable options: shape gates for this field are skipped
|
|
729
737
|
}
|
|
730
738
|
}
|
|
731
|
-
|
|
739
|
+
const options = parseOptions(row.options);
|
|
740
|
+
serialNumber = serialNumber || options.formPropertyType === 100 || (Array.isArray(options.seqNoSetting) && options.seqNoSetting.length > 0);
|
|
741
|
+
meta.set(code, { type, ...(format !== undefined ? { format } : {}), ...(serialNumber ? { serialNumber: true } : {}) });
|
|
732
742
|
if (type === CHILD_TABLE_PROPERTY_TYPE)
|
|
733
743
|
childCodes.push(code);
|
|
734
744
|
}
|
|
@@ -772,7 +782,7 @@ async function prepareRuntimeFormData(session, schemaCode, formData, opts) {
|
|
|
772
782
|
if (loaded)
|
|
773
783
|
assertRuntimeFieldValueShapes(loaded.meta, formData, loaded.childCodes, { schemaCode, isUpdate: opts.isUpdate });
|
|
774
784
|
const stamped = await stampChildRowStatuses(session, schemaCode, formData, loaded);
|
|
775
|
-
return { formData: stamped.formData, childCodes: stamped.childCodes };
|
|
785
|
+
return { formData: stamped.formData, childCodes: stamped.childCodes, serialNumberCodes: loaded ? [...loaded.meta].filter(([, field]) => field.serialNumber).map(([code]) => code) : [] };
|
|
776
786
|
}
|
|
777
787
|
/**
|
|
778
788
|
* Translate a platform DATE options.format into a validator regex. The format
|
|
@@ -2308,6 +2318,7 @@ export function registerRuntimeDataLane(tools) {
|
|
|
2308
2318
|
const loaded = (load.data ?? {});
|
|
2309
2319
|
const record = normalizeLoadedRecord(loaded) ?? {};
|
|
2310
2320
|
const sequenceStatus = extractSequenceStatus(record);
|
|
2321
|
+
const serialGenerationFailed = serialGenerationFailures(stampedSubmit.serialNumberCodes, record, sequenceStatus);
|
|
2311
2322
|
readback = {
|
|
2312
2323
|
...readback,
|
|
2313
2324
|
objectId,
|
|
@@ -2323,6 +2334,9 @@ export function registerRuntimeDataLane(tools) {
|
|
|
2323
2334
|
? { sequenceNoSource: "object-id", sequenceNoNote: "本模型未配置业务流水号:sequenceNo 回填的是 objectId 本身(不是生成的单号)。要单号请在模型上配序列号字段。" }
|
|
2324
2335
|
: {}),
|
|
2325
2336
|
submittedData: projectReadbackRecord(record, args),
|
|
2337
|
+
...(serialGenerationFailed.length > 0
|
|
2338
|
+
? { serialGenerationFailed, serialGenerationWarning: SERIAL_GENERATION_FAILURE_NOTE }
|
|
2339
|
+
: {}),
|
|
2326
2340
|
};
|
|
2327
2341
|
}
|
|
2328
2342
|
else {
|
|
@@ -2352,6 +2366,7 @@ export function registerRuntimeDataLane(tools) {
|
|
|
2352
2366
|
sequenceStatus = extractSequenceStatus(loaded);
|
|
2353
2367
|
}
|
|
2354
2368
|
const loadedRecord = normalizeLoadedRecord(loaded);
|
|
2369
|
+
const serialGenerationFailed = serialGenerationFailures(stampedSubmit.serialNumberCodes, loadedRecord, sequenceStatus);
|
|
2355
2370
|
// The platform's submit response often omits workflowInstanceId (the fake
|
|
2356
2371
|
// start path returns only {result, objectId}); the authoritative loaded
|
|
2357
2372
|
// row carries it. Prefer the response, then the row.
|
|
@@ -2374,6 +2389,9 @@ export function registerRuntimeDataLane(tools) {
|
|
|
2374
2389
|
...(approvalDelta
|
|
2375
2390
|
? { readbackShape: "approval-delta", readbackHint: "审批提交默认只回 sequenceStatus + 本次提交的字段;要整条记录(含子表/系统字段)加 full:true,要指定字段加 fields:[...]" }
|
|
2376
2391
|
: {}),
|
|
2392
|
+
...(serialGenerationFailed.length > 0
|
|
2393
|
+
? { serialGenerationFailed, serialGenerationWarning: SERIAL_GENERATION_FAILURE_NOTE }
|
|
2394
|
+
: {}),
|
|
2377
2395
|
};
|
|
2378
2396
|
// Multi-level approval: after a submit advances the flow, the caller
|
|
2379
2397
|
// almost always needs the NEXT pending todo — bench52/53 paid an extra
|
|
@@ -84,7 +84,7 @@ export const WORKFLOW_WIRE = Object.freeze({
|
|
|
84
84
|
/** Workflow template object (workflow/update|publish raw body). */
|
|
85
85
|
export const workflowTemplateArg = z
|
|
86
86
|
.record(z.string(), z.unknown())
|
|
87
|
-
.describe(`workflow template object. Minimal valid shape (create via workflow.create first, then workflow.update with this, then workflow.publish): ${WORKFLOW_WIRE.templateShape}. **连线写法**:routes(recipe)/ edges(同义)/ rules(平台 DTO 字段名,get_draft 原样读回)三选一,同传两种会被拒。**新节点必须带 type/activityType**(activityCode 命中草稿既有节点时可省)。**体积**:整模板含 propertyPermissions 常到 1.0–1.4MB,而 --args-file 上限 1MB(CLI_ARGS_MAX_BYTES=1048576)——只发改动节点/权限行,别回传整份正文。 **参与人解析陷阱(r5-crm 实证 2026-10-10
|
|
87
|
+
.describe(`workflow template object. Minimal valid shape (create via workflow.create first, then workflow.update with this, then workflow.publish): ${WORKFLOW_WIRE.templateShape}. **连线写法**:routes(recipe)/ edges(同义)/ rules(平台 DTO 字段名,get_draft 原样读回)三选一,同传两种会被拒。**新节点必须带 type/activityType**(activityCode 命中草稿既有节点时可省)。**体积**:整模板含 propertyPermissions 常到 1.0–1.4MB,而 --args-file 上限 1MB(CLI_ARGS_MAX_BYTES=1048576)——只发改动节点/权限行,别回传整份正文。 **参与人解析陷阱(r5-crm 实证 2026-10-10)**:参与者函数按产品线注册,AI-Platform v1.1.25 真机只验证 FindUserByRole({Originator.OU},code,...);CloudPivot 8.6.26 反编译+设计器前端确证另注册 14 个参与者函数,含上级族(如 FindUsersByDirectSupervisor、OUManager、RecurseManager;2026-11-10,完整清单见 r50-workflow-superior FORENSIC.md)。8.6.26 可复制直属上级示例:FindUsersByDirectSupervisor({Originator},null,noSupervisor,initiator)。目标环境使用上级族前先真机跑一单。FindUserByRole 按部门范围找人——目标角色**不挂部门**(如全公司唯一的总监)时 ParticipantActivityRuntime.initParticipants 抛 EngineRuntimeException、流程卡 PROCESSING 无待办;跨部门/全局角色**不要写 FindUsersSpecByRoleFunction(code)**——1.1.25 运行期未注册该函数(FunctionNotFoundException,接口仍回 errCode 0),改用参与者对象数组(角色 id)或给角色补上可覆盖的部门范围成员。解析为空(零成员/未挂部门/自由文本/角色码不存在)时引擎**把任务退回发起人**、流程继续,症状「审批人成了我自己」;真正卡住是参与人函数未注册(无待办/PROCESSING/errcode 0)。用 workflow.instanceActivity 区分:无 status=1 节点=卡住;status=1 且参与人全是发起人=静默错派(r4-training 2026-10-20)。 **START 之后必须保留发起节点**(如「填写申请单」participant={Originator},删掉/缺失则 publish 401035——r5-crm 实证 2026-10-09);流程模型的数据入口=直接 data.submit(创建+启流程+单据号生成,勿用 save+submit 两步)。 routeBranch: ${WORKFLOW_WIRE.routeBranch}。endEventHandler{bizActions,bizActionType} 绑业务规则——用 workflow.bindRule(activityCode+nodeEvent),别替换整个模板。`);
|
|
88
88
|
const WORKFLOW_SCOPE = "greenfield workflow authoring";
|
|
89
89
|
export const WORKFLOW_LANE_CONTRACT = Object.freeze({
|
|
90
90
|
lane: LANES.workflow,
|
package/dist/lanes/workflow.js
CHANGED
|
@@ -649,7 +649,12 @@ function mapCallerRules(callerRoutes, draftRules, activities) {
|
|
|
649
649
|
* (b) a JSON array of participant objects —
|
|
650
650
|
* `[{"code","corpId","id","name","type"}]` (type 2 = role, 3 = user),
|
|
651
651
|
* joined with `+` for several;
|
|
652
|
-
* (c) a function — `FindUserByRole({Originator.OU},"<roleCode>","random")`.
|
|
652
|
+
* (c) a function — e.g. `FindUserByRole({Originator.OU},"<roleCode>","random")`.
|
|
653
|
+
* The registered participant-function set is product-line specific:
|
|
654
|
+
* AI-Platform v1.1.25 was only verified with FindUserByRole, while
|
|
655
|
+
* CloudPivot 8.6.26 registers 14 participant functions including the
|
|
656
|
+
* superior/department-manager family (8.6.26 decompilation, 2026-11-10;
|
|
657
|
+
* see r50-workflow-superior FORENSIC.md).
|
|
653
658
|
* Free text (a bare role name like `部门负责人`) publishes but resolves to
|
|
654
659
|
* nobody and creates no workitem, so warn — the caller must resolve names via
|
|
655
660
|
* `org.role.list` / `org.department.list` first. Advisory (never blocks): the
|
|
@@ -658,9 +663,13 @@ function mapCallerRules(callerRoutes, draftRules, activities) {
|
|
|
658
663
|
/**
|
|
659
664
|
* Participant FUNCTION names that the runtime does not register. Read-back and
|
|
660
665
|
* seeded templates carry them (the CRM seed uses FindUsersSpecByRoleFunction),
|
|
661
|
-
* and
|
|
666
|
+
* and AI-Platform v1.1.25 only ships FindUserByRoleFunction — the others throw
|
|
662
667
|
* FunctionNotFoundException inside ParticipantActivityRuntime, so the instance
|
|
663
668
|
* stalls in PROCESSING with no work item while every API call answers errCode 0.
|
|
669
|
+
* CloudPivot 8.6.26 has a different registration surface: 14 participant
|
|
670
|
+
* functions, including the superior/department-manager family. This comment
|
|
671
|
+
* describes the 1.1.25 hard-gate evidence only; see r50-workflow-superior
|
|
672
|
+
* FORENSIC.md (8.6.26 decompilation and designer evidence, 2026-11-10).
|
|
664
673
|
* A warning was not enough (r4 lost ~200 rounds to it), so publish refuses.
|
|
665
674
|
*/
|
|
666
675
|
export function unregisteredParticipantFunctions(template) {
|
|
@@ -753,7 +762,7 @@ function participantReferenceWarnings(template) {
|
|
|
753
762
|
warnings.push({
|
|
754
763
|
activityCode: String(activity.activityCode ?? ""),
|
|
755
764
|
participant,
|
|
756
|
-
warning: `参与者函数 ${unregistered[1]}(...) 在 AI-Platform v1.1.25 未注册(运行期 FunctionNotFoundException,实例卡 PROCESSING 且提交仍回 errCode 0
|
|
765
|
+
warning: `参与者函数 ${unregistered[1]}(...) 在 AI-Platform v1.1.25 未注册(运行期 FunctionNotFoundException,实例卡 PROCESSING 且提交仍回 errCode 0)。该结论仅适用于 AI-Platform v1.1.25(1.1.25 真机 2026-10-20):已验证的内置写法是 FindUserByRole(org, roleCode[, order]);CloudPivot 8.6.26 另注册上级族函数,如 FindUsersByDirectSupervisor、OUManager、RecurseManager(8.6.26 反编译+设计器 2026-11-10)。上级族表达式在目标环境使用前先真机跑一单;跨部门/全局角色优先用参与者对象数组(角色 id)。不要从 workflow.get_published 或种子流程回抄这个函数名。`,
|
|
757
766
|
});
|
|
758
767
|
continue;
|
|
759
768
|
}
|
|
@@ -2756,7 +2765,7 @@ export function registerWorkflowLane(tools) {
|
|
|
2756
2765
|
activities: unregistered,
|
|
2757
2766
|
message: `流程发布被拒:参与人函数 ${[...new Set(unregistered.map((entry) => entry.functionName + "()"))].join("、")} 在 AI-Platform v1.1.25 未注册(节点 ${unregistered.map((entry) => entry.activityCode).join("、")})。` +
|
|
2758
2767
|
`发布能过,但运行期 ParticipantActivityRuntime 抛 FunctionNotFoundException:实例卡 PROCESSING、不生成待办,而 data.submit 仍回 errCode 0(r4-training 真机)。` +
|
|
2759
|
-
|
|
2768
|
+
`AI-Platform v1.1.25 已验证的内置写法是 FindUserByRole({Originator.OU},"<roleCode>","random");CloudPivot 8.6.26 另注册上级族函数(如 FindUsersByDirectSupervisor、OUManager、RecurseManager),但目标环境使用前先真机跑一单。跨部门/全局角色改用参与者对象数组(角色 id)。` +
|
|
2760
2769
|
`这两个名字常见于 workflow.get_published 读回与种子流程,不要回抄。`,
|
|
2761
2770
|
});
|
|
2762
2771
|
validateWorkflowRender(body, "workflow.publish");
|
package/dist/recipes/field.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { environment, model, commonRecovery } from "./shared.js";
|
|
2
2
|
const fieldSerialNumber = Object.freeze({
|
|
3
3
|
id: "field-serial-number",
|
|
4
|
-
title: "
|
|
4
|
+
title: "单据号字段:Serial Number 控件(seqNoSetting 分段构建器)",
|
|
5
5
|
status: "offline-valid",
|
|
6
|
-
|
|
6
|
+
aliases: ["单据号", "流水号", "编号自动生成"],
|
|
7
|
+
tool: "field.create",
|
|
7
8
|
args: {
|
|
8
9
|
environment,
|
|
9
10
|
schemaCode: "crm_contract",
|
|
10
11
|
code: "<字段 code>",
|
|
11
12
|
name: "合同编号",
|
|
13
|
+
propertyType: "SHORT_TEXT",
|
|
12
14
|
options: {
|
|
13
15
|
formPropertyType: 100,
|
|
14
16
|
seqNoSetting: [
|
|
@@ -20,21 +22,24 @@ const fieldSerialNumber = Object.freeze({
|
|
|
20
22
|
},
|
|
21
23
|
},
|
|
22
24
|
preconditions: [
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
+
"需求是编号自动生成(前缀/日期/流水/按期重置),人工编号请用普通短文本。",
|
|
26
|
+
"单据号=SHORT_TEXT + 控件类型 100;不要走 SequenceService SPI 二开(8.6.26 无触发配置)。",
|
|
25
27
|
],
|
|
26
28
|
conditionalRequirements: [
|
|
27
|
-
"seqNoSetting
|
|
28
|
-
"SEQNO 段:startValue
|
|
29
|
-
"
|
|
30
|
-
"
|
|
29
|
+
"seqNoSetting 段数组顺序即拼接序:CONSTANT / DELIMITER / DATE / PROPERTY(value=本模型字段 code)/ SEQNO / UID(8.6.26 SequenceNoRuleType 真枚举,PROPERTY 与 propertyCodes 分组计数真机 r50 验证)。DATAITEM 不是段类型(设计师 UI 的 resetDate 显示值);分组计数写 SEQNO 段 resetDate:\"none\"+propertyCodes:[字段code]。",
|
|
30
|
+
"SEQNO 段:startValue/maxLength/leftPad/**resetDate(NONE/DAY/MONTH/YEAR,按期重置是原生能力)**。",
|
|
31
|
+
"DATE 段 value 用小写 yyyyMMdd;大写 YYYY/DD=week-year/day-of-year,不报错但产错值(真机 r50:YYYYMMDD→202611314)。",
|
|
32
|
+
"双轨:系统 sequenceNo 控件值=objectId(回执有 sequenceNoSource:\"object-id\" 注记);本配方是自建字段。",
|
|
33
|
+
"写完 `field.publish` + `configure_form {rebuild:true}` + `form.publish`,控件才落到表单。",
|
|
34
|
+
"**生成时机=submit 管线**:`data.save` 落 DRAFT 不生成;`data.submit`(新建并提交)生成且行 COMPLETED(r5-crm 真机 0001→0002)。",
|
|
31
35
|
"验证:连续两次 data.submit,编号应 +1 且格式符合段拼接;跨天重置由 resetDate 保证(勿自建 Redis 计数)。",
|
|
32
36
|
],
|
|
33
|
-
priorToolReferences: [{ tool: "field.
|
|
34
|
-
dryRun: { supported: true, command: `omc call field.
|
|
35
|
-
expectedReadback: { performed: { errcode: 0 }, readback: {
|
|
37
|
+
priorToolReferences: [{ tool: "field.list", args: { environment, schemaCode: "<模型>", code: "<字段 code>", full: true }, purpose: "确认 code 未占用;默认清单面不回 options" }],
|
|
38
|
+
dryRun: { supported: true, command: `omc call field.create --env ${environment} --dry-run --args '<recipe.args>'`, notes: "dry-run 校验 field.create/options 形状,零 wire" },
|
|
39
|
+
expectedReadback: { performed: { errcode: 0 }, readback: { draftFieldPresent: true }, verification: "field.list {code,full:true} 才回 options(默认面不回)", next: ["field.publish", "configure_form {rebuild:true}", "form.publish", "data.submit 双跑 → 编号 +1、COMPLETED"] },
|
|
36
40
|
refusalRecovery: [
|
|
37
|
-
{ code: "field-options-
|
|
41
|
+
{ code: "field-options-immutable", action: "field.update 带 seqNoSetting 必拒;改已有配置请 field.delete + field.create 重建。" },
|
|
42
|
+
{ code: "sequence-counter-identity", action: "改段**不重置**计数(真机 r50:同 code 重建改前缀 T1→T2 号延续 T2-003)——计数身份=模型+字段code+分组,段内容不参与;想归 1=换字段 code。" },
|
|
38
43
|
...commonRecovery,
|
|
39
44
|
],
|
|
40
45
|
requiresEnvironmentDerivedIds: false,
|
|
@@ -383,7 +388,7 @@ const externalLookupModel = Object.freeze({
|
|
|
383
388
|
requiresEnvironmentDerivedIds: true,
|
|
384
389
|
});
|
|
385
390
|
export const FIELD_METADATA = Object.freeze({
|
|
386
|
-
"field.update": Object.freeze({ recipes: [
|
|
387
|
-
"field.create": Object.freeze({ recipes: [numericTwoDecimals, dictionarySelection, dictionaryMultiSelection, childTable, businessModelDropdown, formulaAggregationCrossModel, formulaExpressionSameModel, externalLookupModel], relatedTools: ["dictionary.names", "dictionary.records", "discover_environment", "field.list", "field.publish", "form.draft", "configure_form", "form.publish"] }),
|
|
391
|
+
"field.update": Object.freeze({ recipes: [formConditionalRequired, formAlwaysReadonly, formConditionalReadonly], relatedTools: ["field.list", "field.publish", "form.draft", "form.publish"] }),
|
|
392
|
+
"field.create": Object.freeze({ recipes: [fieldSerialNumber, numericTwoDecimals, dictionarySelection, dictionaryMultiSelection, childTable, businessModelDropdown, formulaAggregationCrossModel, formulaExpressionSameModel, externalLookupModel], relatedTools: ["dictionary.names", "dictionary.records", "discover_environment", "field.list", "field.publish", "form.draft", "configure_form", "form.publish"] }),
|
|
388
393
|
});
|
|
389
394
|
//# sourceMappingURL=field.js.map
|
package/dist/recipes/workflow.js
CHANGED
|
@@ -26,8 +26,9 @@ const workflowTemplateUpdate = Object.freeze({
|
|
|
26
26
|
"**一个模型只能有一个流程**:workflow.create 对已有流程的模型会拒(一个模型只能有一个流程);要改现有流程直接 workflow.update,不要另建新 code;",
|
|
27
27
|
"多级审批:为每个审批节点各写一个 PARTICIPANT 活动(activityCode 唯一),END 放最后;数组里按顺序就是审批链顺序;新增的审批节点由工具自动接入链路(补全到 END 的连线),无需自己写 routes;",
|
|
28
28
|
"**{Originator}=发起人自己**:审批节点用它=提交人自审自己——提交人与审批人同账号时平台可能直接自动通过(COMPLETED,无待办;r40 实证,与节点结构有关)。需要独立审批人时绑定具体用户 id 或 `FindUserByRole({Originator.OU},\"<角色code>\",\"random\")`;验收要 PENDING 待办时先确认审批人≠提交人;",
|
|
29
|
-
"**participant 必须是平台可解析的三种形态之一(真实生产 2026-09-23 观察)**:(a) 关键字 `{Originator}`;(b) 参与者对象数组 JSON `[{\"code\":\"<角色code>\",\"corpId\":\"<corpId|other>\",\"id\":\"<roleId>\",\"name\":\"<角色名>\",\"type\":2}]`(type 2=角色,3=用户;多个用 `+` 连接);(c)
|
|
30
|
-
"
|
|
29
|
+
"**participant 必须是平台可解析的三种形态之一(真实生产 2026-09-23 观察)**:(a) 关键字 `{Originator}`;(b) 参与者对象数组 JSON `[{\"code\":\"<角色code>\",\"corpId\":\"<corpId|other>\",\"id\":\"<roleId>\",\"name\":\"<角色名>\",\"type\":2}]`(type 2=角色,3=用户;多个用 `+` 连接);(c) 函数表达式。函数注册按产品线区分:AI-Platform v1.1.25 真机只验证 `FindUserByRole({Originator.OU},\"<roleCode>\",\"random\")`(2026-10-20);CloudPivot 8.6.26 反编译+设计器已确证 14 个参与者函数,含上级族(2026-11-10,完整清单见 r50-workflow-superior FORENSIC.md)。**自由文本角色名(如 `部门负责人`)能 publish 但解析不到人、不生成待办**——先用 `org.role.list` / `org.department.list` 拿 code/id 再构造。工具会在 readback 里以 `participantWarnings` 标出自由文本。",
|
|
30
|
+
"**上级族函数速查(证据等级:CloudPivot 8.6.26 反编译+设计器前端确证;AI-Platform v1.1.25 未验证)**:直属上级(第 level 级)=`FindUsersByDirectSupervisor({Originator},null,noSupervisor,initiator)`(`level=null` 即第 1 级);部门主管=`OUManager({Originator})`;逐级上级部门主管=`RecurseManager({Originator},n)`;上级部门成员=`FindUsersFromUserDept({Originator},n)`。这些 wire 示例针对 8.6.26;目标环境使用前先真机跑一单,完整清单见 r50-workflow-superior FORENSIC.md。",
|
|
31
|
+
"**不要从读回/种子配置回抄函数式参与人**:`workflow.get_published` 的摘要与平台种子流程(如 crm_contract_flow)会显示 `FindUsersByRoleFunction(...)` / `FindUsersSpecByRoleFunction(...)`,1.1.25 运行期**未注册这两个名字**,原样写回会在 ParticipantActivityRuntime 抛 `FunctionNotFoundException`;这条拒绝证据限定于 AI-Platform v1.1.25(r4-training 真机 2026-10-20)。CloudPivot 8.6.26 的参与者注册面不同,另有上级族函数;目标环境使用前先真机跑一单。",
|
|
31
32
|
"**参与人解析为空有两种后果,别混为一谈(1.1.25 实测 2026-10-20)**:① 解析成空数组(角色零成员、成员未挂发起人部门、自由文本、角色码不存在)时引擎**不报错也不卡住**,而是把任务退回**发起人**——`biz_workitem.participant` 就是发起人,接口回进程正常,唯一症状是「审批人显示成我自己」。② 参与人**函数未注册**(`FindUsersByRoleFunction` / `FindUsersSpecByRoleFunction`)才真停:`FunctionNotFoundException`、不生成待办、实例卡 PROCESSING 而接口仍回 errCode 0。要区分用 `omc call workflow.instanceActivity --args '{\"workflowInstanceId\":\"<id>\"}'`:无 status=1 节点=真停;有 status=1 且参与人全是发起人=静默错派(readback 的 diagnosis.warnings 会给 participant-fallback-to-originator)。",
|
|
32
33
|
"**审批节点必须带 sheetCode(=模型默认表单槽位,通常等于 schemaCode)——S29 契约:participant sheetCode 为空 publish 会 401026 WORKFLOW_ACTIVITY_NO_SHEET。工具已自动回填,正常无需手填**;",
|
|
33
34
|
"节点类型 START / PARTICIPANT / END;省略的既有节点由 merge 保留;",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stalfh233/omc-cli",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.34",
|
|
4
4
|
"description": "CloudPivot 8.6 configuration capability CLI — governed, fail-closed, coverage-manifest bounded.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"commander": "14.0.3",
|
|
58
|
-
"omc-core": "0.6.
|
|
58
|
+
"omc-core": "0.6.34",
|
|
59
59
|
"proper-lockfile": "4.1.2",
|
|
60
60
|
"write-file-atomic": "6.0.0",
|
|
61
61
|
"zod": "^3.23.8",
|
|
@@ -73,6 +73,6 @@
|
|
|
73
73
|
"directory": "packages/omc-cli"
|
|
74
74
|
},
|
|
75
75
|
"optionalDependencies": {
|
|
76
|
-
"@stalfh233/omc-fake-platform": "0.6.
|
|
76
|
+
"@stalfh233/omc-fake-platform": "0.6.34"
|
|
77
77
|
}
|
|
78
78
|
}
|
|
@@ -42,6 +42,8 @@ node "$CLI" help omc-five-piece-flow
|
|
|
42
42
|
|
|
43
43
|
## 模型与字段
|
|
44
44
|
|
|
45
|
+
- **单据号双轨(真机 r50)**:系统 `sequenceNo`=objectId(回执带 `sequenceNoSource:"object-id"`);自建=`field.create` 的 `SHORT_TEXT+options.formPropertyType:100+seqNoSetting`(段类型 CONSTANT/DELIMITER/DATE/PROPERTY/SEQNO/UID,示例见配方 `field-serial-number`)。`field.update` 改 `seqNoSetting` 必拒——改配置=删除重建。DATE 用小写 `yyyyMMdd`(大写 YYYY/DD 静默产错值)。
|
|
46
|
+
|
|
45
47
|
- **code 长度平台硬限**:模型 code ≤26 字符、字段 code ≤28(`business-code-invalid` 出门校验;长业务名先起短 code,长名放 name)。
|
|
46
48
|
- 模型层字段默认可空;必填、只读、可见性在表单和流程节点配置。
|
|
47
49
|
- `propertyEmpty` 默认 `false`,不要把业务必填硬编码在数据模型。
|
|
@@ -178,7 +180,7 @@ rules:
|
|
|
178
180
|
- **核验状态用投影,别重复整条读**:`data.load --args '{"schemaCode":..,"bizObjectId":..,"fields":["sequenceStatus","<业务状态字段>"]}'` 只回指定字段(缺失项在 `missingFields`)——r4 实测同一对象被整条读 74 次;大结果先 `artifact get <id> --summary` → `--keys/--jq`,别整包内联进推理。
|
|
179
181
|
- **流程第一个节点必须是 `{Originator}` 填写节点**:平台 `WorkflowTemplateValidateUtility.validateStartActivity` 对「START 后直接接审批」报 401035「发起节点的参与者只能是{Originator}」,publish 回 errcode 0 但一个 ValidateMessage[] 就把模板挡在门外、不落库(真机 2026-10-21)。OMC 0.4.65 起在 `workflow.update`/`publish` 出门前拒绝(`workflow-first-activity-not-originator`)。
|
|
180
182
|
- **跨模型回写的目标行必须已提交(COMPLETED)**:DRAFT 行不参与目标查询,运行 0 行命中且日志只有「查找范围不存在数据」。单跳关联字段可直接作 DYNAMIC 来源(引擎取关联对象 id);点号路径按子表解析,`关联字段.id` / 两跳路径都不支持。
|
|
181
|
-
- **参与人解析失败分两种,别当成同一种(1.1.25 实测)**:① **解析为空**(角色零成员、成员未挂部门、自由文本、角色码不存在)→
|
|
183
|
+
- **参与人解析失败分两种,别当成同一种(1.1.25 实测)**:① **解析为空**(角色零成员、成员未挂部门、自由文本、角色码不存在)→ 引擎把任务**退回发起人**、流程继续,症状「审批人显示成我自己」,`data.submit` 与 `workitem.list` 都正常;② **参与人函数未注册**(`FindUsersByRoleFunction`/`FindUsersSpecByRoleFunction`)→ `FunctionNotFoundException`、不生成待办、实例卡 PROCESSING 而接口回 `errCode 0`。区分用 `workflow.instanceActivity`:无 status:1=卡住;status:1 且参与人全是发起人=静默错派(`participant-fallback-to-originator`)。参与者函数注册**按产品线区分**:1.1.25 真机只验证 `FindUserByRole(org, roleCode[, order])`;8.6.26 反编译+设计器确证另注册 14 个(含上级族 FindUsersByDirectSupervisor/OUManager/RecurseManager)——可复制 wire 示例见 `capability workflow --executable` 配方,目标环境使用前先真机跑一单。不要从 `workflow.get_published` 摘要回抄函数式参与人。
|
|
182
184
|
|
|
183
185
|
## 流程字段权限
|
|
184
186
|
|
|
@@ -81,7 +81,7 @@ only the section for the capability you need —
|
|
|
81
81
|
|
|
82
82
|
## 字段 `field`
|
|
83
83
|
|
|
84
|
-
-
|
|
84
|
+
- **单据号/自动编号(原生,勿二开)**:自建单据号字段是 `field.create` 的 `SHORT_TEXT + options.formPropertyType:100 + options.seqNoSetting` 分段构建器(CONSTANT/DELIMITER/DATE/PROPERTY/SEQNO/UID 段);DATAITEM 不是段类型,而是设计师 UI 的 resetDate 显示值。SEQNO 段 `resetDate:DAY/MONTH/YEAR` 原生按期重置——`describe field.create --example field-serial-number`。**不要落 SequenceService SPI 二开**(真机 r50 + 8.6.26 反编译证据,2026-11-10);编号生成时机=submit(`data.save` 不生成)。系统 `sequenceNo` 控件另为 objectId 双轨,勿混淆。
|
|
85
85
|
|
|
86
86
|
- **能做哪些事**:字段族全链 create→publish→表单绑定;**CHILD_TABLE 子表**(子列是 schemaCode=父字段 code 上的普通字段);**计算字段**(默认用普通字段 + 「计算规则」,见下)。
|
|
87
87
|
- **工具**:`field.list`、`field.create`、`field.update`、`field.publish`、`field.delete`
|