@openbkn/workshop 0.2.2-rc.5 → 0.2.2-rc.6
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/README.md +79 -8
- package/component.d.ts +10 -0
- package/dist/ActionConfirm-DJ91X3ml.js +236 -0
- package/dist/ActionFailure-ZgPt_3B-.js +37 -0
- package/dist/AgentChat-CRYai8ge.js +1062 -0
- package/dist/AppFormModal-D73ucaHK.js +4282 -0
- package/dist/AppListPage-D87piiOw.js +1364 -0
- package/dist/AskDrawer-BUMYsRnt.js +38 -0
- package/dist/ComputedView-CgYrDbx1.js +3221 -0
- package/dist/ConclusionApply-sjGfoEBY.js +153 -0
- package/dist/CypherEditor-lus6FA5L.js +485 -0
- package/dist/LandingList-6JI6864C.js +230 -0
- package/dist/MenuUnfoldOutlined-Cdg24l2h.js +27 -0
- package/dist/ModelTrial-ClHFGTpQ.js +359 -0
- package/dist/PageRenderer-DBd_g6mN.js +85480 -0
- package/dist/README-DjRyTQSR.js +76 -0
- package/dist/ScenarioApply-DtW_hh47.js +590 -0
- package/dist/SimulateForm-C-i08Jjd.js +153 -0
- package/dist/Subgraph-CnrkH9AN.js +32586 -0
- package/dist/WorkshopLabPage-DiVXQL9e.js +11364 -0
- package/dist/WorkshopRunPage-6hjRUf64.js +253 -0
- package/dist/abnfDiagram-WEYOIA3C-beRNhN3c.js +87 -0
- package/dist/action-type-tool.service-B2B74fKC.js +1060 -0
- package/dist/actionButton-DA5CNEzx.js +94 -0
- package/dist/actionButton.en-US-qjeqA7hs.js +94 -0
- package/dist/agentChat-EoDznd58.js +116 -0
- package/dist/agentChat.en-US-B6-pFd9Y.js +116 -0
- package/dist/alertList-DqditwM8.js +84 -0
- package/dist/alertList.en-US-BAXAgltP.js +84 -0
- package/dist/architectureDiagram-ZHVYKT53-DY2l1qxx.js +4779 -0
- package/dist/asOfSlider-QPvHWUMV.js +83 -0
- package/dist/asOfSlider.en-US-BI4jVfSn.js +83 -0
- package/dist/bkn-agent-execution.service-DVh-SHyl.js +205 -0
- package/dist/blockDiagram-RJAE7QA3-DR0mjN2h.js +1435 -0
- package/dist/c4Diagram-XDPPPE54-DH5zsGug.js +1518 -0
- package/dist/channel-B034hcOF.js +5 -0
- package/dist/china-C6m7zXIv.js +9 -0
- package/dist/chunk-2E7WHVMD-Ba3svxgx.js +664 -0
- package/dist/chunk-2Q5K7J3B-rT4eU6_y.js +15 -0
- package/dist/chunk-4EMNKR2T-C1kQZYHK.js +262 -0
- package/dist/chunk-55XCU76K-dcpLOktb.js +68 -0
- package/dist/chunk-5VM5RSS4-BdpQuzmO.js +19 -0
- package/dist/chunk-JWPE2WC7-CDBrSjU7.js +8 -0
- package/dist/chunk-VQ5W62QI-BiVKc40w.js +19 -0
- package/dist/chunk-XXDRQBXY-CPYrcdVW.js +8 -0
- package/dist/chunk-ZCHMQSOR-BG8OLpvb.js +451 -0
- package/dist/classDiagram-v2-4MYWR3UA-DqbpQpwI.js +1564 -0
- package/dist/component.d-DFoMKuUv.js +179 -0
- package/dist/cose-bilkent-JH36ORCC-CdXk4sPf.js +2609 -0
- package/dist/customComponents-DasaZ6pq.js +4 -0
- package/dist/customComponents.en-US-CkabuCXg.js +79 -0
- package/dist/customParseFormat-C0uLEpdq.js +182 -0
- package/dist/cynefin-EF2NZ3EQ-D7MVnMHu.js +21746 -0
- package/dist/cynefinDiagram-WF24UDRP-BYT_KpDL.js +299 -0
- package/dist/cytoscape.esm-BCV9V6aO.js +18760 -0
- package/dist/d3-scale-DA8IHmf0.js +1841 -0
- package/dist/dagre-NK4GIZVX-l-ghPdM8.js +2154 -0
- package/dist/dateRange-BbkLMg8L.js +79 -0
- package/dist/dateRange.en-US-CV12Q02G.js +79 -0
- package/dist/dayjs.min-DZ-YV8Mv.js +284 -0
- package/dist/diagram-CBK3MWTC-Bt3HiwvA.js +542 -0
- package/dist/diagram-I5XIIV2D-DcbqfBjx.js +150 -0
- package/dist/diagram-ODIL2UCW-9PC1n3n5.js +346 -0
- package/dist/diagram-PFBEJUXE-DGhr2kc7.js +478 -0
- package/dist/diagram-RJA3I4VV-DwzpOjZ_.js +219 -0
- package/dist/diagram-TYUNFSNR-B3Bd3TDU.js +2583 -0
- package/dist/dropdownFilter-DOi_8-ZT.js +76 -0
- package/dist/dropdownFilter.en-US-BiXpvXtF.js +76 -0
- package/dist/ebnfDiagram-V4P3TTPT-E5NN2oKc.js +109 -0
- package/dist/elk-QONTBCTQ-dFjcujl_.js +49170 -0
- package/dist/erDiagram-KYQIGQAA-BMrasBzB.js +1061 -0
- package/dist/eventList-CnsAwfDS.js +115 -0
- package/dist/eventList.en-US-Cof3rCLq.js +115 -0
- package/dist/eventReport-XS-HegnH.js +76 -0
- package/dist/eventReport.en-US-DTx4vzWT.js +76 -0
- package/dist/flowDiagram-IUGLLWBU-BGIBH0q0.js +1769 -0
- package/dist/ganttChart-DEeSvTJA.js +77 -0
- package/dist/ganttChart.en-US-SwRKrnoD.js +77 -0
- package/dist/ganttDiagram-R7GPNTJY-C0tb1Lpp.js +1741 -0
- package/dist/generateCypher-Ch9_lQa6.js +399 -0
- package/dist/gitGraphDiagram-PDYL7XHY-DBqcOa-c.js +815 -0
- package/dist/graph-CKJmgLki.js +1541 -0
- package/dist/index-BA-GzCXt.js +441 -0
- package/dist/infoDiagram-MVDRKAX5-Bwuki4JA.js +24 -0
- package/dist/ishikawaDiagram-HPEHV2GE-Dz4d6ygx.js +622 -0
- package/dist/journeyDiagram-BOSHW7O7-C99m34Bb.js +834 -0
- package/dist/kanban-definition-FNSA4HC5-mdqjODsT.js +724 -0
- package/dist/katex-BsrBVQKd.js +11314 -0
- package/dist/manifest-BjV1PJ6u.js +41 -0
- package/dist/mermaid.core-yQghUlIz.js +17642 -0
- package/dist/metricCards-CSb-_cT2.js +104 -0
- package/dist/metricCards.en-US-BLLhRsQU.js +104 -0
- package/dist/mindmap-definition-6OY57UG3-BZhO2wX4.js +834 -0
- package/dist/modelTrial-Bvb-RhGt.js +137 -0
- package/dist/modelTrial.en-US-DYcuor-G.js +137 -0
- package/dist/models-DekiCOuZ.js +6 -0
- package/dist/object-metric-numeric-vs3BeDkH.js +42 -0
- package/dist/object-metric.service-flZgBMRX.js +233 -0
- package/dist/objectDetail-SQUbp4Py.js +117 -0
- package/dist/objectDetail.en-US-DW3mlONM.js +117 -0
- package/dist/objectList-D99wPtJH.js +97 -0
- package/dist/objectList.en-US-PBBNyVLW.js +97 -0
- package/dist/objectTable-0jsFFMN3.js +127 -0
- package/dist/objectTable.en-US-yWEs8qc_.js +127 -0
- package/dist/pegDiagram-ECIUJNBX-BDa5RfZt.js +95 -0
- package/dist/pieDiagram-GNMPY74T-DNVtzXPv.js +165 -0
- package/dist/pivotTable-CHmQw18-.js +102 -0
- package/dist/pivotTable.en-US-B4uv4P08.js +102 -0
- package/dist/prompt-DYrjlEFr.js +373 -0
- package/dist/quadrantDiagram-D57K4MC3-vK0f2OvQ.js +1023 -0
- package/dist/railroadDiagram-Y72NRBL7-j6ZrTmRp.js +77 -0
- package/dist/regionMap-Cme-JyV_.js +128 -0
- package/dist/regionMap.en-US-Bwr2_p32.js +128 -0
- package/dist/requirementDiagram-EQYSW5RA-DgfEyljA.js +886 -0
- package/dist/sankeyDiagram-SY24JHO5-CImx-IX0.js +1160 -0
- package/dist/scenarioBar-BV43p7n-.js +122 -0
- package/dist/scenarioBar.en-US-5KqMQ2Bg.js +122 -0
- package/dist/scheduleGantt-CTYO-zYP.js +180 -0
- package/dist/scheduleGantt.en-US-hE7mvVUW.js +180 -0
- package/dist/searchBox-Ca7w0f_6.js +67 -0
- package/dist/searchBox.en-US-ArS_XBvB.js +67 -0
- package/dist/segmentedFilter-MhjVcWo0.js +80 -0
- package/dist/segmentedFilter.en-US-BxNrQO5T.js +80 -0
- package/dist/sequenceDiagram-BLEHNHQU-nWmjd1ci.js +2969 -0
- package/dist/sizeCapture-INFHLROL-D3jlbt7h.js +46 -0
- package/dist/stageChain-BxBafwjD.js +74 -0
- package/dist/stageChain.en-US-CP0G27n8.js +74 -0
- package/dist/stateDiagram-v2-A6IESKWZ-DG1ZetEu.js +1514 -0
- package/dist/subgraph-7n4SwliR.js +71 -0
- package/dist/subgraph.en-US-BNvY18IW.js +71 -0
- package/dist/swimlanes-B3ENRKFQ-cCmJE8AU.js +4991 -0
- package/dist/swimlanesDiagram-AYQRV4AK-CtuhyguU.js +14 -0
- package/dist/taskInbox-DGWYeI2b.js +118 -0
- package/dist/taskInbox.en-US-B-OzDmVl.js +118 -0
- package/dist/text-BqSVQKS6.js +78 -0
- package/dist/text.en-US-BhAxy_LE.js +78 -0
- package/dist/timeline-definition-JXYKGLGB-Cc-INsOv.js +1057 -0
- package/dist/trendChart-BjEeRS5_.js +135 -0
- package/dist/trendChart.en-US-BBGqWUKM.js +135 -0
- package/dist/useLabData-Df-jEHKs.js +20470 -0
- package/dist/usecaseDiagram-WPOLBNNX-r8wVjopm.js +7920 -0
- package/dist/vennDiagram-Q3Y3IDCW-BZiOcgrj.js +1579 -0
- package/dist/wardleyDiagram-IVAIDKWA-16jd07C_.js +675 -0
- package/dist/workshop-app-DnHNjBqy.js +86038 -0
- package/dist/workshop-app.css +1 -0
- package/dist/workshop-app.js +4 -0
- package/dist/world-Djau1JyJ.js +9 -0
- package/dist/xychartDiagram-4URNHDU4-C8DwWQNh.js +1460 -0
- package/dist-cli/workshop.js +340 -217
- package/example/host.js +109 -0
- package/example/index.html +93 -0
- package/example/server.mjs +237 -0
- package/index.d.ts +48 -0
- package/lib/validate.js +47 -1
- package/package.json +17 -5
- package/runtime/frame-runtime.js +13 -1
- package/workshop-component.js +32 -12
- package/workshop.js +2 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
const n = `# 方案(scenarioBar)
|
|
2
|
+
|
|
3
|
+
选择页面显示现状还是某个方案,新建、复制、保存、采用、作废方案,查看并调整方案里的改动,并排对比各方案与现状的指标。用来做“如果这样改,结果会怎样,要不要真的采用”的决策。
|
|
4
|
+
|
|
5
|
+
**只在提供方案能力(企业版)的版本里出现。** 其他版本里这个组件不在组件库中,已放进页面的会显示“方案推演需要企业版”。
|
|
6
|
+
|
|
7
|
+
## 适用与不适用
|
|
8
|
+
|
|
9
|
+
- 适用:需要先在页面上试改(改日期、数量、状态,或调整全局参数),对比结果,再决定是否让行动真的执行。例如换一个交期、延后一批工单、把需求上调 10%。
|
|
10
|
+
- 不适用:
|
|
11
|
+
- 只想对一批对象按几组参数调用模型,比较结果,不保存方案:用模型试算(\`modelTrial\`,同样只在提供方案能力的版本里出现)。
|
|
12
|
+
- 对对象直接执行行动,不需要先试算:用按钮(\`actionButton\`)。
|
|
13
|
+
- 把任务拖到资源上排程:用调度甘特(\`scheduleGantt\`),它自带方案内的拖动与采用。
|
|
14
|
+
- 只看数量与流转:用环节链路(\`stageChain\`)。
|
|
15
|
+
|
|
16
|
+
## 本体契约
|
|
17
|
+
|
|
18
|
+
| 角色 | 对象类要求 | 必要的属性 | 关系 | 必填 |
|
|
19
|
+
| --- | --- | --- | --- | --- |
|
|
20
|
+
| 被推演的对象 | 方案里要改的对象:订单、工单、需求 | 对比指标用到的属性;推演操作要改的属性 | 联动、相关对象用到的关系(可选) | 是:数据源 |
|
|
21
|
+
| 推演操作 | 数据源上登记的一种假设,如“延期”“上调数量” | 要用户填的参数(1 到 5 个)、对属性的效果(1 到 5 个:按天移动、增加、设为、按基准日设定)、适用条件 | — | 是:没有时只能新建空方案,“添加假设”不可用 |
|
|
22
|
+
| 落地行动 | 采用方案时逐个对象执行的知识网络行动 | 行动的输入,取自参数、属性、固定值或方案名、当前用户 | 行动 → 对象类 | 否:没有行动的假设标为“需人工落实” |
|
|
23
|
+
| 方案参数 | 不属于任何对象的全局假设,如需求上调比例 | 名称、类型(数字、日期、文本)、默认值;数字可限范围;文本可列出可选值 | — | 否:最多 10 个,只有模型读取 |
|
|
24
|
+
| 模型结果数据源 | 对象经执行工厂工具计算后的结果 | 工具、读取的数据源、输出列、关键列 | — | 否:配了才显示“计算” |
|
|
25
|
+
|
|
26
|
+
推演操作、方案参数、模型结果数据源都在构建器的“列与进度”里配置,不在本组件上。方案本身只保存在 Workshop,采用之前不写回知识网络。
|
|
27
|
+
|
|
28
|
+
## 组件内置的判断
|
|
29
|
+
|
|
30
|
+
与行业无关,组件自己做:
|
|
31
|
+
|
|
32
|
+
| 判断 | 规则 |
|
|
33
|
+
| --- | --- |
|
|
34
|
+
| 方案状态 | 未保存(草稿)、已保存、已采用、部分采用、已作废 |
|
|
35
|
+
| 能否采用 | 方案为已保存或部分采用,且有改动(或有模型结果要落地);变更还在保存或保存失败时不可采用;模型结果未更新时先要“计算” |
|
|
36
|
+
| 数据已变 | 假设里记着改动时的原值;采用时对象的值已不同于原值,标出“推演后数据已变化”及变化的属性 |
|
|
37
|
+
| 联动 | 配了联动规则时,上游日期被推迟,下游日期按间隔与余量随之推迟,并标“联动” |
|
|
38
|
+
| 相关 | 配了相关关系时,与改动对象有关的对象标“相关”,值不变 |
|
|
39
|
+
| 结果未算 | 模型结果数据源在某个方案下没有最新结果,表格写“待重算”,不写成 0 |
|
|
40
|
+
| 对比 | 每个指标显示与现状的差值,差为 0 时不显示 |
|
|
41
|
+
|
|
42
|
+
## 扩展点
|
|
43
|
+
|
|
44
|
+
### 推演操作
|
|
45
|
+
|
|
46
|
+
- **用途**:定义“能做哪些假设”,以及假设怎样改对象。这是方案里的业务规则,放在配置里,不写进组件。
|
|
47
|
+
- **在哪里配**:“列与进度”里数据源的“推演操作”,每个数据源最多 10 个。
|
|
48
|
+
- **接什么**:对象的属性(效果)与知识网络里的行动类型(采用时执行)。
|
|
49
|
+
- **输入**:用户在“添加假设”里选操作、选适用对象(只列满足适用条件的)、填参数。
|
|
50
|
+
- **输出**:一条假设:哪个对象、哪个操作、参数是什么。页面按假设重新计算,数据不变。
|
|
51
|
+
- **失败与超时**:找不到对象那一行时提示“找不到这一行,改动不生效,可以移除”;采用时执行失败的假设逐条记录,可重试,已成功的不会重复执行。
|
|
52
|
+
- **结果怎样显示**:改动清单里每条显示对象、操作、参数、属性变化(现状 → 方案)、是否由 Agent 建议、采用结果。
|
|
53
|
+
|
|
54
|
+
### 模型
|
|
55
|
+
|
|
56
|
+
- **用途**:需要计算而不是简单改值的假设,例如重新排产、重新算成本。
|
|
57
|
+
- **在哪里配**:“列与进度”里数据源的模型结果(执行工厂工具,每个方案各算一次)。
|
|
58
|
+
- **接什么**:执行工厂中的函数工具或登记的服务。
|
|
59
|
+
- **输入与输出**:读取的数据源、方案参数、输出列由配置决定;每次最多读 5000 行、合计 25000 行,超出时“计算”不可用并说明原因。
|
|
60
|
+
- **失败与超时**:计算失败时状态显示“计算失败”及原因,旧结果仍会标明是旧的;状态还有已是最新、待重算、计算中、受限、读取输入中、采用时的结果。
|
|
61
|
+
- **结果怎样显示**:页面的“计算”按钮算当前方案中待重算的结果,对比表里“计算”依次算各列。
|
|
62
|
+
|
|
63
|
+
## 交互与联动
|
|
64
|
+
|
|
65
|
+
- **写入**:选中方案写入页面的当前方案,页面其他组件按方案重新计算;“推演”类动作与 Agent 建议也写入当前方案(没有可改的方案时新建一个)。
|
|
66
|
+
- **读取**:对比表跟随页面筛选;其他样式不读。
|
|
67
|
+
- **三种样式**:
|
|
68
|
+
- 对比表(默认):每行一个指标,每列现状或一个方案(最多 4 列,含现状),点列头切换;下方可展开方案之间不同的方案参数与对象改动,最多先显示 30 行;需要数据源和至少 1 个对比指标,缺少时只显示一行并提示先选。
|
|
69
|
+
- 紧凑:一行,方案下拉、新建与当前方案的操作,适合放页头。
|
|
70
|
+
- 假设:适合放侧栏,设当前方案的方案参数、看改动清单、“添加假设”;常与页头的紧凑样式配合。
|
|
71
|
+
- **操作**:新建方案(有可选值的方案参数时,可“按某参数的各个取值各建一个方案”)、复制、保存方案或重命名(名称不超过 40 字)、查看改动(可移除,可撤销一次)、采用方案…、作废(二次确认;已执行的行动不受影响)。
|
|
72
|
+
- **采用**:逐条列出假设与对应行动,没有行动的写“需人工落实”;有行动的逐个对象以当前用户身份执行,每个结果记在假设上,失败的可再试,已成功的不会重复执行。
|
|
73
|
+
|
|
74
|
+
## 场景配方
|
|
75
|
+
|
|
76
|
+
### 订单交期试改
|
|
77
|
+
|
|
78
|
+
| 角色 | 对应 |
|
|
79
|
+
| --- | --- |
|
|
80
|
+
| 被推演的对象 | 销售订单(交货日期、数量、状态) |
|
|
81
|
+
| 推演操作 | “延期”:参数天数;效果:交货日期按天移动;行动:修改订单交期 |
|
|
82
|
+
| 对比的指标 | 订单数;已超期数(条件:进度状态为已超期) |
|
|
83
|
+
| 样式 | 页头放紧凑,侧栏放假设,主区放对比表 |
|
|
84
|
+
|
|
85
|
+
**知识网络中要有:** 订单对象类、行动类型“修改订单交期”;订单数据源设了进度,才有“已超期”。
|
|
86
|
+
|
|
87
|
+
**检查项:** 新建方案,给两张订单加“延期 5 天”,对比表里已超期数相对现状有差值;改动清单显示“交货日期 旧值 → 新值”;采用时弹出执行确认。
|
|
88
|
+
|
|
89
|
+
### 需求波动下的产能判断
|
|
90
|
+
|
|
91
|
+
| 角色 | 对应 |
|
|
92
|
+
| --- | --- |
|
|
93
|
+
| 被推演的对象 | 需求预测单 |
|
|
94
|
+
| 方案参数 | 需求上调比例(数字,默认 0,单位 %) |
|
|
95
|
+
| 模型结果数据源 | 产能占用模型,读需求预测单与产线,输出占用率 |
|
|
96
|
+
| 对比的指标 | 平均占用率、超载产线数 |
|
|
97
|
+
|
|
98
|
+
**知识网络中要有:** 需求预测单与产线对象类;占用率模型是执行工厂的函数工具,读知识网络。
|
|
99
|
+
|
|
100
|
+
**检查项:** 新建方案,设“需求上调比例”为 10,点“计算”,对比表里各列显示占用率与现状的差;未计算的列显示“待重算”。
|
|
101
|
+
|
|
102
|
+
## 给 AI 的指引
|
|
103
|
+
|
|
104
|
+
1. 先确认环境提供方案能力;先问用户:要试改哪类对象的什么(推演操作)、结果由什么判断(对比指标)、采用时要执行哪个行动、有没有全局参数,要不要模型计算。
|
|
105
|
+
2. 数据源上没有推演操作时,先去“列与进度”添加,否则组件只能新建空方案。
|
|
106
|
+
3. 对比表需要数据源和对比的指标(最多 8 个)。样式写成对比表却没配这些,只会显示一行并提示。
|
|
107
|
+
4. 数据源要选配置了推演操作的那个;默认配置会这样选,并给出“数量”与(有进度时)“已超期”两个指标。
|
|
108
|
+
5. 常见错误:
|
|
109
|
+
- 把业务规则写进组件。假设的效果在推演操作里配,规则判断放在知识网络。
|
|
110
|
+
- 以为方案会写回知识网络。只有“采用”才执行行动。
|
|
111
|
+
- 采用前没有保存方案、没有“计算”:采用按钮会置灰并说明原因。
|
|
112
|
+
|
|
113
|
+
## 限制
|
|
114
|
+
|
|
115
|
+
- 对比表最多 4 列(含现状);对比指标最多 8 个。
|
|
116
|
+
- 每个数据源最多 10 个推演操作,每个操作最多 5 个参数、5 个效果;方案参数最多 10 个,每个文本参数最多 10 个可选值。
|
|
117
|
+
- 方案名称不超过 40 字。
|
|
118
|
+
- 模型结果每次最多读 5000 行、合计 25000 行。
|
|
119
|
+
`;
|
|
120
|
+
export {
|
|
121
|
+
n as default
|
|
122
|
+
};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
const e = `# Scenario (scenarioBar)
|
|
2
|
+
|
|
3
|
+
Chooses whether the page shows the data as it is or a scenario, creates, copies, saves, applies and voids scenarios, lists and adjusts the assumptions in a scenario, and compares the indicators of scenarios side by side with the data as it is. Use it to decide: if we change this, what happens, and should we really apply it.
|
|
4
|
+
|
|
5
|
+
**It appears only in editions that offer scenarios (Enterprise).** In other editions it is not in the component library, and one already placed on a page shows "Scenarios need the Enterprise edition".
|
|
6
|
+
|
|
7
|
+
## When to use it and when not
|
|
8
|
+
|
|
9
|
+
- Use it when people need to try changes on the page first (move dates, change quantities or statuses, or adjust a global parameter), compare results, and only then decide whether actions really run. For example: a different due date, delaying a batch of work orders, raising demand by 10%.
|
|
10
|
+
- Do not use it:
|
|
11
|
+
- To call a model on a batch of objects with several parameter sets and compare, without saving a scenario: use the model trial (\`modelTrial\`, which also appears only in editions that offer scenarios).
|
|
12
|
+
- To run an action on objects directly without trying first: use the button (\`actionButton\`).
|
|
13
|
+
- To drag tasks onto resources to schedule them: use the schedule Gantt (\`scheduleGantt\`), which has its own dragging and applying within a scenario.
|
|
14
|
+
- To see only quantities and flow: use the stage chain (\`stageChain\`).
|
|
15
|
+
|
|
16
|
+
## Ontology contract
|
|
17
|
+
|
|
18
|
+
| Role | Object type | Required properties | Relations | Required |
|
|
19
|
+
| --- | --- | --- | --- | --- |
|
|
20
|
+
| Object to try changes on | What a scenario changes: orders, work orders, demands | The properties the compared indicators use; the properties the operations change | Relations used for linking and related objects (optional) | Yes: the source |
|
|
21
|
+
| Operation | A kind of assumption registered on the source, such as "delay" or "raise quantity" | The inputs the user fills in (1 to 5), effects on properties (1 to 5: move by days, add, set, set from the base date), the objects it applies to | None | Yes: without one only empty scenarios can be made and "Add assumption" is unavailable |
|
|
22
|
+
| Landing action | The knowledge network action run per object when the scenario is applied | The action's inputs, taken from parameters, properties, fixed values, or the scenario name and current user | Action to object type | No: an assumption without an action is marked for people to carry out |
|
|
23
|
+
| Scenario parameter | A global assumption that belongs to no object, such as the demand increase | Name, type (number, date, text), default; a number may have a range; a text may list its values | None | No: up to 10; only models read them |
|
|
24
|
+
| Model result source | Objects' results computed by an execution factory tool | The tool, the sources it reads, output columns, key column | None | No: "Compute" shows only when configured |
|
|
25
|
+
|
|
26
|
+
Operations, scenario parameters and model result sources are configured in the builder under "Columns and progress", not on this component. A scenario is kept only in Workshop and is not written back to the knowledge network before it is applied.
|
|
27
|
+
|
|
28
|
+
## Built-in checks
|
|
29
|
+
|
|
30
|
+
Independent of industry, the component does these itself:
|
|
31
|
+
|
|
32
|
+
| Check | Rule |
|
|
33
|
+
| --- | --- |
|
|
34
|
+
| Scenario status | Unsaved (draft), saved, applied, partly applied, void |
|
|
35
|
+
| Can it be applied | The scenario is saved or partly applied, and has assumptions (or model results to land). Not while changes are still saving or failed to save. Model results must be up to date, so "Compute" comes first when they are not |
|
|
36
|
+
| Data has moved | An assumption keeps the original values from when it was made. When applying, an object whose value differs from the original is flagged with the properties that changed |
|
|
37
|
+
| Linking | With follow rules set, when an upstream date is pushed later, the downstream date is pushed by the gap and slack, and marked "Linked" |
|
|
38
|
+
| Related | With related links set, objects related to a changed object are marked "Related", with values unchanged |
|
|
39
|
+
| Result not computed | When a model result source has no current result for a scenario, the table says "To recompute" instead of showing 0 |
|
|
40
|
+
| Comparison | Each indicator shows its difference from the data as it is, hidden when the difference is 0 |
|
|
41
|
+
|
|
42
|
+
## Extension points
|
|
43
|
+
|
|
44
|
+
### Operations
|
|
45
|
+
|
|
46
|
+
- **Purpose**: define which assumptions can be made and how each changes the objects. This is the business rule of a scenario. It belongs in configuration, not in the component.
|
|
47
|
+
- **Where to set it**: under "Columns and progress", the source's "Operations", at most 10 per source.
|
|
48
|
+
- **What to connect**: properties of the object (the effects) and action types of the knowledge network (run on applying).
|
|
49
|
+
- **Input**: in "Add assumption" the user picks an operation, picks the objects (only those that satisfy the operation's condition are listed) and fills in the parameters.
|
|
50
|
+
- **Output**: an assumption: which object, which operation, with which parameters. The page recalculates on the assumptions and the data stays as it is.
|
|
51
|
+
- **Failure and timeout**: when the object's row cannot be found the list says the change has no effect and can be removed. Assumptions that fail while applying are recorded one by one and can be retried. Ones that succeeded do not run twice.
|
|
52
|
+
- **How results show**: each assumption in the list shows the object, the operation, the parameters, the property changes (as it is, then in the scenario), whether the Agent suggested it, and the result of applying.
|
|
53
|
+
|
|
54
|
+
### Models
|
|
55
|
+
|
|
56
|
+
- **Purpose**: assumptions that need computing rather than a simple change of value, such as rescheduling or recosting.
|
|
57
|
+
- **Where to set it**: under "Columns and progress", a model result on a source (an execution factory tool, computed once per scenario).
|
|
58
|
+
- **What to connect**: a function tool or registered service in the execution factory.
|
|
59
|
+
- **Input and output**: the sources it reads, scenario parameters and output columns come from the configuration. At most 5000 rows per input and 25000 in total. Beyond that "Compute" is unavailable and says why.
|
|
60
|
+
- **Failure and timeout**: a failed computation shows "Compute failed" with the reason, and an older result is marked as older. Other states are up to date, to recompute, computing, limited, reading inputs, and the result at the time of applying.
|
|
61
|
+
- **How results show**: the "Compute" button on the page computes the results still to recompute in the current scenario. In the comparison table "Compute" goes through the columns one after another.
|
|
62
|
+
|
|
63
|
+
## Interaction and links
|
|
64
|
+
|
|
65
|
+
- **Writes**: choosing a scenario writes the page's current scenario, and other components recalculate on it. The "simulate" action of other components and Agent suggestions also write to the current scenario, making a new one when there is none that can be changed.
|
|
66
|
+
- **Reads**: the comparison table follows the page's filters. The other styles do not read them.
|
|
67
|
+
- **Three styles**:
|
|
68
|
+
- Comparison table (default): one indicator per row, one column for the data as it is or for a scenario (at most 4 columns including the data as it is), a column head switches to it. Below, the differing scenario parameters and object changes between scenarios can be expanded (30 rows are shown first). It needs a source and at least one indicator. Without them it shows one line and says to choose them.
|
|
69
|
+
- Compact: one line with the scenario dropdown, new, and the current scenario's actions. Suits a page header.
|
|
70
|
+
- Assumptions: suits a side pane. It sets the current scenario's parameters, lists its assumptions and has "Add assumption". It is often paired with the compact style in the header.
|
|
71
|
+
- **Actions**: new scenario (when a scenario parameter lists its values you can also "make one per value of" it), copy, save or rename (name up to 40 characters), view assumptions (removable, with one undo), apply, void (asks to confirm; actions already run are not affected).
|
|
72
|
+
- **Applying**: lists each assumption with its action, and "to carry out by people" where there is none. Actions with an action run object by object as the current user. Each result is kept on the assumption, failed ones can be retried and successful ones never run twice.
|
|
73
|
+
|
|
74
|
+
## Recipes
|
|
75
|
+
|
|
76
|
+
### Trying other due dates on orders
|
|
77
|
+
|
|
78
|
+
| Role | Maps to |
|
|
79
|
+
| --- | --- |
|
|
80
|
+
| Object to try changes on | Sales order (due date, quantity, status) |
|
|
81
|
+
| Operation | "Delay": parameter days; effect: due date moves by days; action: change order due date |
|
|
82
|
+
| Compared indicators | Number of orders; number overdue (condition: progress status is overdue) |
|
|
83
|
+
| Style | Compact in the header, assumptions in the side pane, comparison table in the main area |
|
|
84
|
+
|
|
85
|
+
**The knowledge network needs:** an order object type and an action type "change order due date". The order source needs progress set, otherwise there is no "overdue".
|
|
86
|
+
|
|
87
|
+
**Checks:** make a scenario, add "delay 5 days" to two orders, and the comparison table shows a difference in overdue against the data as it is. The list shows "due date old to new". Applying opens the execution confirmation.
|
|
88
|
+
|
|
89
|
+
### Capacity under changing demand
|
|
90
|
+
|
|
91
|
+
| Role | Maps to |
|
|
92
|
+
| --- | --- |
|
|
93
|
+
| Object to try changes on | Demand forecast |
|
|
94
|
+
| Scenario parameter | Demand increase (number, default 0, unit %) |
|
|
95
|
+
| Model result source | A capacity load model reading demand forecasts and lines and giving the load rate |
|
|
96
|
+
| Compared indicators | Average load rate, number of overloaded lines |
|
|
97
|
+
|
|
98
|
+
**The knowledge network needs:** demand forecast and line object types. The load model is a function tool in the execution factory that reads the knowledge network.
|
|
99
|
+
|
|
100
|
+
**Checks:** make a scenario, set "Demand increase" to 10 and press "Compute". The table shows each column's load rate and its difference from the data as it is. Columns not computed show "To recompute".
|
|
101
|
+
|
|
102
|
+
## Guidance for AI
|
|
103
|
+
|
|
104
|
+
1. Confirm the environment offers scenarios. Then ask the user: which objects are tried and how (operations), what the result is judged by (compared indicators), which action runs when applying, whether there are global parameters, and whether a model must compute.
|
|
105
|
+
2. When the source has no operations, add them first under "Columns and progress". Otherwise the component can only make empty scenarios.
|
|
106
|
+
3. The comparison table needs a source and indicators (up to 8). A table style without them shows only one line with a prompt.
|
|
107
|
+
4. Pick the source that has operations. The default configuration does this and adds two indicators: "Count" and, when the source has progress, "Overdue".
|
|
108
|
+
5. Common mistakes:
|
|
109
|
+
- Putting business rules in the component. The effect of an assumption is configured in its operation, and rule judgment belongs in the knowledge network.
|
|
110
|
+
- Assuming a scenario is written back to the knowledge network. Only applying runs actions.
|
|
111
|
+
- Trying to apply without saving or computing: the button is disabled and says why.
|
|
112
|
+
|
|
113
|
+
## Limits
|
|
114
|
+
|
|
115
|
+
- The comparison table has at most 4 columns including the data as it is, and at most 8 indicators.
|
|
116
|
+
- Each source has at most 10 operations, each with at most 5 inputs and 5 effects. There are at most 10 scenario parameters, each text parameter with at most 10 values.
|
|
117
|
+
- A scenario name is at most 40 characters.
|
|
118
|
+
- A model result reads at most 5000 rows per input and 25000 in total.
|
|
119
|
+
`;
|
|
120
|
+
export {
|
|
121
|
+
e as default
|
|
122
|
+
};
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
const n = `# 调度甘特(scheduleGantt)
|
|
2
|
+
|
|
3
|
+
资源排成行、时间横向展开,在一个方案里拖动任务改资源与时间,由内置约束和知识网络上的规则判断方案能否采用。用来做排产、检修、派工这类“把任务排到资源上”的决策。
|
|
4
|
+
|
|
5
|
+
## 适用与不适用
|
|
6
|
+
|
|
7
|
+
- 适用:任务占用资源一段时间,需要看冲突、就绪、交期,并在方案中调整后再采用。例如生产工单排到产线、维修工单排到班组、检验任务排到检验员。
|
|
8
|
+
- 不适用:
|
|
9
|
+
- 只看进度、不按资源排:用甘特图(\`ganttChart\`)。
|
|
10
|
+
- 只看各环节的数量与流转:用环节链路(\`stageChain\`)。
|
|
11
|
+
- 只看某个对象的时间线:用对象详情。
|
|
12
|
+
|
|
13
|
+
## 本体契约
|
|
14
|
+
|
|
15
|
+
| 角色 | 对象类要求 | 必要的属性 | 关系 | 必填 |
|
|
16
|
+
| --- | --- | --- | --- | --- |
|
|
17
|
+
| 资源 | 被占用的东西:产线、设备、班组、人员 | 名称;可选:上级资源标识、并行上限(数字,默认 1)、分组属性 | 可有上级资源(工厂 → 产线),以属性取值表示 | 否:不配时按任务的所属资源自动成行 |
|
|
18
|
+
| 任务 | 被排的东西,1 到 3 类共用同一类资源 | 开始(日期);可选:结束、所属资源(取值为资源标识)、状态 | — | 是 |
|
|
19
|
+
| 需求 | 决定任务何时要完成:订单、预测单 | 交货日期 | 任务 → 需求,关联多个时取最早的 | 否 |
|
|
20
|
+
| 前置资源 | 任务开始前必须就绪的东西:物料、备件、图纸 | 就绪日 | 任务 → 前置资源,取最晚的就绪日并点名这个关键资源 | 否 |
|
|
21
|
+
| 前序任务 | 同一类任务之间的先后 | — | 任务 → 任务(一跳),可指向前序或后序 | 否 |
|
|
22
|
+
| 不可用时段 | 停机、检修、假期 | 所属资源、开始、结束 | 上级资源的时段对下级同样生效 | 否 |
|
|
23
|
+
| 计划记录 | 结果不写回任务、而是写成计划单时 | 所属资源、开始、结束;与任务的对应字段 | 由行动新建与修改 | 否 |
|
|
24
|
+
|
|
25
|
+
**结果写回哪里。** 两种之一:直接改任务的资源与时间(由任务的修改行动写回),或新建、修改计划记录(由计划记录的新建、修改行动写回)。两种都只在采用方案时执行行动;拖动只是在方案里记改动。
|
|
26
|
+
|
|
27
|
+
构建器中的“排程模型”向导按上表逐项提问,答完生成组件配置、数据源与情景操作。
|
|
28
|
+
|
|
29
|
+
## 组件内置的判断
|
|
30
|
+
|
|
31
|
+
与行业无关,组件自己检查:
|
|
32
|
+
|
|
33
|
+
| 检查 | 规则 | 性质 |
|
|
34
|
+
| --- | --- | --- |
|
|
35
|
+
| 资源超限 | 打开“任务占用资源”后,同一资源同一时间的任务数超过并行上限 | 硬约束:方案不能采用 |
|
|
36
|
+
| 不可排程时段 | 任务落在标为不可排程的背景时段内 | 硬约束 |
|
|
37
|
+
| 未就绪 | 开始早于最早开始,或早于前置资源中最晚的就绪日 | 硬约束 |
|
|
38
|
+
| 前序未完 | 开始早于前序任务的完成 | 硬约束 |
|
|
39
|
+
| 晚于目标 | 完成晚于目标完成(需求的交货日期) | 只标出,不阻止采用 |
|
|
40
|
+
| 关键链 | 配了目标与前序时,余量不大于 0 的任务 | 描边显示 |
|
|
41
|
+
|
|
42
|
+
满足“已完成条件”的任务不参与以上检查。硬约束只在方案改动过的任务(或与它冲突的任务)上阻止采用;数据里原本就存在的冲突只标出,不挡方案。采用对话框里取消勾选的改动不执行,也不算作方案的改动:它带来的硬约束不挡其他改动。
|
|
43
|
+
|
|
44
|
+
## 扩展点
|
|
45
|
+
|
|
46
|
+
### 规则工具
|
|
47
|
+
|
|
48
|
+
- **用途**:判断行业与场景规则,例如人员资质、温控时段、法规禁止时段、换型时间、物料齐套。
|
|
49
|
+
- **在哪里配**:任务图层的“规则工具”,每个图层最多 5 个;每个工具可设不通过时默认是硬约束还是软约束。
|
|
50
|
+
- **接什么**:执行工厂中的工具,通常是函数工具,在函数里读知识网络。
|
|
51
|
+
- **输入**:
|
|
52
|
+
|
|
53
|
+
\`\`\`json
|
|
54
|
+
{
|
|
55
|
+
"tasks": [
|
|
56
|
+
{ "key": "WO-1001", "start": "2026-11-20T00:00:00Z", "end": "2026-11-22T00:00:00Z", "resource": "LINE-2", "values": { "product": "P-88", "qty": 500 } }
|
|
57
|
+
],
|
|
58
|
+
"scenario": { "edits": [ { "source": "workorders", "key": "WO-1001", "operation": "reschedule", "params": { "start": "2026-11-20" } } ] }
|
|
59
|
+
}
|
|
60
|
+
\`\`\`
|
|
61
|
+
|
|
62
|
+
\`values\` 是任务对象的属性;\`scenario.edits\` 是当前方案里的全部改动,工具可据此判断“按这个方案排”是否成立。每次最多 200 个任务,超过时分批调用。
|
|
63
|
+
|
|
64
|
+
- **输出**:
|
|
65
|
+
|
|
66
|
+
\`\`\`json
|
|
67
|
+
{
|
|
68
|
+
"results": [
|
|
69
|
+
{
|
|
70
|
+
"key": "WO-1001",
|
|
71
|
+
"pass": false,
|
|
72
|
+
"severity": "hard",
|
|
73
|
+
"text": "缺 2 种物料:M-12 到货 11-25,M-30 无在途",
|
|
74
|
+
"related": ["WO-0998"],
|
|
75
|
+
"at": "2026-11-25T00:00:00Z",
|
|
76
|
+
"counts": [{ "label": "缺料", "value": 2, "tone": "hard" }],
|
|
77
|
+
"detail": true
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
\`\`\`
|
|
82
|
+
|
|
83
|
+
- \`pass\`:\`true\` 通过,\`false\` 不通过,\`null\` 不适用;没有返回的任务视为不适用。
|
|
84
|
+
- \`severity\`:可选,\`hard\` 或 \`soft\`;不写时用配置的默认值,默认为硬约束。
|
|
85
|
+
- \`text\`:一句话原因,显示在任务上和检查列表中。
|
|
86
|
+
- \`related\`:牵涉的其他任务,悬停时一并标出;它们改动后本任务会重新判断。
|
|
87
|
+
- \`at\`:可选,工具认为任务最早能开始的时间。
|
|
88
|
+
- \`counts\`:可选,最多 4 个汇总数字。
|
|
89
|
+
- \`detail\`:可选,为 \`true\` 时用户可以点开查看明细(见下)。
|
|
90
|
+
|
|
91
|
+
- **明细(解释)**:用户点开一个任务的规则结果时,以 \`{ "mode": "detail", "task": …, "scenario": { "edits" }, "locale", "query": { "group?", "keyOnly?", "search?", "offset", "limit" } }\` 再调用一次,工具返回一页表格:\`title\`、\`conclusion\`、可选的 \`at\`、\`summary\`(汇总数字)、\`groups\`(原因分组及数量)、\`columns\`(\`text\`、\`number\`、\`date\`、\`link\` 四种类型)、\`rows\`(\`key: true\` 表示决定结论的行,\`links\` 指向知识网络中的对象)、\`total\`。每页默认 50 行。
|
|
92
|
+
- **调用方式**:同一工具在同一方案中要判断的任务合并成一次调用(每次最多 200 个),不同工具的调用并行发出。一个页面同时在途的调用默认最多 3 个,其余排队;部署时可以调成 1 到 10。
|
|
93
|
+
- **慢与失败**:一次调用最长等 30 秒;没有返回或平台出错时,稍后自动再试一次,前后合计不超过 90 秒。重新判断期间任务上仍显示上次的结论,并标明是上次的结果。仍然失败,或返回格式不对、工具报错、找不到工具时,相关任务显示“未能校验”及原因,单独计数,按硬约束处理:方案里还有未能校验的任务时不能采用,重新检查通过后才能采用。
|
|
94
|
+
- **结果怎样参与决策**:不通过的任务与内置检查一起标出、计数、在状态摘要中筛选;方案改动过的任务(或与它冲突的任务)有硬约束不通过时,方案不能采用。改动方案后只重新判断受影响的任务:改了的任务、被移入或移出的资源上的任务,以及结果中点名了已改任务的任务。
|
|
95
|
+
|
|
96
|
+
### 写规则函数的要点
|
|
97
|
+
|
|
98
|
+
- **只读,可以反复调用**。每次拖动都可能调用一次,函数不改任何数据;要改数据的写成行动。
|
|
99
|
+
- **一次读够**。按整批任务的条件一次读出要用的对象和属性,不要逐个任务查询;只取用得到的属性。
|
|
100
|
+
- **页面调用时不在对话中**。经工具箱代理调用时没有对话上下文,读对象要走本体查询接口(按对象类查询对象);在对话或行动中调用时,可以用沙箱 SDK 读取。两种方式的结果应当一致。
|
|
101
|
+
- **翻页用游标**。一次读不完时,按返回的 \`paging.next_cursor\` 读下一页(请求里传 \`cursor\`),不要递增 \`offset\`:知识网络建好索引后,\`offset\` 加 \`limit\` 超过 10000 的查询会被拒绝,数据一多就会整批“未能校验”。
|
|
102
|
+
- **算不了就报错**。读不到数据、参数不对时抛出错误,不要返回通过;任务会显示“未能校验”并挡住采用。
|
|
103
|
+
- **跟随语言**。调用会带 \`locale\`(如 \`zh-CN\`、\`en-US\`),原因和明细的列名按它返回。
|
|
104
|
+
|
|
105
|
+
### 逻辑属性与指标
|
|
106
|
+
|
|
107
|
+
- **用途**:组件显示与着色用到的业务状态,例如“是否加急”“风险等级”。
|
|
108
|
+
- **在哪里配**:条上显示的属性、悬浮卡属性、按属性着色、已完成条件。
|
|
109
|
+
- **接什么**:任务或资源对象类上的属性或逻辑属性。是否加急、风险高低这类判断写成逻辑属性,组件只按取值显示,不在配置里重写判断。
|
|
110
|
+
|
|
111
|
+
## 交互与联动
|
|
112
|
+
|
|
113
|
+
- **写入**:点击任务或资源,写入该图层配置的选中变量,对象详情与关联表随之显示。
|
|
114
|
+
- **读取**:跟随页面的共享筛选,不满足的任务淡化显示。
|
|
115
|
+
- **方案**:配了“拖动时记入的调整操作”后,拖动任务或其右边缘在当前方案中记一条改动,没有打开的方案时新建一个;从待排区拖到资源行上,用新建操作在方案中新建一条计划记录。数据只在采用方案时改变。
|
|
116
|
+
- **行动**:采用方案时执行情景操作对应的行动(修改任务、新建或修改计划记录),按平台的执行确认与审批进行。
|
|
117
|
+
|
|
118
|
+
## 场景配方
|
|
119
|
+
|
|
120
|
+
### 生产齐套计划:产品能否生产、瓶颈是哪些
|
|
121
|
+
|
|
122
|
+
| 角色 | 对应 |
|
|
123
|
+
| --- | --- |
|
|
124
|
+
| 资源 | 产线(上级:工厂;并行上限:同时开工的工单数) |
|
|
125
|
+
| 任务 | 生产工单(开始、结束、所属产线、状态) |
|
|
126
|
+
| 需求 | 销售订单或需求预测单(交货日期) |
|
|
127
|
+
| 前置资源 | 工单的物料需求行(就绪日 = 预计到货或可领用日) |
|
|
128
|
+
| 不可用时段 | 产线停机计划 |
|
|
129
|
+
|
|
130
|
+
**知识网络中要有:**
|
|
131
|
+
|
|
132
|
+
- 工单 → 物料需求 → 物料的关系;物料的库存、在途与到货日期。
|
|
133
|
+
- 规则工具“齐套检查”:输入任务(工单、开工时间),在开工时间点按库存、在途、已被其他工单占用的数量计算每种物料是否够。
|
|
134
|
+
- 输出:\`pass\`(是否齐套);\`text\` 写缺几种、最晚的到货日;\`at\` 为全部齐套的最早日期;\`counts\` 给缺料种数;\`detail: true\`。
|
|
135
|
+
- 明细:按物料列出需求量、可用量、缺口、到货日。\`key: true\` 的行就是**瓶颈物料**,\`groups\` 按原因分组(缺料、在途未到、质检中)。
|
|
136
|
+
- 要考虑方案中的改动:两张工单在方案里被排到同一时间、争用同一物料时,按 \`scenario.edits\` 重新分配占用。
|
|
137
|
+
- 可选:工单的逻辑属性“是否加急”,用于着色。
|
|
138
|
+
|
|
139
|
+
**检查项:** 把一张缺料工单拖到到货日之前,任务标为不通过,方案不能采用;点开明细能看到瓶颈物料;拖到 \`at\` 之后通过。
|
|
140
|
+
|
|
141
|
+
### 设备维修:维修资源的规则
|
|
142
|
+
|
|
143
|
+
| 角色 | 对应 |
|
|
144
|
+
| --- | --- |
|
|
145
|
+
| 资源 | 维修班组或维修人员(并行上限:同时能做的工单数) |
|
|
146
|
+
| 任务 | 维修工单(计划开始、结束、负责人、状态) |
|
|
147
|
+
| 需求 | 设备的停机许可或保养截止日 |
|
|
148
|
+
| 前置资源 | 所需备件(就绪日 = 到货日) |
|
|
149
|
+
| 不可用时段 | 人员排班外的时间、设备运行不能停的时段 |
|
|
150
|
+
|
|
151
|
+
**知识网络中要有:**
|
|
152
|
+
|
|
153
|
+
- 维修工单 → 设备、→ 备件的关系;人员的资质与有效期。
|
|
154
|
+
- 规则工具“资质检查”:输入任务(工单、所排人员),检查人员是否持有该设备类型所需资质、资质在计划时间是否有效。\`pass\` 为是否满足;\`text\` 写缺哪项资质;\`severity: hard\`。
|
|
155
|
+
- 规则工具“停机窗口”(可选):设备只能在许可的停机窗口内维修。返回不在窗口内的任务与最近的窗口 \`at\`。
|
|
156
|
+
- 可选:维修工单的逻辑属性“紧急程度”,用于着色。
|
|
157
|
+
|
|
158
|
+
**检查项:** 把需要高压电工资质的工单拖给没有资质的人员,任务标为不通过;换给有资质的人员后通过;备件未到时标为未就绪。
|
|
159
|
+
|
|
160
|
+
## 给 AI 的指引
|
|
161
|
+
|
|
162
|
+
1. 先用“排程模型”的问题弄清角色:排什么(任务,最多 3 类)、排到什么上(资源)、何时要完成(需求)、什么要先就绪(前置资源)、什么时候不能用(不可用时段)、结果写回任务还是写成计划单。缺哪个就问用户,不要猜。
|
|
163
|
+
2. 角色在知识网络中找不到对应的对象类、属性或关系时,列出要补的内容,不要用别的对象凑。
|
|
164
|
+
3. 行业规则一律挂规则工具。工具不存在时,按上面的输入输出列出要新建的工具:名称、读哪些对象、判断什么、返回什么。不要把规则写成配置中的条件或计算列。
|
|
165
|
+
4. 晚于目标只标出、不阻止采用,用户要求“晚了就不能采用”时,说明要写成规则工具并设为硬约束。
|
|
166
|
+
5. 常见错误:
|
|
167
|
+
- 以物料为行时打开了“任务占用资源”,物料不是按时间独占的。
|
|
168
|
+
- 所属资源字段的取值不是资源的标识。
|
|
169
|
+
- 前序关系配成了任务到资源的关系。
|
|
170
|
+
|
|
171
|
+
## 限制
|
|
172
|
+
|
|
173
|
+
- 图层最多 8 个;每个任务图层的规则工具最多 5 个;排程模型中任务最多 3 类、不可用时段最多 3 类。
|
|
174
|
+
- 规则工具每次最多收 200 个任务;一次调用最长等 30 秒,失败后自动重试一次,合计不超过 90 秒。
|
|
175
|
+
- 前序关系只支持一跳关系。
|
|
176
|
+
- 规则工具在浏览器中按需调用,结果不保存;同一方案在另一页面打开时会重新判断。
|
|
177
|
+
`;
|
|
178
|
+
export {
|
|
179
|
+
n as default
|
|
180
|
+
};
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
const e = `# Schedule Gantt (scheduleGantt)
|
|
2
|
+
|
|
3
|
+
Resources as rows and time running across: in a scenario you drag tasks to change their resource and time, and built-in constraints plus rules on the knowledge network decide whether the scenario can be applied. Use it for decisions that put tasks on resources, such as production scheduling, maintenance and dispatching.
|
|
4
|
+
|
|
5
|
+
## When to use it and when not
|
|
6
|
+
|
|
7
|
+
- Use it when tasks take up a resource for a while, and you need to see conflicts, readiness and due dates and adjust in a scenario before applying. For example: production work orders on lines, repair work orders on crews, inspection tasks on inspectors.
|
|
8
|
+
- Do not use it:
|
|
9
|
+
- To follow progress without scheduling by resource: use the Gantt chart (\`ganttChart\`).
|
|
10
|
+
- To see only quantities and flow through stages: use the stage chain (\`stageChain\`).
|
|
11
|
+
- To see one object's timeline: use object details.
|
|
12
|
+
|
|
13
|
+
## Ontology contract
|
|
14
|
+
|
|
15
|
+
| Role | Object type | Required properties | Relations | Required |
|
|
16
|
+
| --- | --- | --- | --- | --- |
|
|
17
|
+
| Resource | What gets taken up: lines, machines, crews, people | Name; optional: parent resource ID, parallel limit (number, default 1), group property | May have a parent resource (plant → line), given as a property value | No: without it, rows come from the tasks' resources |
|
|
18
|
+
| Task | What gets scheduled; 1 to 3 types sharing one resource type | Start (date); optional: end, resource (value is the resource ID), status | — | Yes |
|
|
19
|
+
| Demand | Decides when a task must be done: orders, forecasts | Due date | Task → demand; with several, the earliest counts | No |
|
|
20
|
+
| Prerequisite | What must be ready before a task starts: materials, spare parts, drawings | Ready date | Task → prerequisite; the latest ready date counts and names that critical item | No |
|
|
21
|
+
| Predecessor | Order between tasks of one type | — | Task → task (one hop), pointing to the predecessor or the successor | No |
|
|
22
|
+
| Unavailable time | Downtime, maintenance, holidays | Resource, start, end | A parent resource's times apply to its children too | No |
|
|
23
|
+
| Plan record | When results are not written back to tasks but kept as plans | Resource, start, end; the fields that match its task | Created and changed by actions | No |
|
|
24
|
+
|
|
25
|
+
**Where results go.** One of two: change the task's resource and time directly (written back by the task's change action), or create and change plan records (written back by the plan record's create and change actions). Either way actions run only when the scenario is applied; dragging only records changes in the scenario.
|
|
26
|
+
|
|
27
|
+
The "Schedule model" wizard in the builder asks about the table above row by row, and generates the component's config, data sources and scenario operations from the answers.
|
|
28
|
+
|
|
29
|
+
## Built-in checks
|
|
30
|
+
|
|
31
|
+
Independent of industry, the component checks these itself:
|
|
32
|
+
|
|
33
|
+
| Check | Rule | Kind |
|
|
34
|
+
| --- | --- | --- |
|
|
35
|
+
| Over capacity | With "Tasks take up the resource" on, more tasks on one resource at one time than its parallel limit | Hard constraint: the scenario cannot be applied |
|
|
36
|
+
| Unschedulable time | A task falls in a background period marked as not schedulable | Hard constraint |
|
|
37
|
+
| Not ready | Start is before the earliest start, or before the latest ready date of its prerequisites | Hard constraint |
|
|
38
|
+
| Predecessor not done | Start is before the predecessor finishes | Hard constraint |
|
|
39
|
+
| Later than target | Finish is after the target finish (the demand's due date) | Marked only, does not block applying |
|
|
40
|
+
| Critical chain | With targets and predecessors set, tasks with no slack left | Outlined |
|
|
41
|
+
|
|
42
|
+
Tasks that meet "Done when" take no part in these checks. Hard constraints block applying only on tasks the scenario changed (or tasks that conflict with them); conflicts already in the data are marked but do not block the scenario. A change unticked in the apply dialog is not run and does not count as the scenario's: the hard constraints it brings do not block the other changes.
|
|
43
|
+
|
|
44
|
+
## Extension points
|
|
45
|
+
|
|
46
|
+
### Rule tools
|
|
47
|
+
|
|
48
|
+
- **What for**: rules of an industry or a case, such as staff qualifications, temperature-controlled periods, legally forbidden periods, changeover time, material kitting.
|
|
49
|
+
- **Where**: "Rule tools" on a task layer, up to 5 per layer; each tool can set whether a failure is a hard or a soft constraint by default.
|
|
50
|
+
- **What it connects to**: a tool in the execution factory, usually a function tool that reads the knowledge network.
|
|
51
|
+
- **Input**:
|
|
52
|
+
|
|
53
|
+
\`\`\`json
|
|
54
|
+
{
|
|
55
|
+
"tasks": [
|
|
56
|
+
{ "key": "WO-1001", "start": "2026-11-20T00:00:00Z", "end": "2026-11-22T00:00:00Z", "resource": "LINE-2", "values": { "product": "P-88", "qty": 500 } }
|
|
57
|
+
],
|
|
58
|
+
"scenario": { "edits": [ { "source": "workorders", "key": "WO-1001", "operation": "reschedule", "params": { "start": "2026-11-20" } } ] }
|
|
59
|
+
}
|
|
60
|
+
\`\`\`
|
|
61
|
+
|
|
62
|
+
\`values\` are the task object's properties; \`scenario.edits\` are all changes in the current scenario, so the tool can judge whether the plan holds as scheduled in it. At most 200 tasks per call; more go in batches.
|
|
63
|
+
|
|
64
|
+
- **Output**:
|
|
65
|
+
|
|
66
|
+
\`\`\`json
|
|
67
|
+
{
|
|
68
|
+
"results": [
|
|
69
|
+
{
|
|
70
|
+
"key": "WO-1001",
|
|
71
|
+
"pass": false,
|
|
72
|
+
"severity": "hard",
|
|
73
|
+
"text": "2 materials short: M-12 arrives 11-25, M-30 has none on order",
|
|
74
|
+
"related": ["WO-0998"],
|
|
75
|
+
"at": "2026-11-25T00:00:00Z",
|
|
76
|
+
"counts": [{ "label": "Short", "value": 2, "tone": "hard" }],
|
|
77
|
+
"detail": true
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
\`\`\`
|
|
82
|
+
|
|
83
|
+
- \`pass\`: \`true\` passes, \`false\` fails, \`null\` does not apply; a task with no result does not apply.
|
|
84
|
+
- \`severity\`: optional, \`hard\` or \`soft\`; without it the configured default is used, a hard constraint by default.
|
|
85
|
+
- \`text\`: the reason in one sentence, shown on the task and in the check list.
|
|
86
|
+
- \`related\`: other tasks involved, highlighted on hover; when they change, this task is judged again.
|
|
87
|
+
- \`at\`: optional, the earliest time the tool finds the task can start.
|
|
88
|
+
- \`counts\`: optional, up to 4 summary numbers.
|
|
89
|
+
- \`detail\`: optional; when \`true\` the user can open the details (below).
|
|
90
|
+
|
|
91
|
+
- **Details (explanation)**: when the user opens a task's rule result, the tool is called again with \`{ "mode": "detail", "task": …, "scenario": { "edits" }, "locale", "query": { "group?", "keyOnly?", "search?", "offset", "limit" } }\` and returns one page of a table: \`title\`, \`conclusion\`, optional \`at\`, \`summary\` (summary numbers), \`groups\` (reasons with their counts), \`columns\` (four types: \`text\`, \`number\`, \`date\`, \`link\`), \`rows\` (\`key: true\` marks the rows that decide the conclusion; \`links\` point to objects in the knowledge network), \`total\`. 50 rows per page by default.
|
|
92
|
+
- **How calls go out**: the tasks a tool must judge in one scenario go in one call (up to 200 tasks); calls of different tools go out side by side. A page has at most 3 calls out at once by default, the rest wait in a queue; the deployment can set this from 1 to 10.
|
|
93
|
+
- **Slow answers and failures**: a call waits up to 30 seconds; when it gets no answer or the platform fails, it is tried once more after a short pause, 90 seconds in all. While a task is judged again it keeps showing its last result, marked as the last check's. When it still fails, or the answer is malformed, the tool fails or cannot be found, the tasks show "Not checked" with the reason, counted on their own and treated as a hard constraint: a scenario with tasks not checked cannot be applied until a new check passes.
|
|
94
|
+
- **How results take part in decisions**: failing tasks are marked, counted and filtered in the status summary together with the built-in checks; when a task the scenario changed (or one conflicting with it) fails a hard constraint, the scenario cannot be applied. After a scenario change only the affected tasks are judged again: the changed tasks, tasks on the resources they moved onto or off, and tasks whose results named a changed task.
|
|
95
|
+
|
|
96
|
+
### Writing a rule function
|
|
97
|
+
|
|
98
|
+
- **Read only, safe to call again and again.** It may be called on every drag, so the function changes no data; what changes data is an action.
|
|
99
|
+
- **Read everything in one go.** Read the objects and properties the whole batch needs with conditions, once; do not query task by task, and take only the properties you use.
|
|
100
|
+
- **Page calls run outside a conversation.** Called through the toolbox proxy there is no conversation context, so read objects through the ontology query API (objects of an object type); called in a conversation or an action, the sandbox SDK can read them. Both ways must give the same result.
|
|
101
|
+
- **Page with the cursor.** When one read does not return everything, read the next page with the returned \`paging.next_cursor\` (send it as \`cursor\`), not by raising \`offset\`: once the knowledge network is indexed, queries with \`offset\` plus \`limit\` above 10,000 are refused, and with more data the whole batch turns "Not checked".
|
|
102
|
+
- **Fail when you cannot compute.** When data cannot be read or parameters are wrong, raise an error instead of passing; the tasks show "Not checked" and block applying.
|
|
103
|
+
- **Follow the language.** Calls carry \`locale\` (such as \`zh-CN\` or \`en-US\`); return reasons and detail column names in it.
|
|
104
|
+
|
|
105
|
+
### Logical properties and metrics
|
|
106
|
+
|
|
107
|
+
- **What for**: business states the component shows or colors by, such as "rush order" or "risk level".
|
|
108
|
+
- **Where**: properties shown on bars, popover properties, color by property, "Done when".
|
|
109
|
+
- **What it connects to**: properties or logical properties of the task or resource object types. Write judgements such as rush or risk as logical properties; the component only shows their values and does not repeat the judgement in its config.
|
|
110
|
+
|
|
111
|
+
## Interaction and links
|
|
112
|
+
|
|
113
|
+
- **Writes**: clicking a task or resource writes the layer's selection variable; object details and related tables follow.
|
|
114
|
+
- **Reads**: follows the page's shared filters; tasks that do not match are dimmed.
|
|
115
|
+
- **Scenarios**: with "Adjust operation when dragging" set, dragging a task or its right edge records a change in the current scenario, creating one when none is open; dragging from the tray onto a resource row creates a plan record in the scenario with the create operation. Data changes only when the scenario is applied.
|
|
116
|
+
- **Actions**: applying a scenario runs the actions of its scenario operations (change tasks, create or change plan records), with the platform's execution confirmation and approval.
|
|
117
|
+
|
|
118
|
+
## Recipes
|
|
119
|
+
|
|
120
|
+
### Production kitting: can the product be built, and what is the bottleneck
|
|
121
|
+
|
|
122
|
+
| Role | Maps to |
|
|
123
|
+
| --- | --- |
|
|
124
|
+
| Resource | Production line (parent: plant; parallel limit: work orders running at once) |
|
|
125
|
+
| Task | Production work order (start, end, line, status) |
|
|
126
|
+
| Demand | Sales order or demand forecast (due date) |
|
|
127
|
+
| Prerequisite | The work order's material requirement lines (ready date = expected arrival or issue date) |
|
|
128
|
+
| Unavailable time | Line downtime plans |
|
|
129
|
+
|
|
130
|
+
**The knowledge network needs:**
|
|
131
|
+
|
|
132
|
+
- Relations work order → material requirement → material; the material's stock, on-order quantities and arrival dates.
|
|
133
|
+
- A rule tool "Kit check": given tasks (work order, start time), works out at the start time whether each material is enough, from stock, on-order quantities and what other work orders already take up.
|
|
134
|
+
- Output: \`pass\` (fully kitted or not); \`text\` says how many materials are short and the latest arrival; \`at\` is the earliest date all are in; \`counts\` gives the number of short materials; \`detail: true\`.
|
|
135
|
+
- Details: one row per material with need, available, shortfall and arrival date. Rows with \`key: true\` are the **bottleneck materials**; \`groups\` groups them by reason (short, on order not arrived, in inspection).
|
|
136
|
+
- Take scenario changes into account: when two work orders are moved to the same time in the scenario and compete for one material, share it out again by \`scenario.edits\`.
|
|
137
|
+
- Optional: a logical property "rush order" on work orders, for coloring.
|
|
138
|
+
|
|
139
|
+
**To check:** drag a short work order before the arrival date: the task fails and the scenario cannot be applied; the details show the bottleneck material; dragged after \`at\`, it passes.
|
|
140
|
+
|
|
141
|
+
### Equipment maintenance: rules for maintenance resources
|
|
142
|
+
|
|
143
|
+
| Role | Maps to |
|
|
144
|
+
| --- | --- |
|
|
145
|
+
| Resource | Maintenance crew or technician (parallel limit: work orders at once) |
|
|
146
|
+
| Task | Maintenance work order (planned start, end, assignee, status) |
|
|
147
|
+
| Demand | The equipment's shutdown permit or service deadline |
|
|
148
|
+
| Prerequisite | Spare parts needed (ready date = arrival date) |
|
|
149
|
+
| Unavailable time | Time outside shifts; periods when the equipment must keep running |
|
|
150
|
+
|
|
151
|
+
**The knowledge network needs:**
|
|
152
|
+
|
|
153
|
+
- Relations maintenance work order → equipment and → spare parts; staff qualifications and their validity.
|
|
154
|
+
- A rule tool "Qualification check": given tasks (work order, assigned technician), checks that the technician holds the qualification the equipment type needs and that it is valid at the planned time. \`pass\` says whether it is met; \`text\` names the missing qualification; \`severity: hard\`.
|
|
155
|
+
- A rule tool "Shutdown window" (optional): equipment may be repaired only in permitted shutdown windows. Returns the tasks outside a window and the nearest window as \`at\`.
|
|
156
|
+
- Optional: a logical property "urgency" on maintenance work orders, for coloring.
|
|
157
|
+
|
|
158
|
+
**To check:** drag a work order that needs a high-voltage electrician to a technician without that qualification: the task fails; given to a qualified technician, it passes; with spare parts not yet arrived, it is marked not ready.
|
|
159
|
+
|
|
160
|
+
## Guidance for AI
|
|
161
|
+
|
|
162
|
+
1. Settle the roles with the "Schedule model" questions first: what is scheduled (tasks, up to 3 types), on what (resources), by when (demand), what must be ready first (prerequisites), when resources cannot be used (unavailable times), and whether results go back to tasks or into plan records. Ask the user about anything missing; do not guess.
|
|
163
|
+
2. When a role has no matching object type, property or relation in the knowledge network, list what must be added; do not make do with other objects.
|
|
164
|
+
3. Put every industry rule in a rule tool. When the tool does not exist, list the tool to create by the input and output above: name, which objects it reads, what it judges, what it returns. Do not write rules as conditions or computed columns in the config.
|
|
165
|
+
4. Later than target is only marked and does not block applying; when the user wants "late means it cannot be applied", explain that it must be a rule tool set as a hard constraint.
|
|
166
|
+
5. Common mistakes:
|
|
167
|
+
- "Tasks take up the resource" turned on with materials as rows: materials are not taken up exclusively over time.
|
|
168
|
+
- The resource field's values are not the resources' IDs.
|
|
169
|
+
- The predecessor relation set as a task-to-resource relation.
|
|
170
|
+
|
|
171
|
+
## Limits
|
|
172
|
+
|
|
173
|
+
- Up to 8 layers; up to 5 rule tools per task layer; in the schedule model up to 3 task types and 3 types of unavailable time.
|
|
174
|
+
- A rule tool gets at most 200 tasks per call; a call waits up to 30 seconds and is tried once more after a failure, 90 seconds in all.
|
|
175
|
+
- Predecessor relations are one hop only.
|
|
176
|
+
- Rule tools are called in the browser as needed and their results are not saved; the same scenario opened in another page is judged again.
|
|
177
|
+
`;
|
|
178
|
+
export {
|
|
179
|
+
e as default
|
|
180
|
+
};
|