1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00
node-red/packages/node_modules/@node-red/nodes/examples/sequence/join/02 - Manual join mode.json
2020-06-24 14:43:27 +01:00

1 line
14 KiB
JSON

[{"id":"7bf47d74.b233b4","type":"comment","z":"65391466.6687ec","name":"Example: Manual Mode","info":"Join node can be used to join payload of messages into single message payload. In manual mode, it can uses number of messages, duration of time, or `msg.complete` property to decide sequence of messages to join. The data format of the join result can also be selected.","x":140,"y":40,"wires":[]},{"id":"7f104f68.aecff","type":"inject","z":"65391466.6687ec","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":200,"y":160,"wires":[["ed0381d3.e25fc"]]},{"id":"ed0381d3.e25fc","type":"template","z":"65391466.6687ec","name":"data","field":"payload","fieldType":"msg","format":"text","syntax":"plain","template":"Apple\nOrange\nBanana\nKiwi","output":"str","x":350,"y":160,"wires":[["12b322b7.78f48d"]]},{"id":"a4f5546e.28b268","type":"join","z":"65391466.6687ec","name":"","mode":"custom","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":",","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":630,"y":160,"wires":[["e3e636ab.5c5068"]]},{"id":"12b322b7.78f48d","type":"split","z":"65391466.6687ec","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":490,"y":160,"wires":[["a4f5546e.28b268"]]},{"id":"e3e636ab.5c5068","type":"debug","z":"65391466.6687ec","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":790,"y":160,"wires":[]},{"id":"6a104137.204b3","type":"comment","z":"65391466.6687ec","name":"Join two consecutive messages into single message","info":"","x":270,"y":100,"wires":[]},{"id":"d91412a1.eb2fa","type":"comment","z":"65391466.6687ec","name":"↑ split input text data into messages","info":"","x":580,"y":200,"wires":[]},{"id":"db100cd0.4cfdd","type":"comment","z":"65391466.6687ec","name":"↓ manually join message sequence by ','","info":"","x":740,"y":120,"wires":[]},{"id":"d873311b.ab6f8","type":"inject","z":"65391466.6687ec","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":200,"y":320,"wires":[["854ae07c.1b88f"]]},{"id":"854ae07c.1b88f","type":"template","z":"65391466.6687ec","name":"data","field":"payload","fieldType":"msg","format":"text","syntax":"plain","template":"Apple\nOrange\nBanana\nKiwi","output":"str","x":350,"y":320,"wires":[["4da6db2a.a610f4"]]},{"id":"5c158c02.fcd224","type":"join","z":"65391466.6687ec","name":"","mode":"custom","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":",","joinerType":"str","accumulate":false,"timeout":"2","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":790,"y":320,"wires":[["659414e8.e901fc"]]},{"id":"4da6db2a.a610f4","type":"split","z":"65391466.6687ec","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":490,"y":320,"wires":[["8e4f1c67.cdac4"]]},{"id":"659414e8.e901fc","type":"debug","z":"65391466.6687ec","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":950,"y":320,"wires":[]},{"id":"c002f9d0.a04128","type":"comment","z":"65391466.6687ec","name":"Join messages received within specified time range into single message","info":"","x":330,"y":260,"wires":[]},{"id":"3b62f93e.ad2af6","type":"comment","z":"65391466.6687ec","name":"↑ split input text data into messages","info":"","x":580,"y":360,"wires":[]},{"id":"db741240.4d6a1","type":"comment","z":"65391466.6687ec","name":"↓ manually join message received withn 2 secs","info":"","x":920,"y":280,"wires":[]},{"id":"8e4f1c67.cdac4","type":"delay","z":"65391466.6687ec","name":"","pauseType":"rate","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":650,"y":320,"wires":[["5c158c02.fcd224"]]},{"id":"53363c0f.836454","type":"inject","z":"65391466.6687ec","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":200,"y":500,"wires":[["33d9801f.5edc6"]]},{"id":"33d9801f.5edc6","type":"template","z":"65391466.6687ec","name":"data","field":"payload","fieldType":"msg","format":"text","syntax":"plain","template":"Apple\nOrange\nBanana\nKiwi","output":"str","x":350,"y":500,"wires":[["46fb1122.a49b"]]},{"id":"e5d7310a.8ba39","type":"join","z":"65391466.6687ec","name":"","mode":"custom","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":",","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":850,"y":500,"wires":[["d1a98ee5.3a55"]]},{"id":"46fb1122.a49b","type":"split","z":"65391466.6687ec","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":490,"y":500,"wires":[["f32b7544.10b328"]]},{"id":"d1a98ee5.3a55","type":"debug","z":"65391466.6687ec","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1010,"y":500,"wires":[]},{"id":"48f547c0.063278","type":"comment","z":"65391466.6687ec","name":"Join messages into single message using msg.complete","info":"","x":290,"y":420,"wires":[]},{"id":"8106b831.3374e8","type":"comment","z":"65391466.6687ec","name":"↑ split input text data into messages","info":"","x":580,"y":540,"wires":[]},{"id":"373877fe.60a0d8","type":"comment","z":"65391466.6687ec","name":"↓ manually join message sequence by msg.complete","info":"","x":1000,"y":460,"wires":[]},{"id":"f32b7544.10b328","type":"function","z":"65391466.6687ec","name":"set msg.complete","func":"var payload = msg.payload;\nif ((payload === \"Banana\") || (payload === \"Kiwi\")) {\n msg.complete = true;\n}\nreturn msg;","outputs":1,"noerr":0,"x":670,"y":500,"wires":[["e5d7310a.8ba39"]]},{"id":"90140dad.9cbd9","type":"comment","z":"65391466.6687ec","name":"↓ set msg.complete for Banana and Kiwi","info":"","x":740,"y":420,"wires":[]},{"id":"ead0afb6.a4763","type":"inject","z":"65391466.6687ec","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":200,"y":660,"wires":[["175c6d3f.b71893"]]},{"id":"175c6d3f.b71893","type":"template","z":"65391466.6687ec","name":"data","field":"payload","fieldType":"msg","format":"text","syntax":"plain","template":"Apple\nOrange\nBanana\nKiwi","output":"str","x":350,"y":660,"wires":[["3a873d4a.fcc3a2"]]},{"id":"88c0baeb.0f4c88","type":"join","z":"65391466.6687ec","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":",","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":630,"y":660,"wires":[["758b3990.2442c8"]]},{"id":"3a873d4a.fcc3a2","type":"split","z":"65391466.6687ec","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":490,"y":660,"wires":[["88c0baeb.0f4c88"]]},{"id":"758b3990.2442c8","type":"debug","z":"65391466.6687ec","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":790,"y":660,"wires":[]},{"id":"9b1551a8.97d09","type":"comment","z":"65391466.6687ec","name":"Join two consecutive messages into single message of array","info":"","x":300,"y":600,"wires":[]},{"id":"655d7318.217b3c","type":"comment","z":"65391466.6687ec","name":"↑ split input text data into messages","info":"","x":580,"y":700,"wires":[]},{"id":"66cdfd.5cba2204","type":"comment","z":"65391466.6687ec","name":"↓ manually join message sequence to array","info":"","x":740,"y":620,"wires":[]},{"id":"be206cc6.f8141","type":"inject","z":"65391466.6687ec","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":200,"y":880,"wires":[["af8f52e6.e3d2f"]]},{"id":"af8f52e6.e3d2f","type":"template","z":"65391466.6687ec","name":"data","field":"payload","fieldType":"msg","format":"text","syntax":"plain","template":"name,price\nApple,100\nOrange,20\nBanana,80\nKiwi,120","output":"str","x":350,"y":880,"wires":[["89a32ebe.a92f1"]]},{"id":"681800f4.06545","type":"join","z":"65391466.6687ec","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":",","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":830,"y":880,"wires":[["8442c86.2559838"]]},{"id":"8442c86.2559838","type":"debug","z":"65391466.6687ec","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":990,"y":880,"wires":[]},{"id":"d15e01f7.d0a1f","type":"comment","z":"65391466.6687ec","name":"Merge two consecutive messages into single message of object using topic & payload ","info":"","x":380,"y":760,"wires":[]},{"id":"cccc022b.dfbbc","type":"comment","z":"65391466.6687ec","name":"↑ split input csv data into messages","info":"","x":580,"y":920,"wires":[]},{"id":"65aef8f1.143ca8","type":"comment","z":"65391466.6687ec","name":"↓ manually join message sequence to object","info":"","x":950,"y":840,"wires":[]},{"id":"89a32ebe.a92f1","type":"csv","z":"65391466.6687ec","name":"","sep":",","hdrin":true,"hdrout":"","multi":"one","ret":"\\n","temp":"","skip":"0","strings":true,"include_empty_strings":"","include_null_values":"","x":480,"y":880,"wires":[["39fd09fc.b87e66"]]},{"id":"39fd09fc.b87e66","type":"change","z":"65391466.6687ec","name":"set topic & payload","rules":[{"t":"set","p":"topic","pt":"msg","to":"payload.name","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"payload.price","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":650,"y":880,"wires":[["681800f4.06545"]]},{"id":"3fe71363.c5c67c","type":"comment","z":"65391466.6687ec","name":"↓ set topic (key) & payload (value)","info":"","x":690,"y":800,"wires":[]},{"id":"3f482b62.8ec0f4","type":"inject","z":"65391466.6687ec","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":200,"y":1060,"wires":[["63acc875.0d1458"]]},{"id":"63acc875.0d1458","type":"template","z":"65391466.6687ec","name":"data","field":"payload","fieldType":"msg","format":"json","syntax":"plain","template":"[\n { \"name\": \"Apple\" },\n { \"price\": 100 },\n { \"name\": \"Orange\"},\n { \"price\": 20 },\n { \"name\": \"Banana\"},\n { \"price\": 80 },\n { \"name\": \"Kiwi\"},\n { \"price\": 120 }\n]","output":"json","x":350,"y":1060,"wires":[["71aa03f2.69c42c"]]},{"id":"82b9afbd.380bd","type":"join","z":"65391466.6687ec","name":"","mode":"custom","build":"merged","property":"payload","propertyType":"msg","key":"topic","joiner":",","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":630,"y":1060,"wires":[["df61f87d.0a7c38"]]},{"id":"df61f87d.0a7c38","type":"debug","z":"65391466.6687ec","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":790,"y":1060,"wires":[]},{"id":"cff7cd24.8f70a","type":"comment","z":"65391466.6687ec","name":"Merge two consecutive messages into single message of object","info":"","x":310,"y":980,"wires":[]},{"id":"c8b4d7b0.7d2048","type":"comment","z":"65391466.6687ec","name":"↑ split array of objects data into messages","info":"","x":600,"y":1100,"wires":[]},{"id":"5f07dcb1.2a8384","type":"comment","z":"65391466.6687ec","name":"↓ manually merge message sequence to object","info":"","x":760,"y":1020,"wires":[]},{"id":"71aa03f2.69c42c","type":"split","z":"65391466.6687ec","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":490,"y":1060,"wires":[["82b9afbd.380bd"]]},{"id":"dcbdbc0e.44c81","type":"inject","z":"65391466.6687ec","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":200,"y":1240,"wires":[["df188870.193ec8"]]},{"id":"df188870.193ec8","type":"template","z":"65391466.6687ec","name":"data","field":"payload","fieldType":"msg","format":"json","syntax":"plain","template":"[\n { \"name\": \"Apple\" },\n { \"price\": 100 },\n { \"order\": 5 },\n { \"order\": 1 },\n { \"order\": 20 }\n]","output":"json","x":350,"y":1240,"wires":[["61df0de9.80aaa4"]]},{"id":"77072ce9.cd2ba4","type":"join","z":"65391466.6687ec","name":"","mode":"custom","build":"merged","property":"payload","propertyType":"msg","key":"topic","joiner":",","joinerType":"str","accumulate":true,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":630,"y":1240,"wires":[["de78c2ec.efec3"]]},{"id":"de78c2ec.efec3","type":"debug","z":"65391466.6687ec","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":790,"y":1240,"wires":[]},{"id":"f2b6aab7.9f69c8","type":"comment","z":"65391466.6687ec","name":"Merge two consecutive messages and following messages into single message of object","info":"","x":390,"y":1160,"wires":[]},{"id":"bf058927.d8e8b8","type":"comment","z":"65391466.6687ec","name":"↑ split array of objects data into messages","info":"","x":600,"y":1280,"wires":[]},{"id":"2aab8acf.0673c6","type":"comment","z":"65391466.6687ec","name":"↓ manually merge message sequence to object","info":"","x":760,"y":1200,"wires":[]},{"id":"61df0de9.80aaa4","type":"split","z":"65391466.6687ec","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":490,"y":1240,"wires":[["77072ce9.cd2ba4"]]}]