This page describe how to develop single independent Project Flogo contribution
The contribution includes activity
, trigger
, function
,
I will take Log activity, REST Trigger and json function as example below.
Component | Technology | Filename | Description |
---|---|---|---|
Model | JSON | descriptor.json | The descriptor.json describes the model, the meta data, of the activity. It describes, among other things, what the input and outputs are, who built it and which version you’re using. |
Runtime | Go | activity.go | Every extension must write the runtime code in Go (activity.go ). You can, and really should, leverage the Go testing framework for writing unit test cases (activity_test.go ) for your extension. |
Runtime dependence | go.mod | go.mod | The go.mod file describes all dependencies requires for this activity and the model name. Note here: The module name should be the ref of the contribution. |
Component | Technology | Filename | Description |
---|---|---|---|
Model | JSON | descriptor.json | The descriptor.json describes the model, the meta data, of the trigger. It describes, among other things, what the trigger settings, handlers andoutputs are, who built it and which version you’re using. |
Runtime | Go | trigger.go | Every extension must write the runtime code in Go (trigger.go ). You can, and really should, leverage the Go testing framework for writing unit test cases (trigger_test.go ) for your extension. |
Runtime dependence | go.mod | go.mod | The go.mod file describes all dependencies requires for this trigger and the contribution model name. Note here: The module name should be the ref of the contribution. |
log
Component | Technology | Filename | Description |
---|---|---|---|
Model | JSON | descriptor.json | The descriptor.json describes the model, the meta data, of the function. it describe function name, argument and output which expected type. |
Runtime | Go | functioName.go | Every extension must write the runtime code in Go (functionName.go ). You can, and really should, leverage the Go testing framework for writing unit test cases (functionName_test.go ) for your extension. |
Runtime dependence | go.mod | go.mod | The go.mod file describes all dependencies requires for this function and the function model name. Note here: The module name should be the ref of the contribution. |
category
name. Take JSON as example, the name must be json
category
name.category
name as well.Name
methodfunc (fnPath) Name() string {
return "path"
}
All contribution must be registered into engine in each own go init function. Please check Log Activity Init, Rest Trigger Init and Json function init
Please refer to here for all supported types in flogo
The layout of your folder has to follow a specific structure.
│ <activity name>
│ └───activity.go
│ └───descriptor.json
│ └───go.mod
│ <trigger name>
│ └───trigger.go
│ └───descriptor.json
│ └───go.mod
|───functionCategoryName
│ └───function.go
│ └───descriptor.json
│ └───go.mod