-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathio.go
52 lines (40 loc) · 869 Bytes
/
io.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
package loong
import (
"context"
"github.com/it512/loong/bpmn/zeebe"
)
type TaskDefinition interface {
Type() (string, error)
}
type IoTasker interface {
BpmnElement
GetTaskDefinition(context.Context) TaskDefinition
GetTaskHeader(string) (string, bool)
GetProperty(string) (string, bool)
GetInput(string) (any, bool)
SetResult(string, any)
}
type IoCaller interface {
Call(context.Context, IoTasker) error
}
type taskDef struct {
typ string
err error
el string
eval ActivationEvaluator
c context.Context
}
func newTaskDef(ctx context.Context, eval ActivationEvaluator, td zeebe.TTaskDefinition) *taskDef {
return &taskDef{
el: td.TypeName,
eval: eval,
c: ctx,
}
}
func (t *taskDef) Type() (string, error) {
if t.typ != "" {
return t.typ, t.err
}
t.typ, _, t.err = eval[string](t.c, t.eval, t.el)
return t.typ, t.err
}