node-red-contrib-mnubo 1.3.1

Mnubo

npm install node-red-contrib-mnubo

Table of Content

1. Introduction

2. Architecture

3. Pre-requisites

4. Installation & Configuration

5. Usage

6. Important notes

7. Source code

8. Known limitations

9. References


#1. Introduction

This is the implementation of the mnubo's SmartObjects functionality in the node-red environment.

Note that this package is also compatible with other node-red environments, like IBM Bluemix and AT&T Flow.


#2. Architecture

This is a front-end implementation of the https://www.npmjs.com/package/mnubo-sdk

Detailed info is available on the individual node in node-red.

Here is a brief description of the nodes:

mnubo config: This is the Configuration Node that holds the mnubo's SmartObjects credential, all nodes need to have this configured.

Auth: This node is used to fetch the access token for communication with SmartObject. This node will also allow you to get the status about the token.

Owners : This node is used to handle the Owners Ingestion API: Create, Update, Delete, Claim Object, unClaim Object

Objects : This node is used to handle the Objects Ingestion API: Create, Update, Delete

Events : This node is used to handle the Events Ingestion API: Send, SendFromDevice

Analytics : This node is used to handle the Search API: getDataset, getDatamodel, SearchQurery


#3. Prerequisites

This is a node-red package, so it requires node-red, The minimum version of node-red supported is v0.10.10

To use the mnubo's SmartObjects nodes, you will need to have a valid mnubo account, with access granted on a namespace. To obtain your unique namespace in the SmartObjects platform, contact [email protected] . Please use the subject title node-red-contrinb-mnubo and include in the body of the email the name of your company, contact name and phone number.

Once logged into mnubo's SmartObjects, the Official reference API can be found in the following: [API documentation]

(https://sop.mtl.mnubo.com/apps/doc/?i=t).

This package also requires the following package:

  • mnubo's SmartObjects Javascript SDK mnubo-js-sdk
  • ECMAScript 6 (Harmony) compatibility shims for legacy JavaScript engines es6-shim

Those packages will be installed automatically by npm, as they are dependent packages.


#4. Installation & Configuration

Linux installation

sudo npm install --prefix ~/.node-red node-red-contrib-mnubo

Windows installation (using Cygwin)

npm install --prefix ~/.node-red node-red-contrib-mnubo
mkdir %homepath%/.node-red/nodes
cp -rp %homepath%/node_modules/node-red-contrib-mnubo %homepath%/.node-red/nodes/

AT&T flow

Note that this node is also compatible with the AT&T Flow, to use it in flow, just edit the package.json in your flow project, and add this node in the depedency:

"dependencies":{"node-red-contrib-mnubo":"^1.0.3"}

    Then, when you will " enter the Online mode", you should have access to the mnubo nodes.

#5. Usage

Examples

Example 1: Quick Demo

Here is a quick demo that shows how to authenticate, create owner, update owner, create object, update object, send event, do a basicSearchQuery,

delete the object, delete the owner:

[{"id":"ea597271.15a69","type":"mnubo config","z":"2d7a2cc9.d285d4","name":"Jerome","env":"sandbox","proxy_url":""},{"id":"17925606.e86daa","type":"mnubo auth","z":"2d7a2cc9.d285d4","name":"","mnuboconfig":"ea597271.15a69","x":440,"y":56,"wires":[["561a8d39.a9e574"]]},{"id":"51b613ce.ae49ec","type":"inject","z":"2d7a2cc9.d285d4","name":"","topic":"Test All","payload":"","payloadType":"none","repeat":"","crontab":"","once":false,"x":95,"y":63,"wires":[["17925606.e86daa"]]},{"id":"e6b03005.194fd","type":"debug","z":"2d7a2cc9.d285d4","name":"OK","active":true,"console":"false","complete":"payload","x":924,"y":194,"wires":[]},{"id":"561a8d39.a9e574","type":"switch","z":"2d7a2cc9.d285d4","name":"Token != Bearer","property":"payload.token_type","rules":[{"t":"neq","v":"Bearer"},{"t":"eq","v":"Bearer"}],"checkall":"true","outputs":2,"x":646,"y":57,"wires":[["edd7671.f122898"],["9e5aef3.f61a51","7638564f.89c7a8"]]},{"id":"5aa31777.a55ce8","type":"debug","z":"2d7a2cc9.d285d4","name":"Error","active":true,"console":"false","complete":"payload","x":925,"y":163,"wires":[]},{"id":"9bbadf79.64452","type":"mnubo owners","z":"2d7a2cc9.d285d4","name":"","mnuboconfig":"ea597271.15a69","functionselection":"create","inputtext":"","x":495,"y":169,"wires":[["cef1f5b4.310e08"]]},{"id":"dedbc5dd.212438","type":"mnubo owners","z":"2d7a2cc9.d285d4","name":"","mnuboconfig":"ea597271.15a69","functionselection":"delete","inputtext":"","x":487,"y":845,"wires":[["20e69541.df196a"]]},{"id":"cef1f5b4.310e08","type":"switch","z":"2d7a2cc9.d285d4","name":"errorCode is not null","property":"payload.errorCode","rules":[{"t":"nnull"},{"t":"null"}],"checkall":"true","outputs":2,"x":684,"y":170,"wires":[["5aa31777.a55ce8"],["e6b03005.194fd","8c56464e.73a9b8"]]},{"id":"edd7671.f122898","type":"debug","z":"2d7a2cc9.d285d4","name":"Error","active":true,"console":"false","complete":"payload","x":932,"y":44,"wires":[]},{"id":"9e5aef3.f61a51","type":"debug","z":"2d7a2cc9.d285d4","name":"OK","active":true,"console":"false","complete":"payload","x":930,"y":76,"wires":[]},{"id":"e27db47b.1d8248","type":"debug","z":"2d7a2cc9.d285d4","name":"Error","active":true,"console":"false","complete":"payload","x":916,"y":838,"wires":[]},{"id":"826e9923.7d9168","type":"debug","z":"2d7a2cc9.d285d4","name":"OK","active":true,"console":"false","complete":"payload","x":913,"y":870,"wires":[]},{"id":"5d93e52a.a26c1c","type":"inject","z":"2d7a2cc9.d285d4","name":"","topic":"clean","payload":"[email protected]","payloadType":"none","repeat":"","crontab":"","once":false,"x":90,"y":845,"wires":[["26751614.d98aea"]]},{"id":"8b0cf49c.74f308","type":"inject","z":"2d7a2cc9.d285d4","name":"","topic":"","payload":"","payloadType":"none","repeat":"","crontab":"","once":false,"x":104,"y":115,"wires":[["7638564f.89c7a8"]]},{"id":"20e69541.df196a","type":"switch","z":"2d7a2cc9.d285d4","name":"errorCode is not null","property":"payload.errorCode","rules":[{"t":"nnull"},{"t":"null"}],"checkall":"true","outputs":2,"x":707,"y":840,"wires":[["e27db47b.1d8248"],["826e9923.7d9168"]]},{"id":"2d1551a5.d2eaae","type":"mnubo owners","z":"2d7a2cc9.d285d4","name":"","mnuboconfig":"ea597271.15a69","functionselection":"update","inputtext":"","x":485,"y":244,"wires":[["1ac7224c.e538de"]]},{"id":"2613a0df.d9ec6","type":"debug","z":"2d7a2cc9.d285d4","name":"OK","active":true,"console":"false","complete":"payload","x":924,"y":268,"wires":[]},{"id":"9a919985.656e68","type":"debug","z":"2d7a2cc9.d285d4","name":"Error","active":true,"console":"false","complete":"payload","x":924,"y":236,"wires":[]},{"id":"1ac7224c.e538de","type":"switch","z":"2d7a2cc9.d285d4","name":"errorCode is not null","property":"payload.errorCode","rules":[{"t":"nnull"},{"t":"null"}],"checkall":"true","outputs":2,"x":754,"y":243,"wires":[["9a919985.656e68"],["2613a0df.d9ec6","59891fad.a676e"]]},{"id":"160827c6.e9f7d8","type":"mnubo objects","z":"2d7a2cc9.d285d4","name":"","mnuboconfig":"ea597271.15a69","functionselection":"create","inputtext":"","x":484,"y":329,"wires":[["aecec38f.51314"]]},{"id":"aecec38f.51314","type":"switch","z":"2d7a2cc9.d285d4","name":"errorCode is not null","property":"payload.errorCode","rules":[{"t":"nnull"},{"t":"null"}],"checkall":"true","outputs":2,"x":689,"y":328,"wires":[["7693bc16.896c44"],["5541f356.aabe0c","f6a1d851.095e28"]]},{"id":"7693bc16.896c44","type":"debug","z":"2d7a2cc9.d285d4","name":"Error","active":true,"console":"false","complete":"payload","x":923,"y":315,"wires":[]},{"id":"5541f356.aabe0c","type":"debug","z":"2d7a2cc9.d285d4","name":"OK","active":true,"console":"false","complete":"payload","x":923,"y":347,"wires":[]},{"id":"888d985f.777268","type":"mnubo objects","z":"2d7a2cc9.d285d4","name":"","mnuboconfig":"ea597271.15a69","functionselection":"delete","inputtext":"","x":483,"y":767,"wires":[["c1c10f87.3e3ef"]]},{"id":"520a783b.adf588","type":"inject","z":"2d7a2cc9.d285d4","name":"","topic":"clean","payload":"[email protected]","payloadType":"none","repeat":"","crontab":"","once":false,"x":91,"y":769,"wires":[["a4cc7ee4.5b338"]]},{"id":"21ddd627.de222a","type":"debug","z":"2d7a2cc9.d285d4","name":"Error","active":true,"console":"false","complete":"payload","x":919,"y":747,"wires":[]},{"id":"118809d1.ee77f6","type":"debug","z":"2d7a2cc9.d285d4","name":"OK","active":true,"console":"false","complete":"payload","x":918,"y":779,"wires":[]},{"id":"c1c10f87.3e3ef","type":"switch","z":"2d7a2cc9.d285d4","name":"errorCode is not null","property":"payload.errorCode","rules":[{"t":"nnull"},{"t":"null"}],"checkall":"true","outputs":2,"x":709,"y":757,"wires":[["21ddd627.de222a"],["118809d1.ee77f6","26751614.d98aea"]]},{"id":"bc053e9.f43fac","type":"mnubo objects","z":"2d7a2cc9.d285d4","name":"","mnuboconfig":"ea597271.15a69","functionselection":"update","inputtext":"","x":474,"y":405,"wires":[["37638d74.c89c72"]]},{"id":"c1ce8353.3e318","type":"debug","z":"2d7a2cc9.d285d4","name":"OK","active":true,"console":"false","complete":"payload","x":921,"y":424,"wires":[]},{"id":"9dbfbc60.62404","type":"debug","z":"2d7a2cc9.d285d4","name":"Error","active":true,"console":"false","complete":"payload","x":921,"y":392,"wires":[]},{"id":"37638d74.c89c72","type":"switch","z":"2d7a2cc9.d285d4","name":"errorCode is not null","property":"payload.errorCode","rules":[{"t":"nnull"},{"t":"null"}],"checkall":"true","outputs":2,"x":743,"y":405,"wires":[["9dbfbc60.62404"],["c1ce8353.3e318","ef9f73c3.10609"]]},{"id":"9f0aed7.f60f51","type":"mnubo events","z":"2d7a2cc9.d285d4","name":"","mnuboconfig":"ea597271.15a69","functionselection":"send","inputtext":"","x":469,"y":481,"wires":[["f3f191c9.0c0e7"]]},{"id":"f45df5fa.0ba208","type":"mnubo events","z":"2d7a2cc9.d285d4","name":"","mnuboconfig":"ea597271.15a69","functionselection":"sendfromdevice","inputtext":"[\n    \"node-red-device-auto1\", \n    [{\n\t\"x_event_type\": \"event_type_test\",\n\t\"x_timestamp\": \"2015-01-22T00:01:25-02:00\",\n\t\"x_latitude\": 57.876,\n\t\"x_longitude\": 57.876,\n\t\"temperature\": 15.2\n    }]\n]","x":522.5555572509766,"y":558.1110897064209,"wires":[["59c45d43.a63ba4"]]},{"id":"70b1e62a.8f4e18","type":"debug","z":"2d7a2cc9.d285d4","name":"OK","active":true,"console":"false","complete":"payload","x":922,"y":501,"wires":[]},{"id":"154891fb.eab76e","type":"debug","z":"2d7a2cc9.d285d4","name":"Error","active":true,"console":"false","complete":"payload","x":922,"y":469,"wires":[]},{"id":"f3f191c9.0c0e7","type":"switch","z":"2d7a2cc9.d285d4","name":"errorCode is not null","property":"payload.errorCode","rules":[{"t":"nnull"},{"t":"null"}],"checkall":"true","outputs":2,"x":749,"y":483,"wires":[["154891fb.eab76e"],["70b1e62a.8f4e18","25c970e1.da369"]]},{"id":"bd682dca.4297d","type":"debug","z":"2d7a2cc9.d285d4","name":"OK","active":true,"console":"false","complete":"payload","x":920,"y":584,"wires":[]},{"id":"15ccba17.ea3346","type":"debug","z":"2d7a2cc9.d285d4","name":"Error","active":true,"console":"false","complete":"payload","x":920,"y":552,"wires":[]},{"id":"59c45d43.a63ba4","type":"switch","z":"2d7a2cc9.d285d4","name":"errorCode is not null","property":"payload.errorCode","rules":[{"t":"nnull"},{"t":"null"}],"checkall":"true","outputs":2,"x":742,"y":559,"wires":[["15ccba17.ea3346"],["bd682dca.4297d","88f33cd9.770cc"]]},{"id":"30375974.cfc8a6","type":"mnubo analytics","z":"2d7a2cc9.d285d4","name":"","mnuboconfig":"ea597271.15a69","searchtype":"SearchQuery","inputquery":"","x":459,"y":658,"wires":[["cb2aaf90.34d55","a4cc7ee4.5b338"]]},{"id":"da542530.25abd8","type":"debug","z":"2d7a2cc9.d285d4","name":"Error","active":true,"console":"false","complete":"payload","x":920,"y":635,"wires":[]},{"id":"d55b7326.2aa49","type":"debug","z":"2d7a2cc9.d285d4","name":"rows","active":true,"console":"false","complete":"payload.rows","x":920,"y":667,"wires":[]},{"id":"cb2aaf90.34d55","type":"switch","z":"2d7a2cc9.d285d4","name":"errorCode is not null","property":"payload.errorCode","rules":[{"t":"nnull"},{"t":"null"}],"checkall":"true","outputs":2,"x":705,"y":656,"wires":[["da542530.25abd8"],["d55b7326.2aa49"]]},{"id":"2be4304.fd41bd","type":"function","z":"2d7a2cc9.d285d4","name":"Create Owner","func":"msg.payload =\n{\n\t\"username\": context.global.mnubo.owner1,\n\t\"x_password\": \"12345678\"\n};\n\nreturn msg;","outputs":1,"noerr":0,"x":319.4444694519043,"y":167.88886642456055,"wires":[["9bbadf79.64452"]]},{"id":"59891fad.a676e","type":"function","z":"2d7a2cc9.d285d4","name":"Create an Object","func":"msg.payload = {\n\t\"x_device_id\": context.global.mnubo.object1,\n\t\"x_object_type\": \"test\",\n\t\"x_owner\": {\n\t\t\"username\": context.global.mnubo.owner1\n\t}\n};\nreturn msg;","outputs":1,"noerr":0,"x":289.4444465637207,"y":330.11110496520996,"wires":[["160827c6.e9f7d8"]]},{"id":"ef9f73c3.10609","type":"function","z":"2d7a2cc9.d285d4","name":"Send an event","func":"msg.payload = [{\n\t\"x_object\": {\"x_device_id\": context.global.mnubo.object1},\n\t\"x_event_type\": \"event_type_test\",\n\t\"x_timestamp\": \"2015-01-22T00:01:25-02:00\",\n\t\"x_latitude\": 57.876,\n\t\"x_longitude\": 57.876,\n\t\"temperature\": 25.6\n}];\nreturn msg;","outputs":1,"noerr":0,"x":276.11113357543945,"y":483.44441986083984,"wires":[["9f0aed7.f60f51"]]},{"id":"88f33cd9.770cc","type":"function","z":"2d7a2cc9.d285d4","name":"Count Events","func":"msg.payload = {\n\t\"from\": \"event\",\n\t\"select\": [{\n\t\t\"count\": \"*\"\n\t}]\n};\nreturn msg;","outputs":1,"noerr":0,"x":227.22222518920898,"y":660.1111354827881,"wires":[["30375974.cfc8a6"]]},{"id":"8c56464e.73a9b8","type":"function","z":"2d7a2cc9.d285d4","name":"Update owner","func":"msg.payload = [ \n  context.global.mnubo.owner1, \n  { \n\t\"x_registration_latitude\": 45.223, \n\t\"x_registration_longitude\": 73.234 \n  }\n];\nreturn msg;","outputs":1,"noerr":0,"x":289.44443130493164,"y":245.6666488647461,"wires":[["2d1551a5.d2eaae"]]},{"id":"f6a1d851.095e28","type":"function","z":"2d7a2cc9.d285d4","name":"Update Object","func":"msg.payload = [\n    context.global.mnubo.object1, \n{ \n\t\"x_object_type\": \"test2\" \n}\n];\nreturn msg;\n","outputs":1,"noerr":0,"x":286.11111068725586,"y":406.7777976989746,"wires":[["bc053e9.f43fac"]]},{"id":"25c970e1.da369","type":"function","z":"2d7a2cc9.d285d4","name":"Send an Event FROM the object","func":"msg.payload = [\n    context.global.mnubo.object1, \n    [{\n\t\"x_event_type\": \"event_type_test\",\n\t\"x_timestamp\": \"2015-01-22T00:01:25-02:00\",\n\t\"x_latitude\": 57.876,\n\t\"x_longitude\": 57.876,\n\t\"temperature\": 15.2\n    }]\n];\n\nreturn msg;","outputs":1,"noerr":0,"x":254.33331298828125,"y":540.7777709960938,"wires":[["f45df5fa.0ba208"]]},{"id":"7638564f.89c7a8","type":"function","z":"2d7a2cc9.d285d4","name":"set global env","func":"var mnubo = new Object();\nmnubo.owner1 = \"[email protected]\"\nmnubo.object1 = \"node-red-device-auto1\"\n\n//Global context share by all functions\ncontext.global.mnubo = mnubo\n\nreturn msg;","outputs":1,"noerr":0,"x":327,"y":116,"wires":[["2be4304.fd41bd"]]},{"id":"26751614.d98aea","type":"function","z":"2d7a2cc9.d285d4","name":"delete owner1","func":"msg.payload = context.global.mnubo.owner1\nreturn msg;","outputs":1,"noerr":0,"x":267,"y":848,"wires":[["dedbc5dd.212438"]]},{"id":"a4cc7ee4.5b338","type":"function","z":"2d7a2cc9.d285d4","name":"delete owner1","func":"msg.payload = context.global.mnubo.object1\nreturn msg;","outputs":1,"noerr":0,"x":265,"y":769,"wires":[["888d985f.777268"]]},{"id":"a23c57f8.5dc3a8","type":"inject","z":"2d7a2cc9.d285d4","name":"","topic":"","payload":"","payloadType":"none","repeat":"","crontab":"","once":false,"x":88,"y":169,"wires":[["2be4304.fd41bd"]]}]

### Example 2: Different Flows

[{"id":"51a21e74.9d361","type":"tab","label":"Authentication"},{"id":"f162410e.c0f12","type":"tab","label":"Owner"},{"id":"2b9467b0.2cd798","type":"tab","label":"Objects"},{"id":"a7b4344d.d11288","type":"tab","label":"Events"},{"id":"22e60087.24c84","type":"subflow","name":"Subflow 1","info":"","in":[],"out":[]},{"id":"1e40e060.81c07","type":"subflow","name":"Subflow 2","info":"","in":[{"x":50,"y":30,"wires":[]}],"out":[]},{"id":"34891ac9.e13ec6","type":"mnubo config","z":"","name":"Third Parties Integrations","env":"sandbox","proxy_url":""},{"id":"6e2a268b.68b048","type":"mqtt-broker","z":"","broker":"","port":"1883","tls":"","clientid":"","usetls":true,"compatmode":true,"keepalive":"60","cleansession":true,"willTopic":"","willQos":"0","willPayload":"","birthTopic":"","birthQos":"0","birthPayload":""},{"id":"6696699c.aa4a48","type":"mnubo auth","z":"51a21e74.9d361","name":"Get Token","mnuboconfig":"34891ac9.e13ec6","x":146.5,"y":182,"wires":[["e593c94d.9ecdb8"]]},{"id":"c803117d.e0f79","type":"function","z":"51a21e74.9d361","name":"set global env","func":"var mnubo1 = {};\nmnubo1.owner = \"[email protected]\";\nmnubo1.object = \"node-red-device-auto1\";\n\nvar mnubo2 = {};\nmnubo2.owner = \"[email protected]\";\nmnubo2.object = \"node-red-device-auto2\";\n\nvar mnubo3 = {};\nmnubo3.owner = \"[email protected]\";\nmnubo3.object = \"node-red-device-auto3\";\n\nvar mnubo4 = {};\nmnubo4.owner = \"[email protected]\";\nmnubo4.object = \"node-red-device-auto4\";\n\nvar mnubo5 = {};\nmnubo5.owner = \"[email protected]\";\nmnubo5.object = \"node-red-device-auto5\";\n\nvar mnubo6 = {};\nmnubo6.owner = \"[email protected]\";\nmnubo6.object = \"node-red-device-auto6\";\n\n//Global context share by all functions\ncontext.global.mnubo1 = mnubo1;\ncontext.global.mnubo2 = mnubo2;\ncontext.global.mnubo3 = mnubo3;\ncontext.global.mnubo4 = mnubo4;\ncontext.global.mnubo5 = mnubo5;\ncontext.global.mnubo6 = mnubo6;\ncontext.global.bulk = false;\n\nreturn msg;","outputs":1,"noerr":0,"x":516.25,"y":251.75,"wires":[["bac7ab21.925598"]]},{"id":"e593c94d.9ecdb8","type":"switch","z":"51a21e74.9d361","name":"Token != Bearer","property":"errors","propertyType":"msg","rules":[{"t":"nnull"},{"t":"null"}],"checkall":"true","outputs":2,"x":320,"y":182,"wires":[["873d56a6.924cf8"],["c803117d.e0f79"]]},{"id":"873d56a6.924cf8","type":"debug","z":"51a21e74.9d361","name":"Error","active":true,"console":"false","complete":"errors","x":501,"y":160,"wires":[]},{"id":"e3c9c57b.969948","type":"inject","z":"51a21e74.9d361","name":"Start Here","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"x":147.38889122009277,"y":249.33333778381348,"wires":[["c803117d.e0f79"]]},{"id":"48cb2833.b95ac8","type":"function","z":"f162410e.c0f12","name":"Single Creation","func":"msg.payload = context.global.mnubo1.owner;\nreturn msg;","outputs":1,"noerr":0,"x":155,"y":99,"wires":[["e6997e27.6a37e"]]},{"id":"e6997e27.6a37e","type":"mnubo owners","z":"f162410e.c0f12","name":"Exists","mnuboconfig":"34891ac9.e13ec6","functionselection":"exists","inputtext":"owner-1","x":335.7222499847412,"y":135.44445419311523,"wires":[["89134be3.14ba28"]]},{"id":"89134be3.14ba28","type":"function","z":"f162410e.c0f12","name":"Exists?","func":"var payload = msg.payload;\nvar owner_to_create = null;\nvar existing_owner = [];\nvar msg_2 = null;\n\nif (Array.isArray(payload)){ // Multiple Owners\n owner_to_create = [];\n payload.forEach((el, index) => {\n Object.keys(el).forEach((key) => {\n if (! payload[index][key]) { \n owner_to_create.push(\n {\n 'username': key,\n 'x_password': \"MnuboDummyPassword\",\n 'x_registration_date': new Date().toISOString()\n \n });\n } else {\n existing_owner.push(key);\n }\n });\n });\n \n} else if (typeof(payload) == \"object\") { // Single Owner\n Object.keys(payload).forEach((key) => {\n if (! payload[key]) {\n owner_to_create = {\n 'username': key,\n 'x_password': \"MnuboDummyPassword\"\n };\n } else {\n existing_owner.push(key);\n }\n });\n} else {\n msg.debug = \"Invalid Input\";\n}\n\nif (owner_to_create) {\n if (Array.isArray(owner_to_create)) {\n if (owner_to_create.length === 0) {\n msg = null;\n } else if (owner_to_create.length === 1) {\n msg.payload = owner_to_create[0];\n } else {\n msg.payload = owner_to_create;\n }\n } else {\n msg.payload = owner_to_create;\n }\n} else {\n msg = null;\n}\n\nif (existing_owner.length > 0) {\n msg_2 = {'payload': existing_owner};\n}\nreturn [msg, msg_2];","outputs":"2","noerr":0,"x":463.94446563720703,"y":136.11110496520996,"wires":[["a613e45.a09b418"],["9da72d09.e6b3e","af3d8306.6c855"]]},{"id":"a613e45.a09b418","type":"mnubo owners","z":"f162410e.c0f12","name":"Create","mnuboconfig":"34891ac9.e13ec6","functionselection":"create","inputtext":"[\n {\"username\": \"mnubo5.owner\",\n \"x_password\": \"MnuboDummyPassword\"\n },\n {\"username\": \"mnubo6.owner\",\n \"x_password\": \"MnuboDummyPassword\",\n \"gender\": \"male\"\n }]","x":642.777759552002,"y":102.66666030883789,"wires":[["e8b8be9b.ccfbe"]]},{"id":"bac7ab21.925598","type":"link out","z":"51a21e74.9d361","name":"Go to Owner","links":["9506184d.e0c458"],"x":637.5,"y":252,"wires":[]},{"id":"9506184d.e0c458","type":"link in","z":"f162410e.c0f12","name":"Owner Entry Point","links":["bac7ab21.925598"],"x":20,"y":20,"wires":[["48cb2833.b95ac8"]]},{"id":"5d3cac32.d29d64","type":"comment","z":"f162410e.c0f12","name":"Single Creation","info":"","x":85,"y":66.2222204208374,"wires":[]},{"id":"16a9c6ec.5056f9","type":"mnubo owners","z":"f162410e.c0f12","name":"Delete","mnuboconfig":"34891ac9.e13ec6","functionselection":"delete","inputtext":"[email protected]","x":367.44441986083984,"y":1142.472225189209,"wires":[["caaf2b4.93db7d8"]]},{"id":"d2a08c2b.bf946","type":"comment","z":"f162410e.c0f12","name":"Bulk Creation","info":"","x":75,"y":137.7777862548828,"wires":[]},{"id":"2ce2c1a2.459b6e","type":"comment","z":"f162410e.c0f12","name":"Single Update","info":"","x":75,"y":276,"wires":[]},{"id":"abc7b9f6.943818","type":"comment","z":"f162410e.c0f12","name":"Bulk Update","info":"","x":75,"y":350,"wires":[]},{"id":"ba904b14.4b67f8","type":"comment","z":"f162410e.c0f12","name":"Delete","info":"","x":58.5,"y":1025,"wires":[]},{"id":"73b275d4.86a4bc","type":"function","z":"f162410e.c0f12","name":"Bulk Creation (Ok)","func":"msg.payload = [context.global.mnubo2.owner, context.global.mnubo3.owner];\n\nreturn msg;","outputs":1,"noerr":0,"x":161.5,"y":174.3333225250244,"wires":[["e6997e27.6a37e"]]},{"id":"57695cfc.7baed4","type":"function","z":"f162410e.c0f12","name":"Loop Ctrl","func":"if (context.global.owner_to_delete.length > 0){\n msg.payload = context.global.owner_to_delete.pop();\n} else {\n return null;\n}\n\nreturn msg;","outputs":"1","noerr":0,"x":498.33340072631836,"y":1066.1944742202759,"wires":[["16a9c6ec.5056f9"]]},{"id":"361ec686.1d52ea","type":"debug","z":"f162410e.c0f12","name":"OK","active":true,"console":"false","complete":"payload","x":936.8888549804688,"y":140.22222900390625,"wires":[]},{"id":"2bce7e19.207582","type":"debug","z":"f162410e.c0f12","name":"Error","active":true,"console":"false","complete":"errors","x":1039.8888549804688,"y":52.22222137451172,"wires":[]},{"id":"2630dfbc.0e565","type":"debug","z":"f162410e.c0f12","name":"OK","active":true,"console":"false","complete":"payload","x":815.5554485321045,"y":1160.2222061157227,"wires":[]},{"id":"5718ae6f.cee42","type":"debug","z":"f162410e.c0f12","name":"Error","active":true,"console":"false","complete":"errors","x":814.5554485321045,"y":1122.2222061157227,"wires":[]},{"id":"caaf2b4.93db7d8","type":"switch","z":"f162410e.c0f12","name":"errors is not null","property":"errors","propertyType":"msg","rules":[{"t":"nnull"},{"t":"null"}],"checkall":"true","outputs":2,"x":571.22216796875,"y":1143.6666259765625,"wires":[["5718ae6f.cee42","57695cfc.7baed4"],["2630dfbc.0e565","57695cfc.7baed4"]]},{"id":"9da72d09.e6b3e","type":"debug","z":"f162410e.c0f12","name":" Owner Exists","active":true,"console":"false","complete":"payload","x":635.8333333333333,"y":169.99999999999997,"wires":[]},{"id":"586b455b.39834c","type":"function","z":"f162410e.c0f12","name":"Multiple Owners","func":"context.global.owner_to_delete = [\n context.global.mnubo1.owner, context.global.mnubo2.owner,\n context.global.mnubo3.owner, context.global.mnubo4.owner,\n context.global.mnubo5.owner, context.global.mnubo6.owner];\n\nreturn msg;","outputs":1,"noerr":0,"x":253.3333396911621,"y":1068.000036239624,"wires":[["57695cfc.7baed4"]]},{"id":"e7db8fce.20516","type":"inject","z":"f162410e.c0f12","name":"Start Here","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"x":90.83332824707031,"y":1068.000060081482,"wires":[["586b455b.39834c"]]},{"id":"30fb4fd.7a048b","type":"link out","z":"f162410e.c0f12","name":"Onwer - Ok (Creation)","links":["4a175a27.a9ca24"],"x":901.5,"y":141,"wires":[]},{"id":"4a175a27.a9ca24","type":"link in","z":"f162410e.c0f12","name":"Onwer - Bulk Creation (Ok)","links":["30fb4fd.7a048b"],"x":87,"y":173,"wires":[["73b275d4.86a4bc"]]},{"id":"30c93cba.206bf4","type":"function","z":"f162410e.c0f12","name":"Single Update","func":"msg = {};\ncontext.global.bulk = false;\n\nmsg.payload = [context.global.mnubo1.owner, {\n \"age\": 21\n}\n];\nreturn msg;","outputs":1,"noerr":0,"x":159.5,"y":312,"wires":[["91acf832.abf858"]]},{"id":"497d3bbd.f44b14","type":"function","z":"f162410e.c0f12","name":"Bulk Update (Ok)","func":"msg = {};\n\nmsg.payload = [\n {\n \"username\": context.global.mnubo4.owner,\n 'x_password': \"MnuboDummyPassword\",\n \"age\": 52\n },\n {\n \"username\": context.global.mnubo5.owner,\n \"age\": 29\n },\n {\n \"username\": context.global.mnubo6.owner,\n 'x_password': \"MnuboDummyPassword\",\n \"age\": 35\n }\n];\nreturn msg;\n","outputs":1,"noerr":0,"x":155.5,"y":429,"wires":[["91acf832.abf858"]]},{"id":"af3d8306.6c855","type":"link out","z":"f162410e.c0f12","name":"Onwer - Owner Exitst","links":["1a35708c.879d4f"],"x":581.5,"y":170,"wires":[]},{"id":"91acf832.abf858","type":"mnubo owners","z":"f162410e.c0f12","name":"Update","mnuboconfig":"34891ac9.e13ec6","functionselection":"update","inputtext":"","x":396.5,"y":348,"wires":[["7c3d360e.169728"]]},{"id":"4cfe6a91.06a314","type":"function","z":"f162410e.c0f12","name":"Bulk Creation (Multi Status)","func":"msg.payload = [\n {'username': context.global.mnubo4.owner,\n },\n {'username': context.global.mnubo5.owner,\n 'x_password': \"MnuboDummyPassword\"\n },\n {'username': context.global.mnubo6.owner,\n 'x_password': \"MnuboDummyPassword\",\n 'gender': \"male\"\n }];\n\nreturn msg;","outputs":1,"noerr":0,"x":446,"y":58,"wires":[["a613e45.a09b418"]]},{"id":"1a35708c.879d4f","type":"link in","z":"f162410e.c0f12","name":"Onwer - Bulk Creation (Multi Status)","links":["af3d8306.6c855"],"x":341,"y":58,"wires":[["4cfe6a91.06a314"]]},{"id":"5e142430.5d05ac","type":"debug","z":"f162410e.c0f12","name":"Multi Status","active":true,"console":"false","complete":"errors","x":1057.5,"y":88,"wires":[]},{"id":"bf28004c.f5db7","type":"debug","z":"f162410e.c0f12","name":"OK","active":true,"console":"false","complete":"payload","x":866,"y":383,"wires":[]},{"id":"162cc5bd.7add8a","type":"debug","z":"f162410e.c0f12","name":"Error","active":true,"console":"false","complete":"errors","x":1010,"y":309,"wires":[]},{"id":"a2cb5d17.09109","type":"link out","z":"f162410e.c0f12","name":"Onwer - Ok (Update)","links":["2afabaa5.4c7286"],"x":831.6111450195312,"y":383.77777099609375,"wires":[]},{"id":"8a13b1fe.48623","type":"debug","z":"f162410e.c0f12","name":"Multi Status","active":true,"console":"false","complete":"errors","x":1028.6111450195312,"y":346.77777099609375,"wires":[]},{"id":"cf22dc76.8b5e2","type":"link out","z":"f162410e.c0f12","name":"Onwer - Multiple Status (Update)","links":["332ce85d.cbba78"],"x":971.611083984375,"y":345.77777099609375,"wires":[]},{"id":"332ce85d.cbba78","type":"link in","z":"f162410e.c0f12","name":"Onwer - Bulk Update (Ok)","links":["cf22dc76.8b5e2"],"x":81.5,"y":430,"wires":[["497d3bbd.f44b14"]]},{"id":"67db4617.f96c38","type":"function","z":"f162410e.c0f12","name":"Bulk Update (Multiple Status)","func":"if (context.global.bulk < 1) {\n msg.payload = [{\n \"username\": context.global.mnubo2.owner,\n \"gender\": \"male\"\n },\n {\n \"username\": context.global.mnubo3.owner,\n \"age\": 35\n },\n {\n \"username\": context.global.mnubo4.owner,\n \"gender\": \"male\"\n }\n ];\n return msg;\n} else {return null;}","outputs":1,"noerr":0,"x":125,"y":389,"wires":[["91acf832.abf858"]]},{"id":"2afabaa5.4c7286","type":"link in","z":"f162410e.c0f12","name":"Onwer - Bulk Update (Multiple Status)","links":["a2cb5d17.09109"],"x":20,"y":390,"wires":[["67db4617.f96c38"]]},{"id":"14274512.f09ffb","type":"comment","z":"f162410e.c0f12","name":"Single Claim","info":"","x":76.5,"y":515,"wires":[]},{"id":"30cfb70b.953a48","type":"comment","z":"f162410e.c0f12","name":"Bulk Claim","info":"","x":65,"y":597,"wires":[]},{"id":"f1331b5a.5940c8","type":"function","z":"f162410e.c0f12","name":"Single Claim","func":"msg = {};\ncontext.global.bulk = false;\n\nmsg.payload = [context.global.mnubo1.owner, context.global.mnubo1.object ];\n\nreturn msg;","outputs":1,"noerr":0,"x":114.5,"y":551,"wires":[["6493034a.89703c"]]},{"id":"ca6e2777.1f2ab8","type":"function","z":"f162410e.c0f12","name":"Batch Claim (Multiple Status)","func":"msg.payload = [\n {\n \"x_device_id\": context.global.mnubo2.object,\n \"username\": context.global.mnubo2.owner,\n \"x_timestamp\": new Date().toISOString()\n },\n {\n \"x_device_id\": context.global.mnubo3.object,\n \"username\": \"not_existing_owner-3\"\n },\n {\n \"x_device_id\": context.global.mnubo4.object,\n \"username\": \"not_existing_owner-4\",\n }\n];\nreturn msg;","outputs":1,"noerr":0,"x":139,"y":635,"wires":[["6493034a.89703c"]]},{"id":"6493034a.89703c","type":"mnubo owners","z":"f162410e.c0f12","name":"Claim","mnuboconfig":"34891ac9.e13ec6","functionselection":"claim","inputtext":"","x":373.5,"y":572,"wires":[["be9c249e.624168"]]},{"id":"566072b.bbbbd8c","type":"function","z":"f162410e.c0f12","name":"Batch Claim (Ok)","func":"msg.payload = [\n {\n \"x_device_id\": context.global.mnubo3.object,\n \"username\": context.global.mnubo3.owner,\n \"x_timestamp\": new Date().toISOString()\n },\n {\n \"x_device_id\": context.global.mnubo4.object,\n \"username\": context.global.mnubo4.owner,\n \"x_timestamp\": new Date().toISOString()\n },\n {\n \"x_device_id\": context.global.mnubo5.object,\n \"username\": context.global.mnubo5.owner,\n \"x_timestamp\": new Date().toISOString()\n },\n {\n \"x_device_id\": context.global.mnubo6.object,\n \"username\": context.global.mnubo6.owner,\n \"x_timestamp\": new Date().toISOString()\n }\n];\nreturn msg;","outputs":1,"noerr":0,"x":109,"y":683,"wires":[["6493034a.89703c"]]},{"id":"f854ea5a.25dcb8","type":"debug","z":"f162410e.c0f12","name":"OK","active":true,"console":"false","complete":"payload","x":853.5,"y":606,"wires":[]},{"id":"6ee460fc.36221","type":"debug","z":"f162410e.c0f12","name":"Multi Status","active":true,"console":"false","complete":"errors","x":1049,"y":565,"wires":[]},{"id":"10da1505.0ad9bb","type":"debug","z":"f162410e.c0f12","name":"Error","active":true,"console":"false","complete":"errors","x":1031,"y":526,"wires":[]},{"id":"1bbee309.c0b34d","type":"link out","z":"f162410e.c0f12","name":"Onwer - Multiple Status (Claim)","links":["c0d780ee.eb1c8"],"x":993.5,"y":566,"wires":[]},{"id":"a9f8448d.19d028","type":"link out","z":"f162410e.c0f12","name":"Onwer - Ok (Claim)","links":["e0448ae2.458678"],"x":819.5,"y":606,"wires":[]},{"id":"e0448ae2.458678","type":"link in","z":"f162410e.c0f12","name":"Onwer - Bulk Claim (Multiple Status)","links":["a9f8448d.19d028"],"x":35.5,"y":636,"wires":[["ca6e2777.1f2ab8"]]},{"id":"c0d780ee.eb1c8","type":"link in","z":"f162410e.c0f12","name":"Onwer - Bulk Claim (Ok)","links":["1bbee309.c0b34d"],"x":32.5,"y":683,"wires":[["566072b.bbbbd8c"]]},{"id":"f15cdd1b.72823","type":"comment","z":"f162410e.c0f12","name":"Single unClaim","info":"","x":86.5,"y":772,"wires":[]},{"id":"6c220e59.45878","type":"comment","z":"f162410e.c0f12","name":"Bulk unClaim","info":"","x":75,"y":854,"wires":[]},{"id":"d78924b3.916d58","type":"function","z":"f162410e.c0f12","name":"Single unClaim","func":"msg = {};\ncontext.global.bulk = false;\nmsg.payload = [context.global.mnubo1.owner, context.global.mnubo1.object ];\n\nreturn msg;","outputs":1,"noerr":0,"x":124.5,"y":808,"wires":[["b9015787.cda658"]]},{"id":"cf665cc2.68856","type":"function","z":"f162410e.c0f12","name":"Batch unClaim (Multiple Status)","func":"msg.payload = [\n {\n \"x_device_id\": context.global.mnubo2.object,\n \"username\": context.global.mnubo2.owner,\n \"x_timestamp\": new Date().toISOString()\n },\n {\n \"x_device_id\": context.global.mnubo3.object,\n \"username\": \"not_existing_owner-3\"\n },\n {\n \"x_device_id\": context.global.mnubo4.object,\n \"username\": \"not_existing_owner-4\",\n \"x_timestamp\": new Date().toISOString()\n }\n];\nreturn msg;","outputs":1,"noerr":0,"x":149,"y":892,"wires":[["b9015787.cda658"]]},{"id":"b9015787.cda658","type":"mnubo owners","z":"f162410e.c0f12","name":"unClaim","mnuboconfig":"34891ac9.e13ec6","functionselection":"unclaim","inputtext":"","x":383.5,"y":829,"wires":[["863aafc8.09f5e"]]},{"id":"9f3fa263.9ecf9","type":"function","z":"f162410e.c0f12","name":"Batch unClaim (Ok)","func":"msg.payload = [\n {\n \"x_device_id\": context.global.mnubo3.object,\n \"username\": context.global.mnubo3.owner,\n \"x_timestamp\": new Date().toISOString()\n },\n {\n \"x_device_id\": context.global.mnubo4.object,\n \"username\": context.global.mnubo4.owner,\n \"x_timestamp\": new Date().toISOString()\n },\n {\n \"x_device_id\": context.global.mnubo5.object,\n \"username\": context.global.mnubo5.owner\n },\n {\n \"x_device_id\": context.global.mnubo6.object,\n \"username\": context.global.mnubo6.owner\n }\n];\nreturn msg;","outputs":1,"noerr":0,"x":109,"y":940,"wires":[["b9015787.cda658"]]},{"id":"f48f1fd7.ae8a","type":"debug","z":"f162410e.c0f12","name":"OK","active":true,"console":"false","complete":"payload","x":845.5,"y":863,"wires":[]},{"id":"d0aeaf0d.a0d08","type":"debug","z":"f162410e.c0f12","name":"Multi Status","active":true,"console":"false","complete":"true","x":1039,"y":809,"wires":[]},{"id":"ebf52c28.00eb1","type":"debug","z":"f162410e.c0f12","name":"Error","active":true,"console":"false","complete":"errors","x":1021,"y":770,"wires":[]},{"id":"4e050f61.5c894","type":"link out","z":"f162410e.c0f12","name":"Onwer - Multiple Status (unClaim)","links":["68e6814c.a018b"],"x":982.5,"y":810,"wires":[]},{"id":"dabd510d.20a24","type":"link out","z":"f162410e.c0f12","name":"Onwer - Ok (unClaim)","links":["f90d9b1d.c9c768"],"x":809.5,"y":863,"wires":[]},{"id":"f90d9b1d.c9c768","type":"link in","z":"f162410e.c0f12","name":"Onwer - Bulk unClaim (Multiple Status)","links":["dabd510d.20a24"],"x":35.5,"y":893,"wires":[["cf665cc2.68856"]]},{"id":"68e6814c.a018b","type":"link in","z":"f162410e.c0f12","name":"Onwer - Bulk unClaim (Ok)","links":["4e050f61.5c894"],"x":32.5,"y":940,"wires":[["9f3fa263.9ecf9"]]},{"id":"dfa1e9d4.c23838","type":"link in","z":"2b9467b0.2cd798","name":"Object - From Owner","links":["1b6eb215.88092e"],"x":26.5,"y":26,"wires":[["f3a4bfc7.46157"]]},{"id":"f3a4bfc7.46157","type":"function","z":"2b9467b0.2cd798","name":"Single Creation","func":"msg.payload = context.global.mnubo1.object;\nreturn msg;","outputs":1,"noerr":0,"x":168.3333282470703,"y":103.33332824707031,"wires":[["8f57fb9f.f447c8"]]},{"id":"7fbc1275.4e253c","type":"function","z":"2b9467b0.2cd798","name":"Exists?","func":"var payload = msg.payload;\nvar object_to_create = null;\nvar existing_object = [];\nvar msg_2 = null;\n\nif (Array.isArray(payload)){ // Multiple Objects\n object_to_create = [];\n payload.forEach((el, index) => {\n Object.keys(el).forEach((key) => {\n if (! payload[index][key]) { \n object_to_create.push(\n {\n 'x_device_id': key,\n 'x_object_type': 'car',\n 'x_registration_date': new Date().toISOString(), \n 'x_registration_latitude': -34.586547,\n\t 'x_registration_longitude': -58.398396,\n 'brand': \"BMW\"\n \n });\n } else {\n existing_object.push(key);\n }\n });\n });\n \n} else if (typeof(payload) == \"object\") { // Single Object\n Object.keys(payload).forEach((key) => {\n if (! payload[key]) {\n object_to_create = {\n 'x_device_id': key,\n 'x_object_type': 'car',\n 'x_registration_date': new Date().toISOString(),\n 'x_registration_latitude': -34.586547,\n\t 'x_registration_longitude': -58.398396,\n 'brand': \"AUDI\"\n };\n } else {\n existing_object.push(key);\n }\n });\n} else {\n msg.debug = \"Invalid Input\";\n}\n\nif (object_to_create) {\n if (Array.isArray(object_to_create)) {\n if (object_to_create.length === 0) {\n msg = null;\n } else if (object_to_create.length === 1) {\n msg.payload = object_to_create[0];\n } else {\n msg.payload = object_to_create;\n }\n } else {\n msg.payload = object_to_create;\n }\n} else {\n msg = null;\n}\n\nif (existing_object.length > 0) {\n msg_2 = {'payload': existing_object};\n}\nreturn [msg, msg_2];","outputs":"2","noerr":0,"x":477.27779388427734,"y":140.44443321228027,"wires":[["db4e3cd0.4f08b"],["e9fb9795.b9c7f8","1629f25.7741f0e"]]},{"id":"23e25ad0.8a3966","type":"comment","z":"2b9467b0.2cd798","name":"Single Creation","info":"","x":98.33332824707031,"y":70.55554866790771,"wires":[]},{"id":"98ba76e6.560558","type":"comment","z":"2b9467b0.2cd798","name":"Bulk Creation","info":"","x":88.33332824707031,"y":142.11111450195312,"wires":[]},{"id":"8810e76b.549258","type":"comment","z":"2b9467b0.2cd798","name":"Single Update","info":"","x":88.33332824707031,"y":280.3333282470703,"wires":[]},{"id":"48dd9d34.cd54a4","type":"comment","z":"2b9467b0.2cd798","name":"Bulk Update","info":"","x":88.33332824707031,"y":354.3333282470703,"wires":[]},{"id":"46ec2718.7abfe8","type":"comment","z":"2b9467b0.2cd798","name":"Delete","info":"","x":90.83332824707031,"y":523.3333129882812,"wires":[]},{"id":"8fe11f1a.3a2f1","type":"function","z":"2b9467b0.2cd798","name":"Bulk Creation (Ok)","func":"msg.payload = [context.global.mnubo2.object, context.global.mnubo3.object];\n\nreturn msg;","outputs":1,"noerr":0,"x":157.8333282470703,"y":177.66665649414062,"wires":[["8f57fb9f.f447c8"]]},{"id":"cd220726.ebc7f8","type":"function","z":"2b9467b0.2cd798","name":"Loop Ctrl","func":"if (context.global.objects_to_delete.length > 0){\n msg.payload = context.global.objects_to_delete.pop();\n} else {\n return null;\n}\n\nreturn msg;","outputs":"1","noerr":0,"x":467.66674423217773,"y":581.5277261734009,"wires":[["3bca37d5.ee2488"]]},{"id":"e9fb9795.b9c7f8","type":"debug","z":"2b9467b0.2cd798","name":" Object Exists","active":true,"console":"false","complete":"payload","x":649.1666615804036,"y":174.3333282470703,"wires":[]},{"id":"8730c4b9.537078","type":"function","z":"2b9467b0.2cd798","name":"Multiple Objects","func":"context.global.objects_to_delete = [\n context.global.mnubo1.object, context.global.mnubo2.object,\n context.global.mnubo3.object, context.global.mnubo4.object,\n context.global.mnubo5.object, context.global.mnubo6.object];\n\nreturn msg;","outputs":1,"noerr":0,"x":265.66668701171875,"y":582.333251953125,"wires":[["cd220726.ebc7f8"]]},{"id":"1224ed.bcb96b13","type":"link in","z":"2b9467b0.2cd798","name":"Object - Bulk Creation (Ok)","links":["eff417b8.d55148","651f2102.446d4","cff1fc31.7bde5","6401ce0.a00f234"],"x":83.33332824707031,"y":176.3333339691162,"wires":[["8fe11f1a.3a2f1"]]},{"id":"bffafea6.a0735","type":"function","z":"2b9467b0.2cd798","name":"Single Update","func":"msg = {};\ncontext.global.bulk = false;\nmsg.payload = [context.global.mnubo1.object, {\n 'color': 'red'\n}\n];\nreturn msg;","outputs":1,"noerr":0,"x":161.8333282470703,"y":315.3333282470703,"wires":[["59774402.f1279c"]]},{"id":"23516731.2cac58","type":"function","z":"2b9467b0.2cd798","name":"Bulk Update (Ok)","func":"msg = {};\n\nmsg.payload = [\n {\n 'x_device_id': context.global.mnubo4.object,\n 'x_object_type': \"car\",\n 'x_registration_date': new Date().toISOString(),\n 'x_registration_latitude': -34.586547,\n \t'x_registration_longitude': -58.398396,\n 'brand': 'BMW',\n 'color': 'white'\n },\n {\n 'x_device_id': context.global.mnubo5.object,\n 'color': 'black'\n },\n {\n 'x_device_id': context.global.mnubo6.object,\n 'x_object_type': \"car\",\n 'x_registration_date': new Date().toISOString(),\n 'x_registration_latitude': -34.586547,\n \t'x_registration_longitude': -58.398396,\n 'brand': 'Mercedes-Benz',\n 'color': 'black'\n }\n];\nreturn msg;\n","outputs":1,"noerr":0,"x":168.8333282470703,"y":433.3333282470703,"wires":[["59774402.f1279c"]]},{"id":"1629f25.7741f0e","type":"link out","z":"2b9467b0.2cd798","name":"Object - Owner Exitst","links":["2e6904b9.c7766c"],"x":594.8333282470703,"y":174.3333282470703,"wires":[]},{"id":"f7d1ae4.408115","type":"function","z":"2b9467b0.2cd798","name":"Bulk Creation (Multi Status)","func":"msg.payload = [\n {'x_device_id': context.global.mnubo4.object,\n 'x_registration_date': new Date().toISOString(),\n 'x_registration_latitude': -34.586547,\n\t'x_registration_longitude': -58.398396,\n 'brand': 'Toyota',\n },\n {'x_device_id': context.global.mnubo5.object,\n 'x_object_type': \"car\",\n 'x_registration_date': new Date().toISOString(),\n 'x_owner': {\n\t\t'username': context.global.mnubo5.owner\n\t},\n\t'x_registration_latitude': -34.586547,\n\t'x_registration_longitude': -58.398396,\n 'brand': 'Toyota'\n },\n {'x_device_id': context.global.mnubo6.object,\n 'x_object_type': \"car\",\n 'x_registration_date': new Date().toISOString(),\n 'x_registration_latitude': -34.586547,\n\t'x_registration_longitude': -58.398396,\n 'brand': 'Toyota',\n 'year': \"2017\"\n }];\n\nreturn msg;","outputs":1,"noerr":0,"x":459.3333282470703,"y":62.33332824707031,"wires":[["db4e3cd0.4f08b"]]},{"id":"2e6904b9.c7766c","type":"link in","z":"2b9467b0.2cd798","name":"Object - Bulk Creation (Multi Status)","links":["1629f25.7741f0e"],"x":354.3333282470703,"y":62.33332824707031,"wires":[["f7d1ae4.408115"]]},{"id":"dc3da496.bb40d8","type":"link in","z":"2b9467b0.2cd798","name":"Object - Bulk Update (Ok)","links":["4583a9b6.3014e8","4167fcd4.3ef524"],"x":94.83332824707031,"y":434.3333282470703,"wires":[["23516731.2cac58"]]},{"id":"4bfb7c92.649354","type":"function","z":"2b9467b0.2cd798","name":"Bulk Update (Multiple Status)","func":"if (context.global.bulk < 1) {\n msg.payload = [{\n 'x_device_id': context.global.mnubo2.object,\n 'color': 'white'\n },\n {\n 'x_device_id': context.global.mnubo3.object,\n 'year': '2019'\n },\n {\n 'x_device_id': context.global.mnubo4.object,\n 'color': 'white',\n 'year': '2019'\n }\n ];\n return msg;\n} else {return null;}","outputs":1,"noerr":0,"x":138.3333282470703,"y":393.3333282470703,"wires":[["59774402.f1279c"]]},{"id":"bc8ab598.56bd28","type":"link in","z":"2b9467b0.2cd798","name":"Object - Bulk Update (Multiple Status)","links":["7d1d8fcc.564e2","142c3181.ca562e"],"x":33.33332824707031,"y":394.3333282470703,"wires":[["4bfb7c92.649354"]]},{"id":"59774402.f1279c","type":"mnubo objects","z":"2b9467b0.2cd798","name":"Update","mnuboconfig":"34891ac9.e13ec6","functionselection":"update","inputtext":"","x":397.5,"y":361,"wires":[["a808fece.25b3"]]},{"id":"8f57fb9f.f447c8","type":"mnubo objects","z":"2b9467b0.2cd798","name":"Exists","mnuboconfig":"34891ac9.e13ec6","functionselection":"exists","inputtext":"","x":338,"y":141,"wires":[["7fbc1275.4e253c"]]},{"id":"db4e3cd0.4f08b","type":"mnubo objects","z":"2b9467b0.2cd798","name":"Create","mnuboconfig":"34891ac9.e13ec6","functionselection":"create","inputtext":"","x":660,"y":109,"wires":[["55df8895.ce2a18"]]},{"id":"3bca37d5.ee2488","type":"mnubo objects","z":"2b9467b0.2cd798","name":"Delete","mnuboconfig":"34891ac9.e13ec6","functionselection":"delete","inputtext":"","x":363.00001525878906,"y":658.9999847412109,"wires":[["97defc74.b6e62"]]},{"id":"923b322.42e8bd","type":"link in","z":"f162410e.c0f12","name":"Onwer - Single Claim","links":["e8e5f2c3.94499","e3e522b1.aef7d","87c791f2.e3fdc"],"x":60.5,"y":550,"wires":[["f1331b5a.5940c8"]]},{"id":"a59ff6c4.c0f188","type":"link in","z":"a7b4344d.d11288","name":"Events - From Owner","links":["69d2946a.b9e82c"],"x":37.5,"y":24,"wires":[["9e408c17.a6c3b"]]},{"id":"e37c056.82f15f8","type":"mnubo events","z":"a7b4344d.d11288","name":"Default","mnuboconfig":"34891ac9.e13ec6","functionselection":"send","inputtext":"","reportResults":false,"objectsMustExist":false,"x":563,"y":108,"wires":[["bc24e104.70849"]]},{"id":"c64c098f.2f2458","type":"comment","z":"a7b4344d.d11288","name":"EVENT","info":"","x":150,"y":60,"wires":[]},{"id":"f1088d9e.bdd94","type":"comment","z":"a7b4344d.d11288","name":"EVENT FROM DEVICE","info":"","x":139,"y":509.99999237060547,"wires":[]},{"id":"9e408c17.a6c3b","type":"function","z":"a7b4344d.d11288","name":"Bulk Events (Multiple Status)","func":"msg.payload = [\n {\n \"x_object\": {\"x_device_id\": context.global.mnubo1.object },\n \"x_event_type\": \"measurement\",\n \"x_timestamp\": new Date().toISOString(),\n \"speed\": 25.1\n },\n {\n \"x_object\": {\"x_device_id\": context.global.mnubo2.object },\n \"x_event_type\": \"measurement\",\n \"x_timestamp\": new Date().toISOString(),\n \"speed\": 19.1\n },\n {\n \"x_object\": {\"x_device_id\": context.global.mnubo3.object },\n \"x_event_type\": \"measurement\",\n \"x_timestamp\": new Date().toISOString(),\n \"speed\": false\n },\n {\n \"x_object\": {\"x_device_id\": \"non-existing-device\" },\n \"x_event_type\": \"measurement\",\n \"x_timestamp\": new Date().toISOString(),\n \"speed\": 103.2\n }\n];\nreturn msg;","outputs":1,"noerr":0,"x":182.5,"y":110,"wires":[["e37c056.82f15f8","13af1367.4db23d","824e5c24.be4cd","76a52c30.77f0f4"]]},{"id":"9616b567.7035b8","type":"function","z":"a7b4344d.d11288","name":"Bulk Events (OK)","func":"msg.payload = [\n {\n \"x_object\": {\"x_device_id\": context.global.mnubo4.object },\n \"x_event_type\": \"measurement\",\n \"x_timestamp\": new Date().toISOString(),\n \"speed\": 55\n },\n {\n \"x_object\": {\"x_device_id\": context.global.mnubo5.object },\n \"x_event_type\": \"measurement\",\n \"x_timestamp\": new Date().toISOString(),\n \"speed\": 45.1\n },\n{\n \"x_object\": {\"x_device_id\": context.global.mnubo6.object },\n \"x_event_type\": \"measurement\",\n \"x_timestamp\": new Date().toISOString(),\n \"speed\": 80.6\n }\n]\nreturn msg;","outputs":1,"noerr":0,"x":180,"y":350,"wires":[["e37c056.82f15f8","13af1367.4db23d","824e5c24.be4cd","76a52c30.77f0f4"]]},{"id":"74233da2.5a7584","type":"mnubo events","z":"a7b4344d.d11288","name":"Objects Must Exist","mnuboconfig":"34891ac9.e13ec6","functionselection":"send","inputtext":"","reportResults":false,"objectsMustExist":true,"x":592,"y":195,"wires":[["b41a3da2.492f5"]]},{"id":"d185cb99.d1b6c8","type":"mnubo events","z":"a7b4344d.d11288","name":"Report Results ","mnuboconfig":"34891ac9.e13ec6","functionselection":"send","inputtext":"","reportResults":true,"objectsMustExist":false,"x":583,"y":274,"wires":[["eb13d8a9.6cd478"]]},{"id":"b36a77d2.8f7608","type":"mnubo events","z":"a7b4344d.d11288","name":"Both Flags On","mnuboconfig":"34891ac9.e13ec6","functionselection":"send","inputtext":"","reportResults":true,"objectsMustExist":true,"x":585,"y":356,"wires":[["c2876d00.8fbc"]]},{"id":"197273b4.44e85c","type":"inject","z":"a7b4344d.d11288","name":"","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"x":98.5,"y":162,"wires":[["9e408c17.a6c3b"]]},{"id":"13af1367.4db23d","type":"delay","z":"a7b4344d.d11288","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":394.5,"y":195,"wires":[["74233da2.5a7584"]]},{"id":"824e5c24.be4cd","type":"delay","z":"a7b4344d.d11288","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":394,"y":276,"wires":[["d185cb99.d1b6c8"]]},{"id":"76a52c30.77f0f4","type":"delay","z":"a7b4344d.d11288","name":"","pauseType":"delay","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":396,"y":355,"wires":[["b36a77d2.8f7608"]]},{"id":"6d5245a8.08ee2c","type":"link in","z":"a7b4344d.d11288","name":"Events - Bulk (Ok)","links":["d335c483.22bf78","13e45897.a95487"],"x":103.5,"y":350,"wires":[["9616b567.7035b8"]]},{"id":"656ba0d5.7f23f","type":"link in","z":"a7b4344d.d11288","name":"Events From Device - Bulk (Multiple Status)","links":["e3f9ed19.76c24","3b66eb74.b0ea04"],"x":49,"y":570.9999923706055,"wires":[["f4b083a7.4337d"]]},{"id":"61d306d0.b764c8","type":"mnubo events","z":"a7b4344d.d11288","name":"Default","mnuboconfig":"34891ac9.e13ec6","functionselection":"sendfromdevice","inputtext":"","reportResults":false,"objectsMustExist":false,"x":569,"y":568.9999923706055,"wires":[["2d4bbeb8.a70212"]]},{"id":"f4b083a7.4337d","type":"function","z":"a7b4344d.d11288","name":"Bulk Events (Multiple Status)","func":"msg.payload = [\"non-existing-device\", [\n {\n \"x_event_type\": \"measurement\",\n \"x_timestamp\": new Date().toISOString(),\n \"speed\": 25.1\n },\n {\n \"x_event_type\": \"measurement\",\n \"x_timestamp\": new Date().toISOString(),\n \"temperature\": 19.1\n },\n {\n \"x_event_type\": \"measurement\",\n \"x_timestamp\": new Date().toISOString(),\n \"speed\": false\n },\n {\n \"x_event_type\": \"measurement\",\n \"x_timestamp\": new Date().toISOString(),\n \"speed\": 103.2\n }]\n];\n\nreturn msg;","outputs":1,"noerr":0,"x":188.5,"y":570.9999923706055,"wires":[["61d306d0.b764c8","2fba7f46.f4f43","78d77fd7.43eb3","28988c3d.903864"]]},{"id":"164d6e96.3c0881","type":"function","z":"a7b4344d.d11288","name":"Bulk Events (OK)","func":"msg.payload = [context.global.mnubo6.object, [\n {\n \"x_event_type\": \"measurement\",\n \"x_timestamp\": new Date().toISOString(),\n \"speed\": 25.1\n },\n {\n \"x_event_type\": \"measurement\",\n \"x_timestamp\": new Date().toISOString(),\n \"speed\": 19.1\n },\n {\n \"x_event_type\": \"measurement\",\n \"x_timestamp\": new Date().toISOString(),\n \"speed\": 105.3\n },\n {\n \"x_event_type\": \"measurement\",\n \"x_timestamp\": new Date().toISOString(),\n \"speed\": 103.2\n }]\n];\nreturn msg;","outputs":1,"noerr":0,"x":182,"y":789.9999923706055,"wires":[["61d306d0.b764c8","2fba7f46.f4f43","78d77fd7.43eb3","28988c3d.903864"]]},{"id":"d3c25c76.2d612","type":"mnubo events","z":"a7b4344d.d11288","name":"Objects Must Exist","mnuboconfig":"34891ac9.e13ec6","functionselection":"sendfromdevice","inputtext":"","reportResults":false,"objectsMustExist":true,"x":598,"y":638.9999923706055,"wires":[["db4e5be.4245fa8"]]},{"id":"943b97b4.131558","type":"mnubo events","z":"a7b4344d.d11288","name":"Report Results ","mnuboconfig":"34891ac9.e13ec6","functionselection":"sendfromdevice","inputtext":"","reportResults":true,"objectsMustExist":false,"x":589,"y":710.9999923706055,"wires":[["1351c55e.44356b"]]},{"id":"e8b3b58f.a30af8","type":"mnubo events","z":"a7b4344d.d11288","name":"Both Flags On","mnuboconfig":"34891ac9.e13ec6","functionselection":"sendfromdevice","inputtext":"","reportResults":true,"objectsMustExist":true,"x":590,"y":783.9999923706055,"wires":[["52c79f17.9ae0e"]]},{"id":"2fba7f46.f4f43","type":"delay","z":"a7b4344d.d11288","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":400.5,"y":638.9999923706055,"wires":[["d3c25c76.2d612"]]},{"id":"78d77fd7.43eb3","type":"delay","z":"a7b4344d.d11288","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":400,"y":712.9999923706055,"wires":[["943b97b4.131558"]]},{"id":"28988c3d.903864","type":"delay","z":"a7b4344d.d11288","name":"","pauseType":"delay","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":401,"y":782.9999923706055,"wires":[["e8b3b58f.a30af8"]]},{"id":"801e3103.020b8","type":"link in","z":"a7b4344d.d11288","name":"Events From Device - Bulk (Ok)","links":["2c8dc133.730e1e","25a7d6ab.83b42a"],"x":105.5,"y":789.9999923706055,"wires":[["164d6e96.3c0881"]]},{"id":"abeb2c06.f9a99","type":"link in","z":"f162410e.c0f12","name":"Onwer - Single unClaim","links":["49acceb3.f41af"],"x":56.5,"y":808,"wires":[["d78924b3.916d58"]]},{"id":"176d6065.4de3f","type":"link in","z":"2b9467b0.2cd798","name":"Object - DELETE Multiple Object","links":["8aa1c3bc.0209a"],"x":200.50001525878906,"y":583,"wires":[["8730c4b9.537078"]]},{"id":"9c3dd9f0.15b128","type":"inject","z":"2b9467b0.2cd798","name":"Start Here","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"x":90.16665649414062,"y":582.3333129882812,"wires":[["8730c4b9.537078"]]},{"id":"5819c89b.a4cd08","type":"mnubo analytics","z":"a7b4344d.d11288","name":"Seach Query","mnuboconfig":"34891ac9.e13ec6","searchtype":"SearchQuery","inputquery":"","x":593,"y":934,"wires":[["e7f70c28.ec0bf"]]},{"id":"5953fc20.e22954","type":"debug","z":"a7b4344d.d11288","name":"Error","active":true,"console":"false","complete":"errorMessage","x":1055,"y":908,"wires":[]},{"id":"553c00df.ceae7","type":"debug","z":"a7b4344d.d11288","name":"OK","active":true,"console":"false","complete":"payload.rows[0]","x":1055,"y":940,"wires":[]},{"id":"e7f70c28.ec0bf","type":"switch","z":"a7b4344d.d11288","name":"errorCode is not null","property":"errors","propertyType":"msg","rules":[{"t":"nnull"},{"t":"null"}],"checkall":"true","outputs":2,"x":840,"y":929,"wires":[["5953fc20.e22954"],["553c00df.ceae7"]]},{"id":"41e5a8dd.14fbf8","type":"function","z":"a7b4344d.d11288","name":"Count Events","func":"msg.payload = {\n\t\"from\": \"event\",\n\t\"select\": [{\n\t\t\"count\": \"*\"\n\t}]\n};\nreturn msg;","outputs":1,"noerr":0,"x":362.222225189209,"y":933.1111354827881,"wires":[["5819c89b.a4cd08"]]},{"id":"a3688846.ec8018","type":"comment","z":"a7b4344d.d11288","name":"SEARCH","info":"","x":128,"y":895,"wires":[]},{"id":"5cea71b4.5e821","type":"link in","z":"a7b4344d.d11288","name":"Event - Count Events","links":["a0bef771.947928","f80dbfe.0467f4"],"x":144.5,"y":951,"wires":[["41e5a8dd.14fbf8","4e3fa98.02c9958","538a0009.3dea1"]]},{"id":"b9522d44.5181e","type":"inject","z":"a7b4344d.d11288","name":"Start Here","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"x":111.5,"y":996,"wires":[["41e5a8dd.14fbf8","4e3fa98.02c9958","538a0009.3dea1"]]},{"id":"ab91644.7f07998","type":"mnubo analytics","z":"a7b4344d.d11288","name":"Get DataModel","mnuboconfig":"34891ac9.e13ec6","searchtype":"getDatamodel","inputquery":"","x":605,"y":1000,"wires":[["53db2c9.7fc63d4"]]},{"id":"bac28e94.37f43","type":"mnubo analytics","z":"a7b4344d.d11288","name":"Get Dataset","mnuboconfig":"34891ac9.e13ec6","searchtype":"getDatasets","inputquery":"","x":598,"y":1068,"wires":[["fe8a6e28.6c5d"]]},{"id":"edc3427b.24cc8","type":"debug","z":"a7b4344d.d11288","name":"Error","active":true,"console":"false","complete":"errorMessage","x":1058,"y":978,"wires":[]},{"id":"d6234989.a65708","type":"debug","z":"a7b4344d.d11288","name":"OK","active":true,"console":"false","complete":"payload","x":1058,"y":1010,"wires":[]},{"id":"53db2c9.7fc63d4","type":"switch","z":"a7b4344d.d11288","name":"errorCode is not null","property":"errors","propertyType":"msg","rules":[{"t":"nnull"},{"t":"null"}],"checkall":"true","outputs":2,"x":843,"y":999,"wires":[["edc3427b.24cc8"],["d6234989.a65708"]]},{"id":"3a20da2f.a4c3a6","type":"debug","z":"a7b4344d.d11288","name":"Error","active":true,"console":"false","complete":"errorMessage","x":1059,"y":1047,"wires":[]},{"id":"8ee7c8d0.f24fd8","type":"debug","z":"a7b4344d.d11288","name":"OK","active":true,"console":"false","complete":"payload","x":1059,"y":1079,"wires":[]},{"id":"fe8a6e28.6c5d","type":"switch","z":"a7b4344d.d11288","name":"errorCode is not null","property":"errors","propertyType":"msg","rules":[{"t":"nnull"},{"t":"null"}],"checkall":"true","outputs":2,"x":844,"y":1068,"wires":[["3a20da2f.a4c3a6"],["8ee7c8d0.f24fd8","49acceb3.f41af"]]},{"id":"4e3fa98.02c9958","type":"delay","z":"a7b4344d.d11288","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":366,"y":997,"wires":[["ab91644.7f07998"]]},{"id":"538a0009.3dea1","type":"delay","z":"a7b4344d.d11288","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":364,"y":1068,"wires":[["bac28e94.37f43"]]},{"id":"49acceb3.f41af","type":"link out","z":"a7b4344d.d11288","name":"Search - Ok (Get Dataset)","links":["abeb2c06.f9a99"],"x":1021.5,"y":1079,"wires":[]},{"id":"e8b8be9b.ccfbe","type":"switch","z":"f162410e.c0f12","name":"","property":"errors","propertyType":"msg","rules":[{"t":"nnull"},{"t":"null"}],"checkall":"true","outputs":2,"x":783.5,"y":103,"wires":[["5963b57b.16858c"],["361ec686.1d52ea","30fb4fd.7a048b"]]},{"id":"e59bc427.cda3f8","type":"inject","z":"f162410e.c0f12","name":"Start Here","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"x":117.5,"y":28,"wires":[["48cb2833.b95ac8"]]},{"id":"5963b57b.16858c","type":"switch","z":"f162410e.c0f12","name":"","property":"errors.length","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"gt","v":"1","vt":"str"}],"checkall":"true","outputs":2,"x":915.5,"y":64,"wires":[["2bce7e19.207582"],["5e142430.5d05ac","24afbf1f.16563"]]},{"id":"b18da1b7.1712d","type":"inject","z":"f162410e.c0f12","name":"Start Here","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"x":98,"y":229,"wires":[["30c93cba.206bf4"]]},{"id":"7c3d360e.169728","type":"switch","z":"f162410e.c0f12","name":"","property":"errors","propertyType":"msg","rules":[{"t":"nnull"},{"t":"null"}],"checkall":"true","outputs":2,"x":552,"y":349,"wires":[["e6015ebe.01b55"],["909a3b0c.6eaf78"]]},{"id":"e6015ebe.01b55","type":"switch","z":"f162410e.c0f12","name":"","property":"errors.length","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"gt","v":"1","vt":"str"}],"checkall":"true","outputs":2,"x":686,"y":343,"wires":[["162cc5bd.7add8a"],["c1cbfce6.62f03"]]},{"id":"909a3b0c.6eaf78","type":"switch","z":"f162410e.c0f12","name":"","property":"bulk","propertyType":"global","rules":[{"t":"false"},{"t":"true"}],"checkall":"true","outputs":2,"x":688.5,"y":381,"wires":[["bf28004c.f5db7","a2cb5d17.09109"],["fa3a5bac.a106c8","e591928d.24f81"]]},{"id":"c1cbfce6.62f03","type":"function","z":"f162410e.c0f12","name":"'bulk' = true","func":"context.global.bulk = true;\nreturn msg;","outputs":1,"noerr":0,"x":847.5,"y":347,"wires":[["cf22dc76.8b5e2","8a13b1fe.48623"]]},{"id":"be9c249e.624168","type":"switch","z":"f162410e.c0f12","name":"","property":"errors","propertyType":"msg","rules":[{"t":"nnull"},{"t":"null"}],"checkall":"true","outputs":2,"x":533,"y":574,"wires":[["c59b19f9.5b6748"],["211b3db6.b59122"]]},{"id":"c59b19f9.5b6748","type":"switch","z":"f162410e.c0f12","name":"","property":"errors.length","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"gt","v":"1","vt":"str"}],"checkall":"true","outputs":2,"x":667,"y":568,"wires":[["10da1505.0ad9bb"],["aad5de72.28c98"]]},{"id":"211b3db6.b59122","type":"switch","z":"f162410e.c0f12","name":"","property":"bulk","propertyType":"global","rules":[{"t":"false"},{"t":"true"}],"checkall":"true","outputs":2,"x":669.5,"y":606,"wires":[["a9f8448d.19d028","f854ea5a.25dcb8"],["aa4591b5.ff02e","f49ed58f.637ef8"]]},{"id":"aad5de72.28c98","type":"function","z":"f162410e.c0f12","name":"'bulk' = true","func":"context.global.bulk = true;\nreturn msg;","outputs":1,"noerr":0,"x":828.5,"y":572,"wires":[["1bbee309.c0b34d","6ee460fc.36221"]]},{"id":"863aafc8.09f5e","type":"switch","z":"f162410e.c0f12","name":"","property":"errors","propertyType":"msg","rules":[{"t":"nnull"},{"t":"null"}],"checkall":"true","outputs":2,"x":527,"y":828,"wires":[["4c3b80d6.9257a"],["22f1d347.06b01c"]]},{"id":"4c3b80d6.9257a","type":"switch","z":"f162410e.c0f12","name":"","property":"errors.length","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"gt","v":"1","vt":"str"}],"checkall":"true","outputs":2,"x":661,"y":822,"wires":[["ebf52c28.00eb1"],["dec71bf3.653e68"]]},{"id":"22f1d347.06b01c","type":"switch","z":"f162410e.c0f12","name":"","property":"bulk","propertyType":"global","rules":[{"t":"false"},{"t":"true"}],"checkall":"true","outputs":2,"x":663.5,"y":860,"wires":[["dabd510d.20a24","f48f1fd7.ae8a"],["586b455b.39834c","c387e0ed.5ff17","c03aeec0.85691"]]},{"id":"dec71bf3.653e68","type":"function","z":"f162410e.c0f12","name":"'bulk' = true","func":"context.global.bulk = true;\nreturn msg;","outputs":1,"noerr":0,"x":822.5,"y":826,"wires":[["4e050f61.5c894","d0aeaf0d.a0d08"]]},{"id":"55df8895.ce2a18","type":"switch","z":"2b9467b0.2cd798","name":"","property":"errors","propertyType":"msg","rules":[{"t":"nnull"},{"t":"null"}],"checkall":"true","outputs":2,"x":786,"y":110,"wires":[["38cceefe.e1e6c2"],["23ecfde6.6a8a32","6401ce0.a00f234"]]},{"id":"38cceefe.e1e6c2","type":"switch","z":"2b9467b0.2cd798","name":"","property":"errors.length","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"gt","v":"1","vt":"str"}],"checkall":"true","outputs":2,"x":918,"y":71,"wires":[["73fc3ce1.c5a2b4"],["abe43937.0640a8","572e5766.f6e438"]]},{"id":"73fc3ce1.c5a2b4","type":"debug","z":"2b9467b0.2cd798","name":"Error","active":true,"console":"false","complete":"errors","x":1042.3888549804688,"y":59.22222137451172,"wires":[]},{"id":"abe43937.0640a8","type":"debug","z":"2b9467b0.2cd798","name":"Multi Status","active":true,"console":"false","complete":"errors","x":1060,"y":95,"wires":[]},{"id":"23ecfde6.6a8a32","type":"debug","z":"2b9467b0.2cd798","name":"OK","active":true,"console":"false","complete":"payload","x":939.3888549804688,"y":147.22222900390625,"wires":[]},{"id":"6401ce0.a00f234","type":"link out","z":"2b9467b0.2cd798","name":"Object - Ok (Creation)","links":["1224ed.bcb96b13"],"x":904,"y":147,"wires":[]},{"id":"3415cc17.d5c954","type":"inject","z":"2b9467b0.2cd798","name":"Start Here","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"x":135,"y":28,"wires":[["f3a4bfc7.46157"]]},{"id":"3d0f9467.4b08dc","type":"link in","z":"f162410e.c0f12","name":"Onwer - Single Update","links":["24afbf1f.16563"],"x":95.5,"y":312,"wires":[["30c93cba.206bf4"]]},{"id":"24afbf1f.16563","type":"link out","z":"f162410e.c0f12","name":"Onwer - Multiple Status (Create)","links":["3d0f9467.4b08dc"],"x":1003.5,"y":88,"wires":[]},{"id":"572e5766.f6e438","type":"link out","z":"2b9467b0.2cd798","name":"Object - Multiple Status (Create)","links":["b41c3d7.913b5c"],"x":1006,"y":95,"wires":[]},{"id":"b41c3d7.913b5c","type":"link in","z":"2b9467b0.2cd798","name":"Object - Single Update","links":["572e5766.f6e438"],"x":44,"y":310,"wires":[["bffafea6.a0735"]]},{"id":"75437ce2.570d64","type":"debug","z":"2b9467b0.2cd798","name":"OK","active":true,"console

Node Info

Version: 1.3.1
Updated 1 month ago
License: MIT

Downloads

22 in the last day
127 in the last week
507 in the last month

Nodes

  • mnubo config
  • mnubo auth
  • mnubo analytics
  • mnubo owners
  • mnubo objects
  • mnubo events

Keywords

  • node-red
  • mnubo
  • api
  • sdk
  • javascript
  • typescript
  • iot
  • smartobject

Maintainers

  • daddykotex
  • jtheoof
  • jerome.langlais