Skip to content

Instantly share code, notes, and snippets.

@fcastill
Created October 23, 2018 20:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fcastill/09b8927897f4e25452f12564bcf06b47 to your computer and use it in GitHub Desktop.
Save fcastill/09b8927897f4e25452f12564bcf06b47 to your computer and use it in GitHub Desktop.
flogo#418
{
"name": "Pub App WITHOUT INVOKES",
"type": "flogo:app",
"version": "0.0.1",
"description": "",
"triggers": [
{
"name": "Timer 2",
"ref": "github.com/jvanderl/flogo-components/trigger/timer2",
"description": "Simple Timer trigger",
"settings": {},
"id": "timer_2",
"handlers": [
{
"settings": {
"repeating": true,
"seconds": "30",
"startImmediate": true
},
"actionId": "temp",
"actionMappings": {
"input": [],
"output": []
}
},
{
"settings": {
"repeating": true,
"minutes": "5",
"startImmediate": true
},
"actionId": "weight",
"actionMappings": {
"input": [],
"output": []
}
}
]
},
{
"name": "GPIO",
"ref": "github.com/jvanderl/flogo-components/trigger/gpio",
"description": "GPIO trigger",
"settings": {
"interval": "100"
},
"id": "gpio",
"handlers": [
{
"settings": {
"gpiopin": "27",
"state": "1",
"pull": true
},
"actionId": "shockon",
"actionMappings": {
"input": [],
"output": []
}
},
{
"settings": {
"gpiopin": "27",
"state": "0",
"pull": true
},
"actionId": "shockoff",
"actionMappings": {
"input": [],
"output": []
}
},
{
"settings": {
"gpiopin": "19",
"state": "0",
"pull": true
},
"actionId": "button_on",
"actionMappings": {
"input": [],
"output": []
}
},
{
"settings": {
"gpiopin": "19",
"state": "1",
"pull": true
},
"actionId": "button_off",
"actionMappings": {
"input": [],
"output": []
}
}
]
}
],
"actions": [
{
"data": {
"flow": {
"name": "Temp",
"type": 1,
"attributes": [],
"rootTask": {
"id": "root",
"type": 1,
"tasks": [
{
"id": "2",
"name": "Setup ds18b20",
"description": "Setup ds18b20",
"type": 1,
"activityType": "",
"activityRef": "github.com/lhollyer/ds18b20",
"attributes": []
},
{
"id": "3",
"name": "Log Message",
"description": "Simple Log Activity",
"type": 1,
"activityType": "",
"activityRef": "github.com/TIBCOSoftware/flogo-contrib/activity/log",
"attributes": [
{
"name": "message",
"value": "",
"required": false,
"type": "string"
},
{
"name": "flowInfo",
"value": "false",
"required": false,
"type": "boolean"
},
{
"name": "addToFlow",
"value": "false",
"required": false,
"type": "boolean"
}
],
"inputMappings": [
{
"type": 1,
"value": "$activity[2].result",
"mapTo": "message"
}
],
"settings": {}
},
{
"id": "4",
"name": "Combine",
"description": "Combines separate parts into a single string",
"type": 1,
"activityType": "",
"activityRef": "github.com/jvanderl/flogo-components/activity/combine",
"attributes": [
{
"name": "delimiter",
"value": "",
"required": false,
"type": "string"
},
{
"name": "prefix",
"value": "{ \"pubID\": 0, \"kegID\": 2570, \"eventName\": \"TEMP\", \"temperature\": ",
"required": false,
"type": "string"
},
{
"name": "suffix",
"value": " }",
"required": false,
"type": "string"
},
{
"name": "part1",
"value": "",
"required": false,
"type": "string"
},
{
"name": "part2",
"value": "",
"required": false,
"type": "string"
},
{
"name": "part3",
"value": "",
"required": false,
"type": "string"
},
{
"name": "part4",
"value": "",
"required": false,
"type": "string"
},
{
"name": "part5",
"value": "",
"required": false,
"type": "string"
},
{
"name": "part6",
"value": "",
"required": false,
"type": "string"
},
{
"name": "part7",
"value": "",
"required": false,
"type": "string"
},
{
"name": "part8",
"value": "",
"required": false,
"type": "string"
}
],
"inputMappings": [
{
"type": 1,
"value": "$activity[2].result",
"mapTo": "part1"
}
],
"settings": {}
},
{
"id": "6",
"name": "Control GPIO",
"description": "Control raspberry gpio",
"type": 1,
"activityType": "",
"activityRef": "github.com/TIBCOSoftware/flogo-contrib/activity/gpio",
"attributes": [
{
"name": "method",
"value": "Direction",
"required": true,
"type": "string"
},
{
"name": "pinNumber",
"value": "24",
"required": true,
"type": "integer"
},
{
"name": "direction",
"value": "Output",
"required": false,
"type": "string"
},
{
"name": "state",
"value": "",
"required": false,
"type": "string"
},
{
"name": "Pull",
"value": "",
"required": false,
"type": "string"
}
]
},
{
"id": "7",
"name": "Control GPIO (2)",
"description": "Control raspberry gpio",
"type": 1,
"activityType": "",
"activityRef": "github.com/TIBCOSoftware/flogo-contrib/activity/gpio",
"attributes": [
{
"name": "method",
"value": "Set State",
"required": true,
"type": "string"
},
{
"name": "pinNumber",
"value": "24",
"required": true,
"type": "integer"
},
{
"name": "direction",
"value": "",
"required": false,
"type": "string"
},
{
"name": "state",
"value": "High",
"required": false,
"type": "string"
},
{
"name": "Pull",
"value": "",
"required": false,
"type": "string"
}
]
},
{
"id": "8",
"name": "Control GPIO (3)",
"description": "Control raspberry gpio",
"type": 1,
"activityType": "",
"activityRef": "github.com/TIBCOSoftware/flogo-contrib/activity/gpio",
"attributes": [
{
"name": "method",
"value": "Direction",
"required": true,
"type": "string"
},
{
"name": "pinNumber",
"value": "24",
"required": true,
"type": "integer"
},
{
"name": "direction",
"value": "Output",
"required": false,
"type": "string"
},
{
"name": "state",
"value": "",
"required": false,
"type": "string"
},
{
"name": "Pull",
"value": "",
"required": false,
"type": "string"
}
]
},
{
"id": "9",
"name": "Control GPIO (4)",
"description": "Control raspberry gpio",
"type": 1,
"activityType": "",
"activityRef": "github.com/TIBCOSoftware/flogo-contrib/activity/gpio",
"attributes": [
{
"name": "method",
"value": "Set State",
"required": true,
"type": "string"
},
{
"name": "pinNumber",
"value": "24",
"required": true,
"type": "integer"
},
{
"name": "direction",
"value": "",
"required": false,
"type": "string"
},
{
"name": "state",
"value": "Low",
"required": false,
"type": "string"
},
{
"name": "Pull",
"value": "",
"required": false,
"type": "string"
}
]
}
],
"links": [
{
"id": 1,
"from": "2",
"to": "3",
"type": 0
},
{
"id": 2,
"from": "3",
"to": "4",
"type": 0
},
{
"id": 3,
"from": "2",
"to": "6",
"type": 1,
"value": "$activity[2].result > 24"
},
{
"id": 4,
"from": "6",
"to": "7",
"type": 0
},
{
"id": 5,
"from": "2",
"to": "8",
"type": 1,
"value": "$activity[2].result < 25"
},
{
"id": 6,
"from": "8",
"to": "9",
"type": 0
}
],
"attributes": []
},
"errorHandlerTask": {
"id": "__error_root",
"type": 1,
"tasks": [],
"links": [],
"attributes": []
}
}
},
"id": "temp",
"description": "",
"metadata": {
"input": [],
"output": []
},
"ref": "github.com/TIBCOSoftware/flogo-contrib/action/flow"
},
{
"data": {
"flow": {
"name": "Weight",
"type": 1,
"attributes": [],
"rootTask": {
"id": "root",
"type": 1,
"tasks": [
{
"id": "2",
"name": "Setup hx711",
"description": "Setup hx711",
"type": 1,
"activityType": "",
"activityRef": "github.com/lhollyer/hx711",
"attributes": [
{
"name": "dtNumber",
"value": 0,
"required": false,
"type": "integer"
},
{
"name": "sckNumber",
"value": 0,
"required": false,
"type": "integer"
},
{
"name": "Offset",
"value": 0,
"required": false,
"type": "integer"
}
]
},
{
"id": "3",
"name": "Combine",
"description": "Combines separate parts into a single string",
"type": 1,
"activityType": "",
"activityRef": "github.com/jvanderl/flogo-components/activity/combine",
"attributes": [
{
"name": "delimiter",
"value": "",
"required": false,
"type": "string"
},
{
"name": "prefix",
"value": "{ \"pubID\": 0, \"kegID\": 2570, \"eventName\": \"PULL\", \"currentWeight\": ",
"required": false,
"type": "string"
},
{
"name": "suffix",
"value": " }",
"required": false,
"type": "string"
},
{
"name": "part1",
"value": "",
"required": false,
"type": "string"
},
{
"name": "part2",
"value": "",
"required": false,
"type": "string"
},
{
"name": "part3",
"value": "",
"required": false,
"type": "string"
},
{
"name": "part4",
"value": "",
"required": false,
"type": "string"
},
{
"name": "part5",
"value": "",
"required": false,
"type": "string"
},
{
"name": "part6",
"value": "",
"required": false,
"type": "string"
},
{
"name": "part7",
"value": "",
"required": false,
"type": "string"
},
{
"name": "part8",
"value": "",
"required": false,
"type": "string"
}
],
"inputMappings": [
{
"type": 1,
"value": "$activity[2].result",
"mapTo": "part1"
}
],
"settings": {}
},
{
"id": "5",
"name": "Control GPIO",
"description": "Control raspberry gpio",
"type": 1,
"activityType": "",
"activityRef": "github.com/TIBCOSoftware/flogo-contrib/activity/gpio",
"attributes": [
{
"name": "method",
"value": "Direction",
"required": true,
"type": "string"
},
{
"name": "pinNumber",
"value": "24",
"required": true,
"type": "integer"
},
{
"name": "direction",
"value": "Output",
"required": false,
"type": "string"
},
{
"name": "state",
"value": "",
"required": false,
"type": "string"
},
{
"name": "Pull",
"value": "",
"required": false,
"type": "string"
}
]
},
{
"id": "6",
"name": "Control GPIO (2)",
"description": "Control raspberry gpio",
"type": 1,
"activityType": "",
"activityRef": "github.com/TIBCOSoftware/flogo-contrib/activity/gpio",
"attributes": [
{
"name": "method",
"value": "Set State",
"required": true,
"type": "string"
},
{
"name": "pinNumber",
"value": "24",
"required": true,
"type": "integer"
},
{
"name": "direction",
"value": "",
"required": false,
"type": "string"
},
{
"name": "state",
"value": "High",
"required": false,
"type": "string"
},
{
"name": "Pull",
"value": "",
"required": false,
"type": "string"
}
]
},
{
"id": "7",
"name": "Control GPIO (3)",
"description": "Control raspberry gpio",
"type": 1,
"activityType": "",
"activityRef": "github.com/TIBCOSoftware/flogo-contrib/activity/gpio",
"attributes": [
{
"name": "method",
"value": "Direction",
"required": true,
"type": "string"
},
{
"name": "pinNumber",
"value": "24",
"required": true,
"type": "integer"
},
{
"name": "direction",
"value": "Output",
"required": false,
"type": "string"
},
{
"name": "state",
"value": "",
"required": false,
"type": "string"
},
{
"name": "Pull",
"value": "",
"required": false,
"type": "string"
}
]
},
{
"id": "8",
"name": "Control GPIO (4)",
"description": "Control raspberry gpio",
"type": 1,
"activityType": "",
"activityRef": "github.com/TIBCOSoftware/flogo-contrib/activity/gpio",
"attributes": [
{
"name": "method",
"value": "Set State",
"required": true,
"type": "string"
},
{
"name": "pinNumber",
"value": "24",
"required": true,
"type": "integer"
},
{
"name": "direction",
"value": "",
"required": false,
"type": "string"
},
{
"name": "state",
"value": "Low",
"required": false,
"type": "string"
},
{
"name": "Pull",
"value": "",
"required": false,
"type": "string"
}
]
}
],
"links": [
{
"id": 1,
"from": "2",
"to": "3",
"type": 0
},
{
"id": 2,
"from": "2",
"to": "5",
"type": 1,
"value": "$activity[2].result < 2000"
},
{
"id": 3,
"from": "5",
"to": "6",
"type": 0
},
{
"id": 4,
"from": "2",
"to": "7",
"type": 1,
"value": "$activity[2].result > 2001"
},
{
"id": 5,
"from": "7",
"to": "8",
"type": 0
}
],
"attributes": []
},
"errorHandlerTask": {
"id": "__error_root",
"type": 1,
"tasks": [],
"links": [],
"attributes": []
}
}
},
"id": "weight",
"description": "",
"metadata": {
"input": [],
"output": []
},
"ref": "github.com/TIBCOSoftware/flogo-contrib/action/flow"
},
{
"data": {
"flow": {
"name": "shockon",
"type": 1,
"attributes": [],
"rootTask": {
"id": "root",
"type": 1,
"tasks": [
{
"id": "2",
"name": "SetupLED",
"description": "Control raspberry gpio",
"type": 1,
"activityType": "",
"activityRef": "github.com/TIBCOSoftware/flogo-contrib/activity/gpio",
"attributes": [
{
"name": "method",
"value": "Direction",
"required": true,
"type": "string"
},
{
"name": "pinNumber",
"value": "23",
"required": true,
"type": "integer"
},
{
"name": "direction",
"value": "",
"required": false,
"type": "string"
},
{
"name": "state",
"value": "",
"required": false,
"type": "string"
},
{
"name": "Pull",
"value": "",
"required": false,
"type": "string"
}
]
},
{
"id": "3",
"name": "LEDOn",
"description": "Control raspberry gpio",
"type": 1,
"activityType": "",
"activityRef": "github.com/TIBCOSoftware/flogo-contrib/activity/gpio",
"attributes": [
{
"name": "method",
"value": "Set State",
"required": true,
"type": "string"
},
{
"name": "pinNumber",
"value": "23",
"required": true,
"type": "integer"
},
{
"name": "direction",
"value": "",
"required": false,
"type": "string"
},
{
"name": "state",
"value": "High",
"required": false,
"type": "string"
},
{
"name": "Pull",
"value": "",
"required": false,
"type": "string"
}
]
},
{
"id": "4",
"name": "Log Message",
"description": "Simple Log Activity",
"type": 1,
"activityType": "",
"activityRef": "github.com/TIBCOSoftware/flogo-contrib/activity/log",
"attributes": [
{
"name": "message",
"value": "",
"required": false,
"type": "string"
},
{
"name": "flowInfo",
"value": "false",
"required": false,
"type": "boolean"
},
{
"name": "addToFlow",
"value": "false",
"required": false,
"type": "boolean"
}
],
"inputMappings": [
{
"type": 1,
"value": "$activity[3].result",
"mapTo": "message"
}
],
"settings": {}
}
],
"links": [
{
"id": 1,
"from": "2",
"to": "3",
"type": 0
},
{
"id": 2,
"from": "3",
"to": "4",
"type": 0
}
],
"attributes": []
},
"errorHandlerTask": {
"id": "__error_root",
"type": 1,
"tasks": [],
"links": [],
"attributes": []
}
}
},
"id": "shockon",
"description": "",
"metadata": {
"input": [],
"output": []
},
"ref": "github.com/TIBCOSoftware/flogo-contrib/action/flow"
},
{
"data": {
"flow": {
"type": 1,
"attributes": [],
"rootTask": {
"id": 1,
"type": 1,
"tasks": [
{
"id": "2",
"name": "SetupLED",
"description": "Control raspberry gpio",
"type": 1,
"activityType": "github-com-tibco-software-flogo-contrib-activity-gpio",
"activityRef": "github.com/TIBCOSoftware/flogo-contrib/activity/gpio",
"attributes": [
{
"name": "method",
"value": "Direction",
"required": true,
"type": "string"
},
{
"name": "pinNumber",
"value": "23",
"required": true,
"type": "integer"
},
{
"name": "direction",
"value": "Output",
"required": false,
"type": "string"
},
{
"name": "state",
"value": "",
"required": false,
"type": "string"
},
{
"name": "Pull",
"value": "",
"required": false,
"type": "string"
}
]
},
{
"id": "3",
"name": "LEDOff",
"description": "Control raspberry gpio",
"type": 1,
"activityType": "github-com-tibco-software-flogo-contrib-activity-gpio",
"activityRef": "github.com/TIBCOSoftware/flogo-contrib/activity/gpio",
"attributes": [
{
"name": "method",
"value": "Set State",
"required": true,
"type": "string"
},
{
"name": "pinNumber",
"value": "23",
"required": true,
"type": "integer"
},
{
"name": "direction",
"value": "",
"required": false,
"type": "string"
},
{
"name": "state",
"value": "Low",
"required": false,
"type": "string"
},
{
"name": "Pull",
"value": "",
"required": false,
"type": "string"
}
]
}
],
"links": [
{
"id": 1,
"from": "2",
"to": "3",
"type": 0
}
],
"attributes": []
},
"name": "Shockoff"
}
},
"id": "shockoff",
"ref": "github.com/TIBCOSoftware/flogo-contrib/action/flow"
},
{
"data": {
"flow": {
"name": "ButtonOn",
"type": 1,
"attributes": [],
"rootTask": {
"id": "root",
"type": 1,
"tasks": [
{
"id": "2",
"name": "Control GPIO",
"description": "Control raspberry gpio",
"type": 1,
"activityType": "",
"activityRef": "github.com/TIBCOSoftware/flogo-contrib/activity/gpio",
"attributes": [
{
"name": "method",
"value": "Direction",
"required": true,
"type": "string"
},
{
"name": "pinNumber",
"value": "23",
"required": true,
"type": "integer"
},
{
"name": "direction",
"value": "Output",
"required": false,
"type": "string"
},
{
"name": "state",
"value": "",
"required": false,
"type": "string"
},
{
"name": "Pull",
"value": "",
"required": false,
"type": "string"
}
]
},
{
"id": "3",
"name": "Control GPIO (2)",
"description": "Control raspberry gpio",
"type": 1,
"activityType": "",
"activityRef": "github.com/TIBCOSoftware/flogo-contrib/activity/gpio",
"attributes": [
{
"name": "method",
"value": "Set State",
"required": true,
"type": "string"
},
{
"name": "pinNumber",
"value": "23",
"required": true,
"type": "integer"
},
{
"name": "direction",
"value": "",
"required": false,
"type": "string"
},
{
"name": "state",
"value": "High",
"required": false,
"type": "string"
},
{
"name": "Pull",
"value": "",
"required": false,
"type": "string"
}
]
},
{
"id": "4",
"name": "Setup hx711",
"description": "Setup hx711",
"type": 1,
"activityType": "",
"activityRef": "github.com/lhollyer/hx711",
"attributes": [
{
"name": "dtNumber",
"value": 0,
"required": false,
"type": "integer"
},
{
"name": "sckNumber",
"value": 0,
"required": false,
"type": "integer"
},
{
"name": "Offset",
"value": 0,
"required": false,
"type": "integer"
}
]
},
{
"id": "5",
"name": "Combine",
"description": "Combines separate parts into a single string",
"type": 1,
"activityType": "",
"activityRef": "github.com/jvanderl/flogo-components/activity/combine",
"attributes": [
{
"name": "delimiter",
"value": "",
"required": false,
"type": "string"
},
{
"name": "prefix",
"value": "{ \"pubID\": 0, \"kegID\": 2570, \"eventName\": \"PULL\", \"currentWeight\": ",
"required": false,
"type": "string"
},
{
"name": "suffix",
"value": " }",
"required": false,
"type": "string"
},
{
"name": "part1",
"value": "",
"required": false,
"type": "string"
},
{
"name": "part2",
"value": "",
"required": false,
"type": "string"
},
{
"name": "part3",
"value": "",
"required": false,
"type": "string"
},
{
"name": "part4",
"value": "",
"required": false,
"type": "string"
},
{
"name": "part5",
"value": "",
"required": false,
"type": "string"
},
{
"name": "part6",
"value": "",
"required": false,
"type": "string"
},
{
"name": "part7",
"value": "",
"required": false,
"type": "string"
},
{
"name": "part8",
"value": "",
"required": false,
"type": "string"
}
],
"inputMappings": [
{
"type": 1,
"value": "$activity[4].result",
"mapTo": "part1"
}
],
"settings": {}
},
{
"id": "gpio_11",
"name": "Control GPIO (5)",
"description": "Control raspberry gpio",
"type": 1,
"activityType": "",
"activityRef": "github.com/TIBCOSoftware/flogo-contrib/activity/gpio",
"attributes": [
{
"name": "method",
"value": "Direction",
"required": true,
"type": "string"
},
{
"name": "pinNumber",
"value": "18",
"required": true,
"type": "integer"
},
{
"name": "direction",
"value": "Output",
"required": false,
"type": "string"
},
{
"name": "state",
"value": "",
"required": false,
"type": "string"
},
{
"name": "Pull",
"value": "",
"required": false,
"type": "string"
}
]
},
{
"id": "gpio_12",
"name": "Control GPIO (6)",
"description": "Control raspberry gpio",
"type": 1,
"activityType": "",
"activityRef": "github.com/TIBCOSoftware/flogo-contrib/activity/gpio",
"attributes": [
{
"name": "method",
"value": "Set State",
"required": true,
"type": "string"
},
{
"name": "pinNumber",
"value": "18",
"required": true,
"type": "integer"
},
{
"name": "direction",
"value": "",
"required": false,
"type": "string"
},
{
"name": "state",
"value": "High",
"required": false,
"type": "string"
},
{
"name": "Pull",
"value": "",
"required": false,
"type": "string"
}
]
},
{
"id": "gpio_13",
"name": "Control GPIO (7)",
"description": "Control raspberry gpio",
"type": 1,
"activityType": "",
"activityRef": "github.com/TIBCOSoftware/flogo-contrib/activity/gpio",
"attributes": [
{
"name": "method",
"value": "Direction",
"required": true,
"type": "string"
},
{
"name": "pinNumber",
"value": "18",
"required": true,
"type": "integer"
},
{
"name": "direction",
"value": "Output",
"required": false,
"type": "string"
},
{
"name": "state",
"value": "",
"required": false,
"type": "string"
},
{
"name": "Pull",
"value": "",
"required": false,
"type": "string"
}
]
},
{
"id": "gpio_14",
"name": "Control GPIO (8)",
"description": "Control raspberry gpio",
"type": 1,
"activityType": "",
"activityRef": "github.com/TIBCOSoftware/flogo-contrib/activity/gpio",
"attributes": [
{
"name": "method",
"value": "Set State",
"required": true,
"type": "string"
},
{
"name": "pinNumber",
"value": "18",
"required": true,
"type": "integer"
},
{
"name": "direction",
"value": "",
"required": false,
"type": "string"
},
{
"name": "state",
"value": "Low",
"required": false,
"type": "string"
},
{
"name": "Pull",
"value": "",
"required": false,
"type": "string"
}
]
}
],
"links": [
{
"id": 1,
"from": "2",
"to": "3",
"type": 0
},
{
"id": 2,
"from": "3",
"to": "4",
"type": 0
},
{
"id": 3,
"from": "4",
"to": "5",
"type": 0
},
{
"id": 4,
"from": "5",
"to": "gpio_11",
"type": 1,
"value": "$activity[4].result < 3000"
},
{
"id": 5,
"from": "gpio_11",
"to": "gpio_12",
"type": 0
},
{
"id": 6,
"from": "5",
"to": "gpio_13",
"type": 1,
"value": "$activity[4].result > 2999"
},
{
"id": 7,
"from": "gpio_13",
"to": "gpio_14",
"type": 0
}
],
"attributes": []
},
"errorHandlerTask": {
"id": "__error_root",
"type": 1,
"tasks": [],
"links": [],
"attributes": []
}
}
},
"id": "button_on",
"description": "",
"metadata": {
"input": [],
"output": []
},
"ref": "github.com/TIBCOSoftware/flogo-contrib/action/flow"
},
{
"data": {
"flow": {
"type": 1,
"attributes": [],
"rootTask": {
"id": 1,
"type": 1,
"tasks": [
{
"id": "2",
"name": "Log Message",
"description": "Simple Log Activity",
"type": 1,
"activityType": "github-com-tibco-software-flogo-contrib-activity-log",
"activityRef": "github.com/TIBCOSoftware/flogo-contrib/activity/log",
"attributes": [
{
"name": "message",
"value": "*******OFF*******",
"required": false,
"type": "string"
},
{
"name": "flowInfo",
"value": "false",
"required": false,
"type": "boolean"
},
{
"name": "addToFlow",
"value": "false",
"required": false,
"type": "boolean"
}
]
},
{
"id": "3",
"name": "Control GPIO",
"description": "Control raspberry gpio",
"type": 1,
"activityType": "github-com-tibco-software-flogo-contrib-activity-gpio",
"activityRef": "github.com/TIBCOSoftware/flogo-contrib/activity/gpio",
"attributes": [
{
"name": "method",
"value": "Direction",
"required": true,
"type": "string"
},
{
"name": "pinNumber",
"value": "23",
"required": true,
"type": "integer"
},
{
"name": "direction",
"value": "Output",
"required": false,
"type": "string"
},
{
"name": "state",
"value": "",
"required": false,
"type": "string"
},
{
"name": "Pull",
"value": "",
"required": false,
"type": "string"
}
]
},
{
"id": "4",
"name": "Control GPIO (2)",
"description": "Control raspberry gpio",
"type": 1,
"activityType": "github-com-tibco-software-flogo-contrib-activity-gpio",
"activityRef": "github.com/TIBCOSoftware/flogo-contrib/activity/gpio",
"attributes": [
{
"name": "method",
"value": "Set State",
"required": true,
"type": "string"
},
{
"name": "pinNumber",
"value": "23",
"required": true,
"type": "integer"
},
{
"name": "direction",
"value": null,
"required": false,
"type": "string"
},
{
"name": "state",
"value": "Low",
"required": false,
"type": "string"
},
{
"name": "Pull",
"value": "",
"required": false,
"type": "string"
}
]
}
],
"links": [
{
"id": 1,
"from": "2",
"to": "3",
"type": 0
},
{
"id": 2,
"from": "3",
"to": "4",
"type": 0
}
],
"attributes": []
},
"name": "ButtonOff"
}
},
"id": "button_off",
"ref": "github.com/TIBCOSoftware/flogo-contrib/action/flow"
}
]
}
{
"name": "Pub App WITHOUT INVOKES (3)",
"type": "flogo:app",
"version": "0.0.1",
"appModel": "1.0.0",
"triggers": [
{
"id": "timer_2",
"ref": "github.com/jvanderl/flogo-components/trigger/timer2",
"name": "Timer 2",
"description": "Simple Timer trigger",
"settings": {},
"handlers": [
{
"action": {
"ref": "github.com/TIBCOSoftware/flogo-contrib/action/flow",
"data": {
"flowURI": "res://flow:temp"
}
},
"settings": {
"repeating": true,
"seconds": "30",
"startImmediate": true
}
},
{
"action": {
"ref": "github.com/TIBCOSoftware/flogo-contrib/action/flow",
"data": {
"flowURI": "res://flow:weight"
}
},
"settings": {
"repeating": true,
"minutes": "5",
"startImmediate": true
}
}
]
},
{
"id": "gpio",
"ref": "github.com/jvanderl/flogo-components/trigger/gpio",
"name": "GPIO",
"description": "GPIO trigger",
"settings": {
"interval": "100"
},
"handlers": [
{
"action": {
"ref": "github.com/TIBCOSoftware/flogo-contrib/action/flow",
"data": {
"flowURI": "res://flow:shockon"
}
},
"settings": {
"gpiopin": "27",
"state": "1",
"pull": true
}
},
{
"action": {
"ref": "github.com/TIBCOSoftware/flogo-contrib/action/flow",
"data": {
"flowURI": "res://flow:shockoff"
}
},
"settings": {
"gpiopin": "27",
"state": "0",
"pull": true
}
},
{
"action": {
"ref": "github.com/TIBCOSoftware/flogo-contrib/action/flow",
"data": {
"flowURI": "res://flow:button_on"
}
},
"settings": {
"gpiopin": "19",
"state": "0",
"pull": true
}
},
{
"action": {
"ref": "github.com/TIBCOSoftware/flogo-contrib/action/flow",
"data": {
"flowURI": "res://flow:button_off"
}
},
"settings": {
"gpiopin": "19",
"state": "1",
"pull": true
}
}
]
}
],
"resources": [
{
"id": "flow:temp",
"data": {
"name": "Temp",
"tasks": [
{
"id": "2",
"name": "Setup ds18b20",
"description": "Setup ds18b20",
"activity": {
"ref": "github.com/lhollyer/ds18b20"
}
},
{
"id": "3",
"name": "Log Message",
"description": "Simple Log Activity",
"activity": {
"ref": "github.com/TIBCOSoftware/flogo-contrib/activity/log",
"input": {
"flowInfo": "false",
"addToFlow": "false"
},
"mappings": {
"input": [
{
"type": "assign",
"value": "$activity[2].result",
"mapTo": "message"
}
]
}
}
},
{
"id": "4",
"name": "Combine",
"description": "Combines separate parts into a single string",
"activity": {
"ref": "github.com/jvanderl/flogo-components/activity/combine",
"input": {
"delimiter": "",
"prefix": "{ \"pubID\": 0, \"kegID\": 2570, \"eventName\": \"TEMP\", \"temperature\": ",
"suffix": " }",
"part2": "",
"part3": "",
"part4": "",
"part5": "",
"part6": "",
"part7": "",
"part8": ""
},
"mappings": {
"input": [
{
"type": "assign",
"value": "$activity[2].result",
"mapTo": "part1"
}
]
}
}
},
{
"id": "6",
"name": "Control GPIO",
"description": "Control raspberry gpio",
"activity": {
"ref": "github.com/TIBCOSoftware/flogo-contrib/activity/gpio",
"input": {
"method": "Direction",
"pinNumber": "24",
"direction": "Output",
"state": "",
"Pull": ""
}
}
},
{
"id": "7",
"name": "Control GPIO (2)",
"description": "Control raspberry gpio",
"activity": {
"ref": "github.com/TIBCOSoftware/flogo-contrib/activity/gpio",
"input": {
"method": "Set State",
"pinNumber": "24",
"direction": "",
"state": "High",
"Pull": ""
}
}
},
{
"id": "8",
"name": "Control GPIO (3)",
"description": "Control raspberry gpio",
"activity": {
"ref": "github.com/TIBCOSoftware/flogo-contrib/activity/gpio",
"input": {
"method": "Direction",
"pinNumber": "24",
"direction": "Output",
"state": "",
"Pull": ""
}
}
},
{
"id": "9",
"name": "Control GPIO (4)",
"description": "Control raspberry gpio",
"activity": {
"ref": "github.com/TIBCOSoftware/flogo-contrib/activity/gpio",
"input": {
"method": "Set State",
"pinNumber": "24",
"direction": "",
"state": "Low",
"Pull": ""
}
}
}
],
"links": [
{
"from": "2",
"to": "3"
},
{
"from": "3",
"to": "4"
},
{
"from": "2",
"to": "6",
"type": "expression",
"value": "$activity[2].result > 24"
},
{
"from": "6",
"to": "7"
},
{
"from": "2",
"to": "8",
"type": "expression",
"value": "$activity[2].result < 25"
},
{
"from": "8",
"to": "9"
}
]
}
},
{
"id": "flow:weight",
"data": {
"name": "Weight",
"tasks": [
{
"id": "2",
"name": "Setup hx711",
"description": "Setup hx711",
"activity": {
"ref": "github.com/lhollyer/hx711",
"input": {
"dtNumber": 0,
"sckNumber": 0,
"Offset": 0
}
}
},
{
"id": "3",
"name": "Combine",
"description": "Combines separate parts into a single string",
"activity": {
"ref": "github.com/jvanderl/flogo-components/activity/combine",
"input": {
"delimiter": "",
"prefix": "{ \"pubID\": 0, \"kegID\": 2570, \"eventName\": \"PULL\", \"currentWeight\": ",
"suffix": " }",
"part2": "",
"part3": "",
"part4": "",
"part5": "",
"part6": "",
"part7": "",
"part8": ""
},
"mappings": {
"input": [
{
"type": "assign",
"value": "$activity[2].result",
"mapTo": "part1"
}
]
}
}
},
{
"id": "5",
"name": "Control GPIO",
"description": "Control raspberry gpio",
"activity": {
"ref": "github.com/TIBCOSoftware/flogo-contrib/activity/gpio",
"input": {
"method": "Direction",
"pinNumber": "24",
"direction": "Output",
"state": "",
"Pull": ""
}
}
},
{
"id": "6",
"name": "Control GPIO (2)",
"description": "Control raspberry gpio",
"activity": {
"ref": "github.com/TIBCOSoftware/flogo-contrib/activity/gpio",
"input": {
"method": "Set State",
"pinNumber": "24",
"direction": "",
"state": "High",
"Pull": ""
}
}
},
{
"id": "7",
"name": "Control GPIO (3)",
"description": "Control raspberry gpio",
"activity": {
"ref": "github.com/TIBCOSoftware/flogo-contrib/activity/gpio",
"input": {
"method": "Direction",
"pinNumber": "24",
"direction": "Output",
"state": "",
"Pull": ""
}
}
},
{
"id": "8",
"name": "Control GPIO (4)",
"description": "Control raspberry gpio",
"activity": {
"ref": "github.com/TIBCOSoftware/flogo-contrib/activity/gpio",
"input": {
"method": "Set State",
"pinNumber": "24",
"direction": "",
"state": "Low",
"Pull": ""
}
}
}
],
"links": [
{
"from": "2",
"to": "3"
},
{
"from": "2",
"to": "5",
"type": "expression",
"value": "$activity[2].result < 2000"
},
{
"from": "5",
"to": "6"
},
{
"from": "2",
"to": "7",
"type": "expression",
"value": "$activity[2].result > 2001"
},
{
"from": "7",
"to": "8"
}
]
}
},
{
"id": "flow:shockon",
"data": {
"name": "shockon",
"tasks": [
{
"id": "2",
"name": "SetupLED",
"description": "Control raspberry gpio",
"activity": {
"ref": "github.com/TIBCOSoftware/flogo-contrib/activity/gpio",
"input": {
"method": "Direction",
"pinNumber": "23",
"direction": "",
"state": "",
"Pull": ""
}
}
},
{
"id": "3",
"name": "LEDOn",
"description": "Control raspberry gpio",
"activity": {
"ref": "github.com/TIBCOSoftware/flogo-contrib/activity/gpio",
"input": {
"method": "Set State",
"pinNumber": "23",
"direction": "",
"state": "High",
"Pull": ""
}
}
},
{
"id": "4",
"name": "Log Message",
"description": "Simple Log Activity",
"activity": {
"ref": "github.com/TIBCOSoftware/flogo-contrib/activity/log",
"input": {
"flowInfo": "false",
"addToFlow": "false"
},
"mappings": {
"input": [
{
"type": "assign",
"value": "$activity[3].result",
"mapTo": "message"
}
]
}
}
}
],
"links": [
{
"from": "2",
"to": "3"
},
{
"from": "3",
"to": "4"
}
]
}
},
{
"id": "flow:shockoff",
"data": {
"name": "Shockoff",
"tasks": [
{
"id": "2",
"name": "SetupLED",
"description": "Control raspberry gpio",
"activity": {
"ref": "github.com/TIBCOSoftware/flogo-contrib/activity/gpio",
"input": {
"method": "Direction",
"pinNumber": "23",
"direction": "Output",
"state": "",
"Pull": ""
}
}
},
{
"id": "3",
"name": "LEDOff",
"description": "Control raspberry gpio",
"activity": {
"ref": "github.com/TIBCOSoftware/flogo-contrib/activity/gpio",
"input": {
"method": "Set State",
"pinNumber": "23",
"direction": "",
"state": "Low",
"Pull": ""
}
}
}
],
"links": [
{
"from": "2",
"to": "3"
}
]
}
},
{
"id": "flow:button_on",
"data": {
"name": "ButtonOn",
"tasks": [
{
"id": "2",
"name": "Control GPIO",
"description": "Control raspberry gpio",
"activity": {
"ref": "github.com/TIBCOSoftware/flogo-contrib/activity/gpio",
"input": {
"method": "Direction",
"pinNumber": "23",
"direction": "Output",
"state": "",
"Pull": ""
}
}
},
{
"id": "3",
"name": "Control GPIO (2)",
"description": "Control raspberry gpio",
"activity": {
"ref": "github.com/TIBCOSoftware/flogo-contrib/activity/gpio",
"input": {
"method": "Set State",
"pinNumber": "23",
"direction": "",
"state": "High",
"Pull": ""
}
}
},
{
"id": "4",
"name": "Setup hx711",
"description": "Setup hx711",
"activity": {
"ref": "github.com/lhollyer/hx711",
"input": {
"dtNumber": 0,
"sckNumber": 0,
"Offset": 0
}
}
},
{
"id": "5",
"name": "Combine",
"description": "Combines separate parts into a single string",
"activity": {
"ref": "github.com/jvanderl/flogo-components/activity/combine",
"input": {
"delimiter": "",
"prefix": "{ \"pubID\": 0, \"kegID\": 2570, \"eventName\": \"PULL\", \"currentWeight\": ",
"suffix": " }",
"part2": "",
"part3": "",
"part4": "",
"part5": "",
"part6": "",
"part7": "",
"part8": ""
},
"mappings": {
"input": [
{
"type": "assign",
"value": "$activity[4].result",
"mapTo": "part1"
}
]
}
}
},
{
"id": "gpio_11",
"name": "Control GPIO (5)",
"description": "Control raspberry gpio",
"activity": {
"ref": "github.com/TIBCOSoftware/flogo-contrib/activity/gpio",
"input": {
"method": "Direction",
"pinNumber": "18",
"direction": "Output",
"state": "",
"Pull": ""
}
}
},
{
"id": "gpio_12",
"name": "Control GPIO (6)",
"description": "Control raspberry gpio",
"activity": {
"ref": "github.com/TIBCOSoftware/flogo-contrib/activity/gpio",
"input": {
"method": "Set State",
"pinNumber": "18",
"direction": "",
"state": "High",
"Pull": ""
}
}
},
{
"id": "gpio_13",
"name": "Control GPIO (7)",
"description": "Control raspberry gpio",
"activity": {
"ref": "github.com/TIBCOSoftware/flogo-contrib/activity/gpio",
"input": {
"method": "Direction",
"pinNumber": "18",
"direction": "Output",
"state": "",
"Pull": ""
}
}
},
{
"id": "gpio_14",
"name": "Control GPIO (8)",
"description": "Control raspberry gpio",
"activity": {
"ref": "github.com/TIBCOSoftware/flogo-contrib/activity/gpio",
"input": {
"method": "Set State",
"pinNumber": "18",
"direction": "",
"state": "Low",
"Pull": ""
}
}
}
],
"links": [
{
"from": "2",
"to": "3"
},
{
"from": "3",
"to": "4"
},
{
"from": "4",
"to": "5"
},
{
"from": "5",
"to": "gpio_11",
"type": "expression",
"value": "$activity[4].result < 3000"
},
{
"from": "gpio_11",
"to": "gpio_12"
},
{
"from": "5",
"to": "gpio_13",
"type": "expression",
"value": "$activity[4].result > 2999"
},
{
"from": "gpio_13",
"to": "gpio_14"
}
]
}
},
{
"id": "flow:button_off",
"data": {
"name": "ButtonOff",
"tasks": [
{
"id": "2",
"name": "Log Message",
"description": "Simple Log Activity",
"activity": {
"ref": "github.com/TIBCOSoftware/flogo-contrib/activity/log",
"input": {
"message": "*******OFF*******",
"flowInfo": "false",
"addToFlow": "false"
}
}
},
{
"id": "3",
"name": "Control GPIO",
"description": "Control raspberry gpio",
"activity": {
"ref": "github.com/TIBCOSoftware/flogo-contrib/activity/gpio",
"input": {
"method": "Direction",
"pinNumber": "23",
"direction": "Output",
"state": "",
"Pull": ""
}
}
},
{
"id": "4",
"name": "Control GPIO (2)",
"description": "Control raspberry gpio",
"activity": {
"ref": "github.com/TIBCOSoftware/flogo-contrib/activity/gpio",
"input": {
"method": "Set State",
"pinNumber": "23",
"direction": null,
"state": "Low",
"Pull": ""
}
}
}
],
"links": [
{
"from": "2",
"to": "3"
},
{
"from": "3",
"to": "4"
}
]
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment