Documentation
¶
Index ¶
- type CommonID
- type Condition
- type HistProcDef
- type HistProcExecution
- type HistProcInst
- type HistProcInstVariable
- type HistProcTask
- type HybridGateway
- type Instance
- type LocalTime
- type Node
- type NodeType
- type ProcDef
- type ProcExecution
- type ProcInst
- type ProcInstVariable
- type ProcTask
- type Process
- type Task
- type TaskAction
- type Variable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommonID ¶
type CommonID struct {
ID int `gorm:"primaryKey;column:id;type:INT UNSIGNED NOT NULL AUTO_INCREMENT;"`
}
type HistProcDef ¶
type HistProcDef struct {
gorm.Model
CommonID
ProcID int `gorm:"column:proc_id;type:INT UNSIGNED NOT NULL;comment:流程ID"`
Name string `gorm:"column:name;type:VARCHAR(250) NOT NULL;comment:流程名字;"`
Version int `gorm:"column:version;type:INT UNSIGNED NOT NULL DEFAULT 1;default:1;comment:版本号"`
Resource string `gorm:"column:resource;type:TEXT NOT NULL;comment:流程定义模板"`
UserID string `gorm:"column:user_id;type:VARCHAR(250) NOT NULL;comment:创建者ID"`
Source string `` /* 155-byte string literal not displayed */
CreatTime LocalTime `gorm:"column:create_time;type:DATETIME DEFAULT NOW();default:NOW();comment:创建时间"`
}
HistProcDef 流程定义历史表
func (*HistProcDef) TableName ¶
func (hd *HistProcDef) TableName() string
type HistProcExecution ¶
type HistProcExecution struct {
gorm.Model
// ID int `gorm:"primaryKey;column:id;type:INT UNSIGNED NOT NULL AUTO_INCREMENT;"`
ProcID int `gorm:"index:ix_proc_id;column:proc_id;type:INT UNSIGNED NOT NULL;comment:流程ID"`
ProcVersion int `gorm:"column:proc_version;type:INT UNSIGNED NOT NULL;comment:流程版本号"`
NodeID string `gorm:"column:node_id;type:VARCHAR(250) NOT NULL;comment:节点ID"`
NodeName string `gorm:"column:node_name;type:VARCHAR(250) NOT NULL;comment:节点名称"`
PrevNodeID string `gorm:"column:prev_node_id;type:VARCHAR(250) DEFAULT NULL;default NULL;comment:上级节点ID"`
NodeType int `` /* 126-byte string literal not displayed */
IsCosigned int `gorm:"column:is_cosigned;type:TINYINT NOT NULL;comment:是否会签"`
CreateTime LocalTime `gorm:"column:create_time;type:DATETIME DEFAULT NOW();default NOW();comment:创建时间"`
}
HistProcExecution 流程节点执行关系定义历史表
func (*HistProcExecution) TableName ¶
func (he *HistProcExecution) TableName() string
type HistProcInst ¶
type HistProcInst struct {
//CommonID
gorm.Model
ProcInstID int `gorm:"index:ix_proc_inst_id;column:proc_inst_id;type:INT UNSIGNED NOT NULL;comment:流程实例ID"`
ProcID int `gorm:"column:proc_id;type:INT NOT NULL;index:ix_proc_id;comment:流程ID"`
ProcVersion int `gorm:"column:proc_version;type:INT UNSIGNED NOT NULL;comment:流程版本号"`
BusinessID string `gorm:"column:business_id;type:VARCHAR(250) DEFAULT NULL;default:NULL;comment:业务ID"`
Starter string `gorm:"index:ix_starter;column:starter;type:VARCHAR(250) NOT NULL;comment:流程发起人用户ID"`
CurrentNodeID string `gorm:"column:current_node_id;type:VARCHAR(250) NOT NULL;comment:当前进行节点ID"`
CreateTime LocalTime `gorm:"column:create_time;type:DATETIME DEFAULT NOW();default:NOW();comment:创建时间"`
Status int `gorm:"column:status;type:TINYINT DEFAULT 0 ;default 0;comment:0:未完成(审批中) 1:已完成(通过) 2:撤销"`
}
HistProcInst 流程实例历史表
func (*HistProcInst) TableName ¶
func (h *HistProcInst) TableName() string
type HistProcInstVariable ¶
type HistProcInstVariable struct {
gorm.Model
// ID int `gorm:"primaryKey;column:id;type:INT UNSIGNED NOT NULL AUTO_INCREMENT;"`
ProcInstID int `gorm:"index:ix_proc_inst_id;column:proc_inst_id;type:INT UNSIGNED NOT NULL;comment:流程实例ID"`
Key string `gorm:"column:key;type:VARCHAR(250) NOT NULL;comment:变量key"`
Value string `gorm:"column:value;type:VARCHAR(250) NOT NULL;comment:变量value"`
}
HistProcInstVariable 流程实例变量历史表
func (*HistProcInstVariable) TableName ¶
func (hivv *HistProcInstVariable) TableName() string
type HistProcTask ¶
type HistProcTask struct {
gorm.Model
// CommonID
TaskID int `gorm:"index:ix_task_id;column:task_id;type:INT UNSIGNED NOT NULL;comment:任务ID"`
ProcID int `gorm:"index:ix_proc_id;column:proc_id;type:INT UNSIGNED NOT NULL;comment:流程ID,冗余字段,偷懒用"`
ProcInstID int `gorm:"index:ix_proc_inst_id;column:proc_inst_id;type:INT UNSIGNED NOT NULL;comment:流程实例ID"`
BusinessID string `gorm:"column:business_id;type:VARCHAR(250) DEFAULT NULL;default:NULL;comment:业务ID,冗余字段,偷懒用"`
Starter string `gorm:"index:ix_starter;column:starter;type:VARCHAR(250) NOT NULL;comment:流程发起人用户ID,冗余字段,偷懒用"`
NodeID string `gorm:"column:node_id;type:VARCHAR(250) NOT NULL;comment:节点ID"`
NodeName string `gorm:"column:node_name;type:VARCHAR(250) NOT NULL;comment:节点名称"`
PrevNodeID string `` /* 213-byte string literal not displayed */
IsCosigned int `gorm:"column:is_cosigned;type:TINYINT DEFAULT 0;default:0;comment:0:任意一人通过即可 1:会签"`
BatchCode string `` /* 180-byte string literal not displayed */
UserID string `gorm:"index:ix_user_id;column:user_id;type:VARCHAR(250) NOT NULL;comment:分配用户ID"`
Status int `gorm:"column:status;type:TINYINT DEFAULT 0;default:0;comment:任务状态:0:初始 1:通过 2:驳回"`
IsFinished int `` /* 205-byte string literal not displayed */
Comment string `gorm:"column:comment;type:TEXT;default:NULL;comment:任务备注"`
ProcInstCreateTime LocalTime `gorm:"column:proc_inst_create_time;type:DATETIME NOT NULL;comment:流程实例创建时间,冗余字段,偷懒用"`
CreateTime LocalTime `gorm:"column:create_time;type:DATETIME DEFAULT NOW();default:NOW();comment:系统创建任务时间"`
FinishedTime LocalTime `gorm:"index:ix_finished_time;column:finished_time;type:DATETIME DEFAULT NULL;default:NULL;comment:处理任务时间"`
}
HistProcTask 任务历史表
func (*HistProcTask) TableName ¶
func (hpt *HistProcTask) TableName() string
type HybridGateway ¶
type HybridGateway struct {
Conditions []Condition //条件判断节点
InevitableNodes []string //必然执行的节点
WaitForAllPrevNode int //0:等于包含网关,只要上级节点有一个完成,就可以往下走 1:等于并行网关,必须要上级节点全部完成才能往下走
}
混合网关,等于activiti中排他、并行网关、包含网关的混合体
type Instance ¶
type Instance struct {
ProcInstID int `gorm:"column:id;"` //流程实例ID
ProcID int `gorm:"column:proc_id"` //流程ID
ProcName string `gorm:"column:name"` //流程名称
ProcVersion int `gorm:"column:proc_version"` //流程版本号
BusinessID string `gorm:"column:business_id"` //业务ID
Starter string `gorm:"column:starter"` //流程发起人用户ID
CurrentNodeID string `gorm:"column:current_node_id"` //当前进行节点ID
CreateTime LocalTime `gorm:"column:create_time"` //创建时间
Status int `gorm:"column:status"` //0:未完成(审批中) 1:已完成(通过) 2:撤销
}
type LocalTime ¶
gorm中,定义数据表datetime字段类型为time.time时,查询返回格式类似2023-09-19T14:41:28+08:00 这种格式对人不友好,亦对前端处理不友好(js时间处理函数较弱) 故使用自定义类型,对时间格式做格式化处理
var LTime *LocalTime
func (*LocalTime) MarshalJSON ¶
func (*LocalTime) UnmarshalJSON ¶
type Node ¶
type Node struct {
NodeID string //节点名称
NodeName string //节点名字
NodeType NodeType //节点类型 0:开始节点 1:任务节点,指的是需要人完成的节点 2:网关 3:结束节点
PrevNodeIDs []string //上级节点(不管是任务节点还是结束节点,因为分支的存在,所以它的上级节点可能都会有多个)
UserIDs []string //节点处理人数组
Roles []string //节点处理角色数组。注意,因为系统无法预先知道角色中存在多少用户,所以必须用StartEvents解析角色,将角色中的用户加到UserIDs中
GWConfig HybridGateway //网关。只有在节点类型为GateWay的情况下此字段才会有值
IsCosigned int //是否会签 只有任务节点才会用到,会签的情况下需要所有任务通过才能进行下一节点,只要有一人反对,则整个节点驳回
NodeStartEvents []string //节点开始时触发的事件
NodeEndEvents []string //节点结束时触发的事件
TaskFinishEvents []string //任务完成(通过、驳回)时触发的事件。节点中可能产生N个任务,任务完成事件,会在每个任务完成时触发
}
type ProcDef ¶
type ProcDef struct {
gorm.Model
//ID int `gorm:"primaryKey;column:id;type:INT UNSIGNED NOT NULL AUTO_INCREMENT;comment:流程ID"`
Name string `gorm:"column:name;type:VARCHAR(250) NOT NULL;comment:流程名字;uniqueIndex:uix_name_source"`
Version int `gorm:"column:version;type:INT UNSIGNED NOT NULL DEFAULT 1;default:1;comment:版本号"`
Resource string `gorm:"column:resource;type:TEXT NOT NULL;comment:流程定义模板"`
UserID string `gorm:"column:user_id;type:VARCHAR(250) NOT NULL;comment:创建者ID"`
Source string `` /* 183-byte string literal not displayed */
CreatTime LocalTime `gorm:"column:create_time;type:DATETIME DEFAULT NOW();default:NOW();comment:创建时间"`
Process Process `gorm:"-" json:"process"`
}
ProcDef 流程定义表
type ProcExecution ¶
type ProcExecution struct {
gorm.Model
// ID int `gorm:"primaryKey;column:id;type:INT UNSIGNED NOT NULL AUTO_INCREMENT;"`
ProcID int `gorm:"index:ix_proc_id;column:proc_id;type:INT UNSIGNED NOT NULL;comment:流程ID"`
ProcVersion int `gorm:"column:proc_version;type:INT UNSIGNED NOT NULL;comment:流程版本号"`
NodeID string `gorm:"column:node_id;type:VARCHAR(250) NOT NULL;comment:节点ID"`
NodeName string `gorm:"column:node_name;type:VARCHAR(250) NOT NULL;comment:节点名称"`
PrevNodeID string `gorm:"column:prev_node_id;type:VARCHAR(250) DEFAULT NULL;default NULL;comment:上级节点ID"`
NodeType int `` /* 126-byte string literal not displayed */
IsCosigned int `gorm:"column:is_cosigned;type:TINYINT NOT NULL;comment:是否会签"`
CreateTime LocalTime `gorm:"column:create_time;type:DATETIME DEFAULT NOW();default NOW();comment:创建时间"`
}
ProcExecution 流程节点执行关系定义表
func (*ProcExecution) TableName ¶
func (pe *ProcExecution) TableName() string
type ProcInst ¶
type ProcInst struct {
gorm.Model
//ID int `gorm:"primaryKey;column:id;type:INT UNSIGNED NOT NULL AUTO_INCREMENT;comment:流程实例ID"` //流程实例ID
ProcID int `gorm:"column:proc_id;type:INT NOT NULL;index:ix_proc_id;comment:流程ID"` //流程ID
ProcVersion int `gorm:"column:proc_version;type:INT UNSIGNED NOT NULL;comment:流程版本号"` //流程版本号
BusinessID string `gorm:"column:business_id;type:VARCHAR(250) DEFAULT NULL;default:NULL;comment:业务ID"` //业务ID
Starter string `gorm:"index:ix_starter;column:starter;type:VARCHAR(250) NOT NULL;comment:流程发起人用户ID"` //流程发起人用户ID
CurrentNodeID string `gorm:"column:current_node_id;type:VARCHAR(250) NOT NULL;comment:当前进行节点ID"` //当前进行节点ID
CreateTime LocalTime `gorm:"column:create_time;type:DATETIME DEFAULT NOW();default:NOW();comment:创建时间"` //创建时间
Status int `gorm:"column:status;type:TINYINT DEFAULT 0 ;default 0;comment:0:未完成(审批中) 1:已完成(通过) 2:撤销"` //0:未完成(审批中) 1:已完成(通过) 2:撤销
}
ProcInst 流程实例表
type ProcInstVariable ¶
type ProcInstVariable struct {
gorm.Model
// ID int `gorm:"primaryKey;column:id;type:INT UNSIGNED NOT NULL AUTO_INCREMENT;"`
ProcInstID int `gorm:"index:ix_proc_inst_id;column:proc_inst_id;type:INT UNSIGNED NOT NULL;comment:流程实例ID"`
Key string `gorm:"column:key;type:VARCHAR(250) NOT NULL;comment:变量key"`
Value string `gorm:"column:value;type:VARCHAR(250) NOT NULL;comment:变量value"`
}
ProcInstVariable 流程实例变量表
func (*ProcInstVariable) TableName ¶
func (piv *ProcInstVariable) TableName() string
type ProcTask ¶
type ProcTask struct {
gorm.Model
//ID int `gorm:"primaryKey;column:id;type:INT UNSIGNED NOT NULL AUTO_INCREMENT;comment:任务ID"`
ProcID int `gorm:"index:ix_proc_id;column:proc_id;type:INT UNSIGNED NOT NULL;comment:流程ID,冗余字段,偷懒用"`
ProcInstID int `gorm:"index:ix_proc_inst_id;column:proc_inst_id;type:INT UNSIGNED NOT NULL;comment:流程实例ID"`
BusinessID string `gorm:"column:business_id;type:VARCHAR(250) DEFAULT NULL;default:NULL;comment:业务ID,冗余字段,偷懒用"`
Starter string `gorm:"index:ix_starter;column:starter;type:VARCHAR(250) NOT NULL;comment:流程发起人用户ID,冗余字段,偷懒用"`
NodeID string `gorm:"column:node_id;type:VARCHAR(250) NOT NULL;comment:节点ID"`
NodeName string `gorm:"column:node_name;type:VARCHAR(250) NOT NULL;comment:节点名称"`
PrevNodeID string `` /* 213-byte string literal not displayed */
IsCosigned int `gorm:"column:is_cosigned;type:TINYINT DEFAULT 0;default:0;comment:0:任意一人通过即可 1:会签"`
BatchCode string `` /* 180-byte string literal not displayed */
UserID string `gorm:"index:ix_user_id;column:user_id;type:VARCHAR(250) NOT NULL;comment:分配用户ID"`
Status int `gorm:"column:status;type:TINYINT DEFAULT 0;default:0;comment:任务状态:0:初始 1:通过 2:驳回"`
IsFinished int `` /* 205-byte string literal not displayed */
Comment string `gorm:"column:comment;type:TEXT;default:NULL;comment:任务备注"`
ProcInstCreateTime LocalTime `gorm:"column:proc_inst_create_time;type:DATETIME NOT NULL;comment:流程实例创建时间,冗余字段,偷懒用"`
CreateTime LocalTime `gorm:"column:create_time;type:DATETIME DEFAULT NOW();default:NOW();comment:系统创建任务时间"`
FinishedTime LocalTime `gorm:"index:ix_finished_time;column:finished_time;type:DATETIME DEFAULT NULL;default:NULL;comment:处理任务时间"`
}
ProcTask 任务表
type Task ¶
type Task struct {
TaskID int `gorm:"column:id"` //任务ID
BusinessID string `gorm:"column:business_id"` //业务ID
Starter string `gorm:"column:starter"` //流程起始人
ProcID int `gorm:"column:proc_id"` //流程ID
ProcName string `gorm:"column:name"` //流程名称
ProcInstID int `gorm:"column:proc_inst_id"` //流程实例ID
NodeID string `gorm:"column:node_id"` //节点ID
NodeName string `gorm:"column:node_name"` //节点名称
PrevNodeID string `gorm:"column:prev_node_id"` //上一节点ID
IsCosigned int `gorm:"column:is_cosigned"` //0:任意一人通过即可 1:会签
BatchCode string `gorm:"column:batch_code"` //批次码.节点会被驳回,一个节点可能产生多批task,用此码做分别
UserID string `gorm:"column:user_id"` //分配用户ID
Status int `gorm:"column:status"` //任务状态:0:初始 1:通过 2:驳回
IsFinished int `gorm:"column:is_finished"` // 0:任务未完成 1:处理完成
Comment string `gorm:"column:comment"` //评论意见
ProcInstCreateTime *LocalTime `gorm:"column:proc_inst_create_time;"` //流程实例创建时间
CreateTime *LocalTime `gorm:"column:create_time;"` //任务创建时间
FinishedTime *LocalTime `gorm:"column:finished_time;"` // 处理任务时间
}
type TaskAction ¶
Click to show internal directories.
Click to hide internal directories.