69 lines
1.4 KiB
Smarty
69 lines
1.4 KiB
Smarty
[
|
||
{
|
||
"id": "inject1",
|
||
"type": "inject",
|
||
"name": "Start – {{name}}",
|
||
"props": [
|
||
{ "p": "payload" }
|
||
],
|
||
"repeat": "",
|
||
"crontab": "",
|
||
"once": false,
|
||
"onceDelay": 0.1,
|
||
"topic": "",
|
||
"payload": "{{id}}",
|
||
"payloadType": "str",
|
||
"wires": [["function1"]]
|
||
},
|
||
{
|
||
"id": "function1",
|
||
"type": "function",
|
||
"name": "Verwerk asset data",
|
||
"func": "msg.payload = {\n asset_id: \"{{id}}\",\n asset_name: \"{{name}}\",\n timestamp: Date.now()\n};\nreturn msg;",
|
||
"outputs": 1,
|
||
"noerr": 0,
|
||
"initialize": "",
|
||
"finalize": "",
|
||
"libs": [],
|
||
"wires": [["change1","debug1","http1"]]
|
||
},
|
||
{
|
||
"id": "change1",
|
||
"type": "change",
|
||
"name": "Voeg status toe",
|
||
"rules": [
|
||
{ "t": "set", "p": "payload.status", "pt": "msg", "to": "active", "tot": "str" }
|
||
],
|
||
"wires": [["debug1"]]
|
||
},
|
||
{
|
||
"id": "http1",
|
||
"type": "http request",
|
||
"name": "Stuur naar externe API",
|
||
"method": "POST",
|
||
"ret": "txt",
|
||
"url": "http://localhost:3000/api/asset",
|
||
"tls": "",
|
||
"persist": false,
|
||
"proxy": "",
|
||
"authType": "",
|
||
"x": 540,
|
||
"y": 260,
|
||
"wires": [["debug1"]]
|
||
},
|
||
{
|
||
"id": "debug1",
|
||
"type": "debug",
|
||
"name": "Output debug",
|
||
"active": true,
|
||
"tosidebar": true,
|
||
"console": false,
|
||
"tostatus": false,
|
||
"complete": "payload",
|
||
"targetType": "msg",
|
||
"statusVal": "",
|
||
"statusType": "auto",
|
||
"wires": []
|
||
}
|
||
]
|