wf_process.go 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. Label string `json:"label" gorm:"comment:节点名称"`
  17. Type string `json:"type" gorm:"comment:图标类型"`
  18. Shape string `json:"shape" gorm:"comment:形状"`
  19. X float64 `json:"y" gorm:"comment:x位置"`
  20. Y float64 `json:"x" gorm:"comment:y位置"`
  21. WaitState string `json:"waitState" gorm:"comment:等待属性"`
  22. StateValue string `json:"stateValue" gorm:"comment:等待值"`
  23. To string `json:"to" gorm:"comment:收件人"`
  24. Subject string `json:"subject" gorm:"comment:标题"`
  25. Content string `json:"content" gorm:"comment:内容"`
  26. Cycle string `json:"cycle" gorm:"comment:循环时间"`
  27. Duration string `json:"duration" gorm:"comment:持续时间"`
  28. HideIcon bool `json:"hideIcon" gorm:"comment:是否隐藏图标"`
  29. }
  30. type WorkflowEdge struct {
  31. ID string `json:"id" gorm:"comment:唯一标识;primaryKey"`
  32. WorkflowProcessID string `json:"-" gorm:"comment:流程标识"`
  33. Clazz string `json:"clazz" gorm:"comment:类型(线)"`
  34. Source string `json:"source" gorm:"comment:起点节点"`
  35. Target string `json:"target" gorm:"comment:目标节点"`
  36. SourceAnchor int `json:"sourceAnchor" gorm:"comment:起点"`
  37. TargetAnchor int `json:"targetAnchor" gorm:"comment:目标点"`
  38. Shape string `json:"shape" gorm:"comment:形状"`
  39. StartPoint WorkflowPoint `json:"startPoint"` // 起点信息
  40. EndPoint WorkflowPoint `json:"endPoint"` // 终点信息
  41. Label string `json:"label" gorm:"comment:标题"`
  42. HideIcon bool `json:"hideIcon" gorm:"comment:隐藏图标"`
  43. ConditionExpression string `json:"conditionExpression" gorm:"comment:条件标识"`
  44. Seq string `json:"seq" gorm:"comment:序号"`
  45. Reverse bool `json:"reverse" gorm:"comment:是否反向"`
  46. }
  47. type WorkflowPoint struct {
  48. ID string `json:"-" gorm:"comment:唯一标识;primaryKey"`
  49. WorkflowEdgeID string `json:"-"`
  50. X float64 `json:"x"`
  51. Y float64 `json:"y"`
  52. Index int `json:"index"`
  53. }