channel

package module
v0.0.0-...-46bee30 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 24, 2022 License: BSD-3-Clause Imports: 6 Imported by: 0

README

Channel Trigger

This trigger provides your flogo application the ability to start an action via a named engine channel

Installation

flogo install github.com/TNTworks/flogo-contrib/trigger/channel

Configuration

Handler Settings:
Name Type Description
channel string The internal engine channel - REQUIRED
Output:
Name Type Description
data any The data pulled from the channel

Example Configurations

Triggers are configured via the triggers.json of your application. The following are some example configuration of the Channel Trigger.

Run Flow

Configure the Trigger to handle an event received on the 'test' channel

{
  "triggers": [
    {
      "id": "flogo-channel",
      "ref": "github.com/TNTworks/flogo-contrib/trigger/channel",
      "handlers": [
        {
          "settings": {
            "channel": "test"
          },
          "action": {
            "ref": "github.com/project-flogo/flow",
            "settings": {
                "flowURI": "res://flow:testflow"
            }       
          }
        }
      ]
    }
  ]
}

Note: a channel must be defined in the app in order to use it in a trigger or activity. A channel is specified by "<name>:<buffer size>"

"channels": [
  "test:5"
]

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory

type Factory struct {
}

func (*Factory) Metadata

func (*Factory) Metadata() *trigger.Metadata

Metadata implements trigger.Factory.Metadata

func (*Factory) New

func (*Factory) New(config *trigger.Config) (trigger.Trigger, error)

New implements trigger.Factory.New

type HandlerSettings

type HandlerSettings struct {
	Channel string `md:"channel,required"` // The internal engine channel
}

type Listener

type Listener struct {
	// contains filtered or unexported fields
}

func (*Listener) OnMessage

func (l *Listener) OnMessage(msg interface{})

type Output

type Output struct {
	Data interface{} `md:"data"` // The data pulled from the channel
}

func (*Output) FromMap

func (o *Output) FromMap(values map[string]interface{}) error

func (*Output) ToMap

func (o *Output) ToMap() map[string]interface{}

type Trigger

type Trigger struct {
}

func (*Trigger) Initialize

func (t *Trigger) Initialize(ctx trigger.InitContext) error

func (*Trigger) Start

func (t *Trigger) Start() error

Stop implements util.Managed.Start

func (*Trigger) Stop

func (t *Trigger) Stop() error

Stop implements util.Managed.Stop

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL