aggregate

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2018 License: BSD-3-Clause Imports: 6 Imported by: 0

README

tibco-aggregate

This activity provides your flogo application with rudimentary aggregation.

Installation

flogo add activity github.com/TIBCOSoftware/flogo-contrib/activity/aggregate

Schema

Inputs and Outputs:

{
  "inputs":[
    {
      "name": "function",
      "type": "string",
      "allowed" : ["block_avg", "moving_avg", "timeblockavg"]
    },
    {
      "name": "windowSize",
      "type": "integer",
    },
    {
      "name": "autoReset",
      "type": "boolean"
    },
    {
      "name": "value",
      "type": "number"
    }
  ],
  "outputs": [
    {
      "name": "result",
      "type": "number"
    },
    {
      "name": "report",
      "type": "boolean"
    }
  ]
}

Settings

Setting Description
function The aggregate fuction, currently only average is supported
windowSize The window size of the values to aggregate
autoReset Flag indicating if the window should be reset after it reports
value The value to aggregate

Configuration Examples

Configure a task to aggregate a 'temperature' attribute with a moving window of size 5:

{
  "id": 3,
  "type": 1,
  "activityType": "tibco-aggregate",
  "name": "Aggregate Temperature",
  "attributes": [
      { "name": "function", "value": "average" }
      { "name": "windowSize", "value": "5" }
  ]
  "inputMappings": [
    { "type": 1, "value": "temperature", "mapTo": "value" }
  ]
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewActivity

func NewActivity(metadata *activity.Metadata) activity.Activity

NewActivity creates a new AppActivity

Types

type AggregateActivity

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

AggregateActivity is an Activity that is used to Aggregate a message to the console inputs : {function, windowSize, autoRest, value} outputs: {result, report}

func (*AggregateActivity) Eval

func (a *AggregateActivity) Eval(context activity.Context) (done bool, err error)

Eval implements api.Activity.Eval - Aggregates the Message

func (*AggregateActivity) Metadata

func (a *AggregateActivity) Metadata() *activity.Metadata

Metadata returns the activity's metadata

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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