workflow

package
v0.0.0-...-f6c0e8d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2020 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFlowins

func AddFlowins(flowname, flowid, user string) error

添加一个流程实例ins(实例名称,流程id,用户)

func AddStepins

func AddStepins(flowinsid, nodeid string) error

添加一个步骤实例(流程实例id,节点id)

func AddTask

func AddTask(stepins *Stepins, users ...string) error

添加一个任务(步骤实例id,用户 ...string)

func CheckTask

func CheckTask(taskid, user, msg, nodeid string, check int) error

任务处理(任务id,用户,处理信息,[驳回的节点id],操作{0:未审核;1:通过;2:不通过,3:驳回,4:回退到最初})

func InitWF

func InitWF(dbpath string) error

Types

type CommitSession

type CommitSession struct {
	Session *xorm.Session
}

func NewCS

func NewCS() *CommitSession

func (*CommitSession) Close

func (cs *CommitSession) Close()

type Flow

type Flow struct {
	Id   string `xorm:"pk notnull unique 'id'"`
	Name string //请假审批
}

========

func AddFlow

func AddFlow(flowname string) (*Flow, error)

新建一个流程模板

func FlowOne

func FlowOne(flowid string) (*Flow, error)

用ID查询一个流程模板

func (*Flow) AddNode

func (wf *Flow) AddNode(nodename, acttype string, approvers []string) (*Node, error)

给流程模板里添加一个节点

func (*Flow) UpdateFlow

func (wf *Flow) UpdateFlow(flowname string) error

修改一个流程模板的名字

type Flowins

type Flowins struct {
	Id         string `xorm:"pk notnull unique 'id'"`
	Name       string
	User       string
	FlowId     string
	CreateDate time.Time
	FinishDate time.Time
	Status     int
}

========

type Node

type Node struct {
	Id         string `xorm:"pk notnull unique 'id'"`
	FlowId     string
	Name       string
	ActType    string
	Approvers  []string
	Operations []int
}

func NodeOne

func NodeOne(ndid string) (*Node, error)

根据id查询一个节点

func (nd *Node) AddFlowLink(name, afterNodeid string) (*Nodelink, error)

添加一个节点连接---线(名称,向后的一个节点)

func (*Node) RemoveNode

func (nd *Node) RemoveNode() error

删除一个节点

func (*Node) UpdateNode

func (nd *Node) UpdateNode(nodename, acttype string, approvers []string) (*Node, error)

更新一个节点(节点名称,操作类型:{or and},审批人[]string)

type Nodelink struct {
	Id         string `xorm:"pk notnull unique 'id'"`
	Name       string
	FlowId     string
	BeforeNode string
	AfterNode  string
}

func NodeLinkOne

func NodeLinkOne(nlid string) (*Nodelink, error)

根据id查询一个线

func (nl *Nodelink) RemoveFlowLink() error

删除一个线

func (nl *Nodelink) UpdateFlowLink(name string) (*Nodelink, error)

更新一个线的名称

type Stepins

type Stepins struct {
	Id         string `xorm:"pk notnull unique 'id'"`
	FlowinsId  string
	NodeId     string
	StartDate  time.Time
	FinishDate time.Time
	Status     int
}

type Task

type Task struct {
	Id         string `xorm:"pk notnull unique 'id'"`
	StepinsId  string
	FlowinsId  string
	NodeId     string
	User       string
	StartDate  time.Time
	FinishDate time.Time
	Status     int
	Message    string
}

func TaskList

func TaskList(user ...interface{}) ([]Task, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL