包页面→ /base/contours.md
pages/base/contours.md
62 行, 2.9 KB. 以页面形式查看.
- ---
- type: Collection
- title: "流程轮廓"
- icon: "🔁"
- description: "所有层中记录的状态:每个流程轮廓都有自己的阶段、转换和条件。"
- itemType: Contour
- items: {mode: type}
- writeTo: /base/contours
- properties:
- collection: {kind: text, label: "驱动的集合"}
- views:
- - id: contours--table
- name: "全部流程轮廓"
- layout: table
- fields: {}
- sorting:
- - {propertyId: title, direction: ascending}
- properties:
- - {name: title, visible: true, width: 360}
- - {name: collection, visible: true}
- ---
- 流程轮廓是一类记录的生命周期:状态、它们之间的转换,以及转换的条件。每一层把自己的流程轮廓保存在 `<layer>/contours/` 文件夹中;本集合按类型 `Contour` 把它们全部汇集到一处。流程轮廓通过集合文件本身中一个“阶段”类型的字段来驱动该集合。
- 由数据计算出的状态(逾期、已完成、结论)永远不是流程轮廓。这些值由程序自行计算,不由人手动设置。
- ## 流程轮廓如何编写
- 流程轮廓是页面 `<layer>/contours/<name>.md`;它的阶段是同名文件夹 `<layer>/contours/<name>/<phase>.md` 中的页面。阶段名就是去掉 `.md` 的文件名;记录状态字段中填写的正是这个名称。
- ```yaml
- # /research/contours/hypotheses.md
- type: Contour
- title: 假设
- collection: /research/hypotheses # 驱动哪个集合
- stageField: status # 记录中的状态字段
- entry: /research/contours/hypotheses/proposed
- phases:
- - /research/contours/hypotheses/proposed
- - /research/contours/hypotheses/checking
- - /research/contours/hypotheses/paused
- ```
- ```yaml
- # /research/contours/hypotheses/paused.md
- type: Phase
- title: 暂停
- category: dropped # arriving · working · done · dropped
- doneWhen: "已决定是否回到这个假设"
- next:
- - {to: /research/contours/hypotheses/proposed, gate: person}
- ```
- 在集合中,状态字段属于“阶段”类型,并指明流程轮廓:`status: {kind: phase, contour: /research/contours/hypotheses}`。阶段的出口(`next`)即允许的转换;最后一个阶段为 `next: []`。带有 `fromAnywhere: true` 的阶段可以接收来自任何阶段的记录。转换的条件及由谁执行,写在流程轮廓正文的“从、到、条件”表格中。
- ## 规范的执行器(enforcer)
- | 规范 | 含义 | 执行器(检查) |
- |---|---|---|
- | [CNT-R01](/norms/rules/contours/CNT-R01.md) | 记录的状态是其流程轮廓的阶段 | `states` |
- | [CNT-R02](/norms/rules/contours/CNT-R02.md) | 流程轮廓是完整连接的:集合存在,阶段存在,入口和出口都是该流程轮廓的阶段 | `contour` |
- | [CNT-R03](/norms/rules/contours/CNT-R03.md) | 记录只能通过允许的转换改变状态 | `moves` |