app

package
v0.5.6 Latest Latest
Warning

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

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

README


title: App weight: 4604

App

This activity allows you to set and use global attributes throughout your app.

Installation

Flogo Web

This activity comes out of the box with the Flogo Web UI

Flogo CLI

flogo install github.com/TIBCOSoftware/flogo-contrib/activity/actreply

Schema

Inputs and Outputs:

{
  "input":[
    {
      "name": "attribute",
      "type": "string",
      "required": true
    },
    {
      "name": "operation",
      "type": "string",
      "required" : true,
      "allowed" : ["ADD","GET","UPDATE"]
    },
    {
      "name": "type",
      "type": "string",
      "allowed" : [	"string", "integer", "number", "boolean", "object", "array", "params"]
    },
    {
      "name": "value",
      "type": "any"
    }
  ],
  "output": [
    {
      "name": "value",
      "type": "any"
    }
  ]
}

Settings

Setting Required Description
attribute True The name of the attribute
operation True The operation to perform
type False The type of the attribute, only used with NEW operation
value (input) False The value of the attribute, only used with ADD and UPDATE
value (output) The returned value of the attribute, only used with GET and UPDATE

Configuration Examples

New

Add a new 'myAttr' attribute of type string with the initial value of foo:

{
  "id": "app_5",
  "name": "Use Global Attribute",
  "description": "Simple Global App Activity",
  "activity": {
    "ref": "github.com/TIBCOSoftware/flogo-contrib/activity/app",
    "input": {
      "attribute": "myAttr",
      "operation": "ADD",
      "type": "string",
      "value": "MyValue"
    }
  }
}

Get

Get the value of the 'myAttr' attribute:

{
  "id": "app_5",
  "name": "Use Global Attribute",
  "description": "Simple Global App Activity",
  "activity": {
    "ref": "github.com/TIBCOSoftware/flogo-contrib/activity/app",
    "input": {
      "attribute": "myAttr",
      "operation": "GET",
      "type": "string",
      "value": "MyValue"
    }
  }
}

Update

Update the value of the 'myAttr' attribute to bar:

{
  "id": "app_5",
  "name": "Use Global Attribute",
  "description": "Simple Global App Activity",
  "activity": {
    "ref": "github.com/TIBCOSoftware/flogo-contrib/activity/app",
    "input": {
      "attribute": "myAttr",
      "operation": "UPDATE",
      "value": "MyValue"
    }
  }
}

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 AppActivity

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

AppActivity is a App Activity implementation

func (*AppActivity) Eval

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

Eval implements activity.Activity.Eval

func (*AppActivity) Metadata

func (a *AppActivity) 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