wf_process.go 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. package model
  2. type WorkflowProcess struct {
  3. ID string `json:"id" gorm:"comment:流程标识;primaryKey"`
  4. Name string `json:"name" gorm:"comment:流程名称"`
  5. Category string `json:"category" gorm:"comment:分类"`
  6. Clazz string `json:"clazz" gorm:"comment:类型"`
  7. Label string `json:"label" gorm:"comment:流程标题"`
  8. HideIcon bool `json:"hideIcon" gorm:"comment:是否隐藏图标"`
  9. Nodes []WorkflowNode `json:"nodes"` // 流程节点数据
  10. Edges []WorkflowEdge `json:"edges"` // 流程链接数据
  11. }
  12. type WorkflowNode struct {
  13. ID string `json:"id" gorm:"comment:节点id;primaryKey"`
  14. WorkflowProcessID string `json:"-" gorm:"comment:流程标识"`
  15. Clazz string `json:"clazz" gorm:"comment:节点类型"`
  16. Size [2]int `json:"size" gorm:"comment:节点大小"`
  17. Label string `json:"label" gorm:"comment:节点名称"`
  18. Type string `json:"type" gorm:"comment:图标类型"`
  19. Shape string `json:"shape" gorm:"comment:形状"`
  20. X float64 `json:"y" gorm:"comment:x位置"`
  21. Y float64 `json:"x" gorm:"comment:y位置"`
  22. WaitState string `json:"waitState" gorm:"comment:等待属性"`
  23. StateValue string `json:"stateValue" gorm:"comment:等待值"`
  24. To string `json:"to" gorm:"comment:收件人"`
  25. Subject string `json:"subject" gorm:"comment:标题"`
  26. Content string `json:"content" gorm:"comment:内容"`
  27. Cycle string `json:"cycle" gorm:"comment:循环时间"`
  28. Duration string `json:"duration" gorm:"comment:持续时间"`
  29. HideIcon bool `json:"hideIcon" gorm:"comment:是否隐藏图标"`
  30. }
  31. type WorkflowEdge struct {
  32. ID string `json:"id" gorm:"comment:唯一标识;primaryKey"`
  33. WorkflowProcessID string `json:"-" gorm:"comment:流程标识"`
  34. Clazz string `json:"clazz" gorm:"comment:类型(线)"`
  35. Source string `json:"source" gorm:"comment:起点节点"`
  36. Target string `json:"target" gorm:"comment:目标节点"`
  37. SourceAnchor int `json:"sourceAnchor" gorm:"comment:起点"`
  38. TargetAnchor int `json:"targetAnchor" gorm:"comment:目标点"`
  39. Shape string `json:"shape" gorm:"comment:形状"`
  40. StartPoint WorkflowPoint `json:"startPoint"` // 起点信息
  41. EndPoint WorkflowPoint `json:"endPoint"` // 终点信息
  42. Label string `json:"label" gorm:"comment:标题"`
  43. HideIcon bool `json:"hideIcon" gorm:"comment:隐藏图标"`
  44. ConditionExpression string `json:"conditionExpression" gorm:"comment:条件标识"`
  45. Seq string `json:"seq" gorm:"comment:序号"`
  46. Reverse bool `json:"reverse" gorm:"comment:是否反向"`
  47. }
  48. type WorkflowPoint struct {
  49. ID string `json:"-" gorm:"comment:唯一标识;primaryKey"`
  50. WorkflowEdgeID string `json:"-"`
  51. X float64 `json:"x"`
  52. Y float64 `json:"y"`
  53. Index int `json:"index"`
  54. }