Documentation
¶
Overview ¶
Package designer 定义 go-wind-ui 流程设计器与 go-wind-flow 之间的 JSON 契约(designer-json-v1):领域结构 + UI 元数据(节点坐标、边拐点)。
契约细节见仓库 docs/designer_contract.md。要点:
- 节点/边的业务字段与引擎 flow.Node / flow.Edge 一一对应(同一 json tag), 设计器保存的文档可直接 Deploy(Format = "designer-json-v1",亦可留空—— 内容嗅探对 '{' 开头且含 "version":1 的文档命中本格式);
- UI 元数据(ui.*)由服务端原样保留在文档里,引擎忽略;
- 定义不可变:设计器每次"发布"= Deploy 新版本。
Index ¶
Constants ¶
const FormatName = "designer-json-v1"
FormatName 注册到引擎的格式标识。
const Version = 1
Version 当前契约版本。
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Document ¶
type Document struct {
Version int `json:"version"`
Key string `json:"key"`
Name string `json:"name,omitempty"`
Nodes []Node `json:"nodes"`
Edges []Edge `json:"edges"`
}
Document 设计器文档。
type Edge ¶
type Edge struct {
ID string `json:"id"`
Source string `json:"source"`
Target string `json:"target"`
Name string `json:"name,omitempty"`
Condition string `json:"condition,omitempty"`
IsDefault bool `json:"isDefault,omitempty"`
UI *EdgeUI `json:"ui,omitempty"`
}
Edge 设计器连线:source/target 遵循设计器(bpmn-js)惯例, 解析时映射为领域的 From/To。
type EdgeUI ¶
type EdgeUI struct {
// Waypoints 拐点序列(画布坐标,不含端点)。
Waypoints [][2]float64 `json:"waypoints,omitempty"`
}
EdgeUI 连线的 UI 元数据。
type Exporter ¶
type Exporter struct{}
Exporter 实现 flow.Exporter。