集合/base/contours.md
流程轮廓
所有层中记录的状态:每个流程轮廓都有自己的阶段、转换和条件。
流程轮廓是一类记录的生命周期:状态、它们之间的转换,以及转换的条件。每一层把自己的流程轮廓保存在 <layer>/contours/ 文件夹中;本集合按类型 Contour 把它们全部汇集到一处。流程轮廓通过集合文件本身中一个“阶段”类型的字段来驱动该集合。
由数据计算出的状态(逾期、已完成、结论)永远不是流程轮廓。这些值由程序自行计算,不由人手动设置。
流程轮廓如何编写
流程轮廓是页面 <layer>/contours/<name>.md;它的阶段是同名文件夹 <layer>/contours/<name>/<phase>.md 中的页面。阶段名就是去掉 .md 的文件名;记录状态字段中填写的正是这个名称。
# /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
# /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 的阶段可以接收来自任何阶段的记录。转换的条件及由谁执行,写在流程轮廓正文的“从、到、条件”表格中。