node

package
v0.0.0-...-c4618b4 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2023 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// MaxaTimeLime 延时一段时间最大支持的天数
	MaxaTimeLime int64 = 86400 * 365
)

Functions

func CheckPreNode

func CheckPreNode(bpt string, nowNodeKey string) (preNodeKey string)

Types

type CC

type CC struct {
	*Node
}

CC struct

func NewCC

func NewCC(conf *config.Configs, node *Node) *CC

NewCC new

func (*CC) InitBegin

func (n *CC) InitBegin(ctx context.Context, eventData *EventData) (*pb.NodeEventRespData, error)

InitBegin event

func (*CC) InitEnd

func (n *CC) InitEnd(ctx context.Context, eventData *EventData) (*pb.NodeEventRespData, error)

InitEnd event

type DataCreate

type DataCreate struct {
	*Node
}

DataCreate struct

func NewDataCreate

func NewDataCreate(conf *config.Configs, node *Node) *DataCreate

NewDataCreate new

func (*DataCreate) InitBegin

func (n *DataCreate) InitBegin(ctx context.Context, eventData *EventData) (*pb.NodeEventRespData, error)

Init event

func (*DataCreate) InitEnd

func (n *DataCreate) InitEnd(ctx context.Context, eventData *EventData) (*pb.NodeEventRespData, error)

Execute event

type DataUpdate

type DataUpdate struct {
	*Node
}

DataUpdate struct

func NewDataUpdate

func NewDataUpdate(conf *config.Configs, node *Node) *DataUpdate

NewDataUpdate new

func (*DataUpdate) InitBegin

func (n *DataUpdate) InitBegin(ctx context.Context, eventData *EventData) (*pb.NodeEventRespData, error)

InitBegin event

func (*DataUpdate) InitEnd

func (n *DataUpdate) InitEnd(ctx context.Context, eventData *EventData) (*pb.NodeEventRespData, error)

InitEnd event

type Delay

type Delay struct {
	*Node
}

Delay struct

func NewDelay

func NewDelay(conf *config.Configs, node *Node) *Delay

NewDelay 延时节点

func (*Delay) ConvertPolicy2Struct

func (d *Delay) ConvertPolicy2Struct(bd interface{}) (*DelayPolicyData, error)

ConvertPolicy2Struct 将业务数据转换为结构体

func (*Delay) ExecTimeOfSpecTime

func (d *Delay) ExecTimeOfSpecTime(dp *DelayPolicyData) *int64

ExecTimeOfSpecTime 延时到指定时间执行时间

func (*Delay) ExecTimeOfTableColumn

func (d *Delay) ExecTimeOfTableColumn(dp *DelayPolicyData, ColumnTime *string) *int64

ExecTimeOfTableColumn 按日期字段延时执行时间

func (*Delay) ExecTimeOfaTime

func (d *Delay) ExecTimeOfaTime(dp *DelayPolicyData) *int64

ExecTimeOfaTime 延时一段时间的执行时间戳

func (*Delay) InitBegin

func (d *Delay) InitBegin(ctx context.Context, eventData *EventData) (*pb.NodeEventRespData, error)

InitBegin event

func (*Delay) InitEnd

func (d *Delay) InitEnd(ctx context.Context, eventData *EventData) (*pb.NodeEventRespData, error)

InitEnd 初始化节点

func (*Delay) TimeCheck

func (d *Delay) TimeCheck(dp *DelayPolicyData) error

TimeCheck 请求的时间有效性检查

type DelayPolicy

type DelayPolicy struct {
	Type string     `json:"type"`
	Data PolicyData `json:"data"`
}

DelayPolicy DelayPolicy

type DelayPolicyData

type DelayPolicyData struct {
	DelayPolicy DelayPolicy `json:"delayPolicy"`
}

DelayPolicyData DelayPolicyData

type Email

type Email struct {
	*Node
}

Email struct

func NewEmail

func NewEmail(conf *config.Configs, node *Node) *Email

NewEmail new

func (*Email) InitBegin

func (n *Email) InitBegin(ctx context.Context, eventData *EventData) (*pb.NodeEventRespData, error)

InitBegin event

func (*Email) InitEnd

func (n *Email) InitEnd(ctx context.Context, eventData *EventData) (*pb.NodeEventRespData, error)

InitEnd event

func (*Email) MultipleFieldsHandle

func (n *Email) MultipleFieldsHandle(ctx context.Context, bd *emailBD, formData map[string]interface{}, instance *models.Instance) []*client.UserInfoResp

MultipleFieldsHandle 多个字段处理 bd 业务数据 formData 表单数据

type EventData

type EventData struct {
	ProcessID         string
	ProcessInstanceID string
	NodeDefKey        string
	RequestID         string
	UserID            string
	ExecutionID       string
	TaskID            []string // 如果是会签则taskID是多个,逗号间隔的字符串
	Shape             *convert.ShapeModel
}

EventData req

type INode

type INode interface {
	InitBegin(ctx context.Context, eventData *EventData) (*pb.NodeEventRespData, error)
	InitEnd(ctx context.Context, eventData *EventData) (*pb.NodeEventRespData, error)
}

INode inter

type Letter

type Letter struct {
	*Node
}

Letter struct

func NewLetter

func NewLetter(conf *config.Configs, node *Node) *Letter

NewLetter new

func (*Letter) InitBegin

func (n *Letter) InitBegin(ctx context.Context, eventData *EventData) (*pb.NodeEventRespData, error)

InitBegin event

func (*Letter) InitEnd

func (n *Letter) InitEnd(ctx context.Context, eventData *EventData) (*pb.NodeEventRespData, error)

InitEnd event

type Node

type Node struct {
	Db                      *gorm.DB
	FlowRepo                models.FlowRepo
	InstanceRepo            models.InstanceRepo
	InstanceVariablesRepo   models.InstanceVariablesRepo
	InstanceStepRepo        models.InstanceStepRepo
	AbnormalTaskRepo        models.AbnormalTaskRepo
	InstanceExecutionRepo   models.InstanceExecutionRepo
	FlowVariable            models.VariablesRepo
	DispatcherCallbackRepo  models.DispatcherCallbackRepo
	Urge                    callback_tasks.Urge
	Flow                    flow.Flow
	Instance                flow.Instance
	OperationRecord         flow.OperationRecord
	Task                    flow.Task
	FormAPI                 client.Form
	MessageCenterAPI        client.MessageCenter
	StructorAPI             client.Structor
	ProcessAPI              client.Process
	IdentityAPI             client.Identity
	Dispatcher              client.Dispatcher
	FlowProcessRelationRepo models.FlowProcessRelationRepo
}

Node struct

func (*Node) CheckRefuse

func (n *Node) CheckRefuse(ctx context.Context, db *gorm.DB, processInstanceID string) bool

func (*Node) SetDB

func (n *Node) SetDB(db *gorm.DB)

SetDB set db

type NodeDataModel

type NodeDataModel struct {
	Name                  string   `json:"name"`
	BranchTargetElementID string   `json:"branchTargetElementID"`
	ParentID              []string `json:"parentID"`
	ChildrenID            []string `json:"childrenID"`
	BranchID              string   `json:"branchID"`
}

NodeDataModel info

type PolicyColumn

type PolicyColumn struct {
	TableID  string `json:"tableID"`
	ColumnID string `json:"columnID"`
}

PolicyColumn PolicyColumn

type PolicyData

type PolicyData struct {
	TimeFmt interface{}  `json:"timeFmt"`
	Column  PolicyColumn `json:"column"`
}

PolicyData PolicyData

type ProcessModel

type ProcessModel struct {
	Version string       `json:"version"`
	Shapes  []ShapeModel `json:"shapes"`
}

ProcessModel struct

type ShapeDataModel

type ShapeDataModel struct {
	NodeData     NodeDataModel          `json:"nodeData"`
	BusinessData map[string]interface{} `json:"businessData"`
}

ShapeDataModel info

type ShapeModel

type ShapeModel struct {
	ID     string         `json:"id"`
	Type   string         `json:"type"`
	Data   ShapeDataModel `json:"data"`
	Source string         `json:"source"`
	Target string         `json:"target"`
}

ShapeModel struct

func GetFirstNode

func GetFirstNode(p *ProcessModel) *ShapeModel

func GetNode

func GetNode(p *ProcessModel, id string) *ShapeModel

type UserTask

type UserTask struct {
	*Node
}

UserTask struct

func NewUserTask

func NewUserTask(conf *config.Configs, node *Node) *UserTask

NewUserTask new

func (*UserTask) InitBegin

func (n *UserTask) InitBegin(ctx context.Context, eventData *EventData) (*pb.NodeEventRespData, error)

InitBegin event

func (*UserTask) InitEnd

func (n *UserTask) InitEnd(ctx context.Context, eventData *EventData) (*pb.NodeEventRespData, error)

InitEnd event

type VariableUpdate

type VariableUpdate struct {
	*Node
}

VariableUpdate struct

func NewVariableUpdate

func NewVariableUpdate(conf *config.Configs, node *Node) *VariableUpdate

NewVariableUpdate new

func (*VariableUpdate) InitBegin

func (n *VariableUpdate) InitBegin(ctx context.Context, eventData *EventData) (*pb.NodeEventRespData, error)

InitBegin event

func (*VariableUpdate) InitEnd

func (n *VariableUpdate) InitEnd(ctx context.Context, eventData *EventData) (*pb.NodeEventRespData, error)

InitEnd event

type WebHook

type WebHook struct {
	*Node
	PolyAPI client.PolyAPI
}

WebHook struct

func NewWebHook

func NewWebHook(conf *config.Configs, node *Node) *WebHook

NewWebHook new

func (*WebHook) InitBegin

func (n *WebHook) InitBegin(ctx context.Context, eventData *EventData) (*pb.NodeEventRespData, error)

InitBegin event

func (*WebHook) InitEnd

func (n *WebHook) InitEnd(ctx context.Context, eventData *EventData) (*pb.NodeEventRespData, error)

InitEnd event

Jump to

Keyboard shortcuts

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