Switch branches/tags
Nothing to show
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
README.md
activity.go
activity.json
activity_test.go

README.md

activity-js

This activity executes simple embedded java script in your Flogo application.

Installation

flogo install github.com/vijaynalawade/flogo/activity/js

Schema

Inputs and Outputs:

"inputs":[
    {
      "name": "jsInput",
      "type": "any"
    },
    {
      "name": "jsCode",
      "type": "string",
      "required": true
    }
  ],
  "outputs": [
    {
      "name": "jsOutput",
      "type": "any"
    }
  ]

Settings

Setting Description
jsInput Input to your java script code. It can be primitive or JSON object type.
jsCode Javascript code

Configuration Examples

Simple

Configure a task that adds two numbers in java script code:

{
  "id": 3,
  "type": 1,
  "ref": "github.com/vijaynalawade/flogo/activity/js",
  "name": "JavaScript Activity",
  "attributes": [
    { "name": "jsInput", "value": "{\"number1\":2,\"number2\":3}" },
    { "name": "jsCode", "value": "jsInput.number1 + jsInput.number2;" }
  ]
}