ShtukbaseStandard
包页面→ /base/contours.md

pages/base/contours.md

62 行, 2.9 KB. 以页面形式查看.

  1. ---
  2. type: Collection
  3. title: "流程轮廓"
  4. icon: "🔁"
  5. description: "所有层中记录的状态:每个流程轮廓都有自己的阶段、转换和条件。"
  6. itemType: Contour
  7. items: {mode: type}
  8. writeTo: /base/contours
  9. properties:
  10. collection: {kind: text, label: "驱动的集合"}
  11. views:
  12. - id: contours--table
  13. name: "全部流程轮廓"
  14. layout: table
  15. fields: {}
  16. sorting:
  17. - {propertyId: title, direction: ascending}
  18. properties:
  19. - {name: title, visible: true, width: 360}
  20. - {name: collection, visible: true}
  21. ---
  22. 流程轮廓是一类记录的生命周期:状态、它们之间的转换,以及转换的条件。每一层把自己的流程轮廓保存在 `<layer>/contours/` 文件夹中;本集合按类型 `Contour` 把它们全部汇集到一处。流程轮廓通过集合文件本身中一个“阶段”类型的字段来驱动该集合。
  23. 由数据计算出的状态(逾期、已完成、结论)永远不是流程轮廓。这些值由程序自行计算,不由人手动设置。
  24. ## 流程轮廓如何编写
  25. 流程轮廓是页面 `<layer>/contours/<name>.md`;它的阶段是同名文件夹 `<layer>/contours/<name>/<phase>.md` 中的页面。阶段名就是去掉 `.md` 的文件名;记录状态字段中填写的正是这个名称。
  26. ```yaml
  27. # /research/contours/hypotheses.md
  28. type: Contour
  29. title: 假设
  30. collection: /research/hypotheses # 驱动哪个集合
  31. stageField: status # 记录中的状态字段
  32. entry: /research/contours/hypotheses/proposed
  33. phases:
  34. - /research/contours/hypotheses/proposed
  35. - /research/contours/hypotheses/checking
  36. - /research/contours/hypotheses/paused
  37. ```
  38. ```yaml
  39. # /research/contours/hypotheses/paused.md
  40. type: Phase
  41. title: 暂停
  42. category: dropped # arriving · working · done · dropped
  43. doneWhen: "已决定是否回到这个假设"
  44. next:
  45. - {to: /research/contours/hypotheses/proposed, gate: person}
  46. ```
  47. 在集合中,状态字段属于“阶段”类型,并指明流程轮廓:`status: {kind: phase, contour: /research/contours/hypotheses}`。阶段的出口(`next`)即允许的转换;最后一个阶段为 `next: []`。带有 `fromAnywhere: true` 的阶段可以接收来自任何阶段的记录。转换的条件及由谁执行,写在流程轮廓正文的“从、到、条件”表格中。
  48. ## 规范的执行器(enforcer)
  49. | 规范 | 含义 | 执行器(检查) |
  50. |---|---|---|
  51. | [CNT-R01](/norms/rules/contours/CNT-R01.md) | 记录的状态是其流程轮廓的阶段 | `states` |
  52. | [CNT-R02](/norms/rules/contours/CNT-R02.md) | 流程轮廓是完整连接的:集合存在,阶段存在,入口和出口都是该流程轮廓的阶段 | `contour` |
  53. | [CNT-R03](/norms/rules/contours/CNT-R03.md) | 记录只能通过允许的转换改变状态 | `moves` |