-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflowprovider.go
55 lines (46 loc) · 1.23 KB
/
flowprovider.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package workflow
//--------------------流程定义提供者类----------------------------------------
type IFlowProvider interface {
GetFlowDefines() map[string]string
GetFlow(flowid string) string
}
func FlowProviderFactory() IFlowProvider {
//todo: 根据配置文件, 选择不同的provider
var p IFlowProvider
p = new(PgFlowProvider)
return p
}
type PgFlowProvider struct {
}
func (this *PgFlowProvider) GetFlowDefines() map[string]string {
//sql := ""
//todo: load from postgresql
flows := make(map[string]string)
return flows
}
func (this *PgFlowProvider) GetFlow(flowid string) string {
//sql := ""
//todo: load from postgresql
flow := ``
return flow
}
//------------------流程实例提供者类---------------------------------------
type ICaseProvider interface {
GetCase(caseid string) *FlowCase
GetFlowItems(caseid string) *[]FlowItem
}
func CaseProviderFactory() ICaseProvider {
//todo: 根据配置文件, 选择不同的provider
var p ICaseProvider
p = new(PgCaseProvider)
return p
}
type PgCaseProvider struct {
}
func (this *PgCaseProvider) GetCase(caseid string) *FlowCase {
return new(FlowCase)
}
func (this *PgCaseProvider) GetFlowItems(caseid string) *[]FlowItem {
its := make([]FlowItem, 10)
return &its
}