appdata

package module
v0.10.1-0...-6001263 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2021 License: BSD-3-Clause Imports: 5 Imported by: 0

README

AppData

This activity allows you to set and get global App attributes.

Installation

Flogo CLI
flogo install github.com/r2d2-ai/contrib/activity/appdata

Configuration

Settings:
Name Type Description
name string The name of the shared attribute - REQUIRED
op string The operation (get or set), 'get' is the default
type string The data type of the shared value, default is 'any'
Input:
Name Type Description
value object The value of the shared attribute
Output:
Name Type Description
value object The value of the shared attribute

Examples

Get

Get the value of the 'myAttr' attribute:

{
  "id": "get_app_attr",
  "name": "Get App Attr",
  "activity": {
    "ref": "github.com/r2d2-ai/contrib/activity/appdata",
    "settings": {
      "attribute": "myAttr",
      "operation": "get"
    }
  }
}
Set

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

{
  "id": "set_app_attr",
  "name": "Set App Attr",
  "activity": {
    "ref": "github.com/r2d2-ai/contrib/activity/appdata",
    "settings": {
      "attribute": "myAttr",
      "operation": "set"
    },
    "input": {
      "value": "bar"
    }  
  }
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

Types

type Activity

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

Activity is a Counter Activity implementation

func (*Activity) Eval

func (a *Activity) Eval(ctx activity.Context) (done bool, err error)

Eval implements activity.Activity.Eval

func (*Activity) Metadata

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

Metadata implements activity.Activity.Metadata

type Input

type Input struct {
	Value interface{} `md:"value"` // The value of the shared attribute
}

type Output

type Output struct {
	Value interface{} `md:"value"` // The value of the shared attribute
}

type Settings

type Settings struct {
	Name string `md:"name,required"`       // The name of the shared attribute
	Op   string `md:"op,allowed(get,set)"` // The operation (get or set), 'get' is the default
	Type string `md:"type"`                // The data type of the shared value, default is 'any'
}

Jump to

Keyboard shortcuts

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