-
Notifications
You must be signed in to change notification settings - Fork 54
/
activity.go
50 lines (37 loc) · 1.13 KB
/
activity.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
package activity
import (
"github.com/project-flogo/core/data/mapper"
"github.com/project-flogo/core/support/log"
)
// Activity is an interface for defining a custom Activity Execution
type Activity interface {
// Metadata returns the metadata of the activity
Metadata() *Metadata
// Eval is called when an Activity is being evaluated. Returning true indicates
// that the task is done.
Eval(ctx Context) (done bool, err error)
}
type Factory func(ctx InitContext) (Activity, error)
type InitContext interface {
// Settings
Settings() map[string]interface{}
// MapperFactory gets the mapper factory associated with the activity host
MapperFactory() mapper.Factory
// Logger logger to using during initialization, activity implementations should not
// keep a reference to this
Logger() log.Logger
// Name returns name of the activity / task
Name() string
// HostName returns name of the flow / task host
HostName() string
}
type Details struct {
IsReturn bool
IsReply bool
}
type HasDetails interface {
Details() *Details
}
type ReconfigurableActivity interface {
Reconfigure(settings map[string]interface{}) error
}