Documentation ¶
Index ¶
- Constants
- func AsFloat(in interface{}) (float64, error)
- func AsInt(in interface{}) (int64, error)
- func AsStr(val interface{}) interface{}
- func CompletionCondition(input string, total, undone, agree int32) (bool, error)
- func DefaultActivityOption() workflow.ActivityOptions
- func RegistryGlobalHandler(name string, fun HandlerFunc)
- type BPMN
- type BpmnActivity
- func (a *BpmnActivity) BusinessRuleTaskActivity(ctx context.Context, req api.BusinessRuleTaskActivityRequest) (vars.Mapping, error)
- func (a *BpmnActivity) CreateUserTaskActivity(ctx context.Context, req api.UserTaskActivityRequest) (*ent.Task, error)
- func (a *BpmnActivity) HttpServiceTaskActivity(ctx context.Context, req api.ServiceTaskActivityRequest) (vars.Mapping, error)
- func (a *BpmnActivity) ServiceTaskActivity(ctx context.Context, req api.ServiceTaskActivityRequest) (vars.Mapping, error)
- type BpmnLoader
- func (ld *BpmnLoader) FindMessage(id string) *bpmn.Message
- func (ld *BpmnLoader) FindProcess(id string) *bpmn.Process
- func (ld *BpmnLoader) FindSignal(ref string) *bpmn.Signal
- func (ld *BpmnLoader) GetId() string
- func (ld *BpmnLoader) GetName() string
- func (ld *BpmnLoader) Load(data []byte) error
- func (ld *BpmnLoader) LoadFromFile(path string) error
- func (ld *BpmnLoader) Validator() error
- type DMN
- func (d *DMN) EvaluateDecision(loader *DMNLoader, did string, ctxMap vars.Mapping) ([]vars.Mapping, error)
- func (d *DMN) EvaluateTable(did string, dt *dmn.DecisionTable, input vars.Mapping) (output []vars.Mapping, err error)
- func (d *DMN) Result(final *dmn.DecisionTable, input []vars.Mapping) (output any, err error)
- func (d *DMN) StartInstance(loader *DMNLoader, task *bpmn.BusinessRuleTask, pi *api.InstanceRequest) (vars.Mapping, error)
- type DMNLoader
- type EventListen
- type HandlerFunc
- type HandlerFuncMap
- type Iterator
- type Option
- type UserTaskListen
Constants ¶
View Source
const ( UserTaskClaimChannel = "ClaimChannel" UserTaskReviewChannel = "ReviewChannel" )
Variables ¶
This section is empty.
Functions ¶
func CompletionCondition ¶
func DefaultActivityOption ¶
func DefaultActivityOption() workflow.ActivityOptions
func RegistryGlobalHandler ¶
func RegistryGlobalHandler(name string, fun HandlerFunc)
Types ¶
type BPMN ¶
type BPMN struct { // worker id Id string Exporter api.Exporter Handlers *HandlerFuncMap Activity *BpmnActivity ResourceDir string }
BPMN is a workflow engine for bpmn
func (*BPMN) Start ¶
func (bp *BPMN) Start(ctx workflow.Context, pi *api.InstanceRequest, loader *BpmnLoader) (err error)
func (*BPMN) StartInstance ¶
func (bp *BPMN) StartInstance(loader *BpmnLoader, pi *api.InstanceRequest) (*Iterator, error)
type BpmnActivity ¶
type BpmnActivity struct {
Engine *BPMN
}
func (*BpmnActivity) BusinessRuleTaskActivity ¶
func (a *BpmnActivity) BusinessRuleTaskActivity(ctx context.Context, req api.BusinessRuleTaskActivityRequest) (vars.Mapping, error)
func (*BpmnActivity) CreateUserTaskActivity ¶
func (a *BpmnActivity) CreateUserTaskActivity(ctx context.Context, req api.UserTaskActivityRequest) (*ent.Task, error)
CreateUserTaskActivity 创建用户任务,将任务信息返回到工作流引擎中.
func (*BpmnActivity) HttpServiceTaskActivity ¶
func (a *BpmnActivity) HttpServiceTaskActivity(ctx context.Context, req api.ServiceTaskActivityRequest) (vars.Mapping, error)
func (*BpmnActivity) ServiceTaskActivity ¶
func (a *BpmnActivity) ServiceTaskActivity(ctx context.Context, req api.ServiceTaskActivityRequest) (vars.Mapping, error)
type BpmnLoader ¶
type BpmnLoader struct { Id string Name string Spec *bpmn.Definitions }
func (*BpmnLoader) FindMessage ¶
func (ld *BpmnLoader) FindMessage(id string) *bpmn.Message
func (*BpmnLoader) FindProcess ¶
func (ld *BpmnLoader) FindProcess(id string) *bpmn.Process
func (*BpmnLoader) FindSignal ¶
func (ld *BpmnLoader) FindSignal(ref string) *bpmn.Signal
func (*BpmnLoader) GetId ¶
func (ld *BpmnLoader) GetId() string
func (*BpmnLoader) GetName ¶
func (ld *BpmnLoader) GetName() string
func (*BpmnLoader) Load ¶
func (ld *BpmnLoader) Load(data []byte) error
func (*BpmnLoader) LoadFromFile ¶
func (ld *BpmnLoader) LoadFromFile(path string) error
func (*BpmnLoader) Validator ¶
func (ld *BpmnLoader) Validator() error
Validator 一致化输入数据,由于bpmn的扩展性,有些输入源是一致的.可以提前处理
type DMN ¶
type DMN struct {
Id string
}
func (*DMN) EvaluateDecision ¶
func (*DMN) EvaluateTable ¶
func (d *DMN) EvaluateTable(did string, dt *dmn.DecisionTable, input vars.Mapping) (output []vars.Mapping, err error)
EvaluateTable evaluate decision table
IF THE COLLECT HIT POLICY IS USED WITH AN AGGREGATOR, THE DECISION TABLE CAN ONLY HAVE ONE OUTPUT.
func (*DMN) StartInstance ¶
func (d *DMN) StartInstance(loader *DMNLoader, task *bpmn.BusinessRuleTask, pi *api.InstanceRequest) (vars.Mapping, error)
StartInstance start a dmn instance,return a single feel value
type DMNLoader ¶
type DMNLoader struct { Id string Spec *dmn.Definitions }
func NewDMNLoader ¶
func (*DMNLoader) LoadFromFile ¶
type EventListen ¶
type EventListen struct {
// contains filtered or unexported fields
}
func (*EventListen) DoneIntermediateCatchEvent ¶
func (elsn *EventListen) DoneIntermediateCatchEvent(ele *bpmn.IntermediateCatchEvent, vars map[string]any, cancel workflow.CancelFunc) error
func (*EventListen) MultiEventListen ¶
func (elsn *EventListen) MultiEventListen(ctx workflow.Context)
type HandlerFunc ¶
type HandlerFuncMap ¶
type HandlerFuncMap struct {
// contains filtered or unexported fields
}
func NewHandlerFuncMap ¶
func NewHandlerFuncMap(id string) *HandlerFuncMap
func (*HandlerFuncMap) RegistryHandler ¶
func (h *HandlerFuncMap) RegistryHandler(name string, fun HandlerFunc)
type Iterator ¶
type Iterator struct { Request *api.InstanceRequest // 针对当前节点的处理函数 CurrentHandler func(it *Iterator, ele bpmn.Elementor) (err error) // 针对当前队列中的全部元素的处理函数,一般用于消息型网关 QueueHandler func(it *Iterator, subs []bpmn.Elementor) (next bpmn.Elementor, err error) // contains filtered or unexported fields }
func (*Iterator) Loader ¶
func (it *Iterator) Loader() *BpmnLoader
type UserTaskListen ¶
type UserTaskListen struct {
// contains filtered or unexported fields
}
UserTaskListen listen user task signal
task.MemberCount = instances count, task.UnfinishedCount = unfinished instances count, task.AgreeCount = agree count
func (*UserTaskListen) CheckComplete ¶
func (ul *UserTaskListen) CheckComplete(ctx context.Context, taskEle *bpmn.UserTask) (cp bool, err error)
CheckComplete 检查任务是否完成. 如果任务有多实例, 则检查多实例的完成条件
func (*UserTaskListen) Listen ¶
func (ul *UserTaskListen) Listen(ctx workflow.Context)
Click to show internal directories.
Click to hide internal directories.