counter

package
v0.5.3-rc1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2018 License: BSD-3-Clause Imports: 3 Imported by: 0

README


title: Counter weight: 4609

tibco-counter

This activity provides your flogo application the ability to use a global counter.

Installation

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

Schema

Inputs and Outputs:

{
  "input":[
    {
      "name": "counterName",
      "type": "string",
      "required": true
    },
    {
      "name": "increment",
      "type": "boolean"
    },
    {
      "name": "reset",
      "type": "boolean"
    }
  ],
  "output": [
    {
      "name": "value",
      "type": "integer"
    }
  ]
}

Settings

Setting Description
counterName The name of the counter
increment Increment the counter
reset Reset the counter
Note: if reset is set to true, increment is ignored

Configuration Examples

Increment

Configure a task to increment a 'messages' counter:

{
  "id": 3,
  "type": 1,
  "activityType": "tibco-counter",
  "name": "Increment Message Count",
  "attributes": [
    { "name": "counterName", "value": "messages" },
    { "name": "increment", "value": true }
  ]
}

Get

Configure a task to get the 'messages' counter:

{
  "id": 3,
  "type": 1,
  "activityType": "tibco-counter",
  "name": "Get Message Count",
  "attributes": [
    { "name": "counterName", "value": "messages" }
  ]
}

Reset

Configure a task to reset the 'messages' counter:

{
  "id": 3,
  "type": 1,
  "activityType": "tibco-counter",
  "name": "Reset Message Count",
  "attributes": [
    { "name": "counterName", "value": "messages" }
    { "name": "reset", "value": true }
  ]
}

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 CounterActivity

Types

type CounterActivity

type CounterActivity struct {
	sync.Mutex
	// contains filtered or unexported fields
}

CounterActivity is a Counter Activity implementation

func (*CounterActivity) Eval

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

Eval implements activity.Activity.Eval

func (*CounterActivity) Metadata

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

Metadata implements activity.Activity.Metadata

Jump to

Keyboard shortcuts

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