@gregoriusrippenstein/erlang-red-unittest 0.20.2 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (354) hide show
  1. package/README.md +4 -2
  2. package/examples/.core/support JS hash naming in variable access.json +1 -0
  3. package/examples/.elixir/support basic module code.json +1 -0
  4. package/examples/.jsonata/$privdir operator.json +1 -0
  5. package/examples/.jsonata/$replace should be working for newlines.json +1 -0
  6. package/examples/.jsonata/$type operator.json +1 -0
  7. package/examples/.jsonata/ensure that $millis() works.json +1 -0
  8. package/examples/.jsonata/non-string key names.json +1 -0
  9. package/examples/.jsonata/split function.json +1 -0
  10. package/examples/.jsonata/support array definition.json +1 -0
  11. package/examples/batch/basic behaviour.json +1 -0
  12. package/examples/binary/initial test.json +1 -0
  13. package/examples/binary/parse PNG image data.json +1 -0
  14. package/examples/captureio/Capture io from function node.json +1 -0
  15. package/examples/captureio/Mutliple captures.json +1 -0
  16. package/examples/captureio/capture io from gen_server behaviour.json +1 -0
  17. package/examples/captureio/collect io from event handlers.json +1 -0
  18. package/examples/captureio/collect io from state machine node.json +1 -0
  19. package/examples/catch/catch all exceptions in a single group.json +1 -0
  20. package/examples/catch/catch all in group except those handler elsewhere.json +1 -0
  21. package/examples/catch/deal with it yourself.json +1 -0
  22. package/examples/catch/don't catch if the node isn't selected.json +1 -0
  23. package/examples/change/debug message if no catch node.json +1 -0
  24. package/examples/change/set functionality.json +1 -0
  25. package/examples/change/support buffer type.json +1 -0
  26. package/examples/change/support num types.json +1 -0
  27. package/examples/change/support underscores in binary, hex & octal values.json +1 -0
  28. package/examples/clientcode/Client code node test.json +1 -0
  29. package/examples/complete/avoid endless recursion.json +1 -0
  30. package/examples/complete/avoid recursion - test case 2.json +1 -0
  31. package/examples/complete/its complete nodes all the way down.json +1 -0
  32. package/examples/complete/split node.json +1 -0
  33. package/examples/complete/when is a join complete.json +1 -0
  34. package/examples/csv-decode/comma separated, parse numbers & msg per row.json +1 -0
  35. package/examples/csv-decode/separators other than comma.json +1 -0
  36. package/examples/csv-decode/single message for entire CSV, comma, RFC4180.json +1 -0
  37. package/examples/csv-decode/single message per line.json +1 -0
  38. package/examples/csv-decode/skip line happens before parsing content.json +1 -0
  39. package/examples/csv-encode/line termination and separator.json +1 -0
  40. package/examples/csv-encode/simple object.json +1 -0
  41. package/examples/debug/ensure debug messages are generated.json +1 -0
  42. package/examples/debug/handle largish json files as content.json +1 -0
  43. package/examples/debug/handling of Jsonata expressions.json +1 -0
  44. package/examples/debug/only debug specific property.json +1 -0
  45. package/examples/debug/status message counter.json +1 -0
  46. package/examples/debug/type hadling of JSONata reslults (ered).json +1 -0
  47. package/examples/debug/type hadling of JSONata reslults (node-red).json +1 -0
  48. package/examples/delay/delay messages by 5 seconds.json +1 -0
  49. package/examples/delay/delay multiple message for the same length of time.json +1 -0
  50. package/examples/delay/need to provide a status message of queue size.json +1 -0
  51. package/examples/eventhandler/handle kill exits.json +1 -0
  52. package/examples/eventhandler/handle normal exits.json +1 -0
  53. package/examples/eventhandler/multiple dynamic event handlers.json +1 -0
  54. package/examples/eventhandler/register and unregister handler.json +1 -0
  55. package/examples/eventhandler/static configuration.json +1 -0
  56. package/examples/eventhandler/static handler with arguments.json +1 -0
  57. package/examples/eventhandler/static handler: multiple instances.json +1 -0
  58. package/examples/eventhandler/used with a supervisor node.json +1 -0
  59. package/examples/exec/async with noisy command.json +1 -0
  60. package/examples/exec/empty commands are not supported.json +1 -0
  61. package/examples/exec/generate complete msg once command is done.json +1 -0
  62. package/examples/exec/handle multiple process at once.json +1 -0
  63. package/examples/exec/support timeout specification.json +1 -0
  64. package/examples/exec/synchronised execution.json +1 -0
  65. package/examples/file in/basic functionality of being able to read a file.json +1 -0
  66. package/examples/file in/error when file not found.json +1 -0
  67. package/examples/file in/warning if no file name is defined.json +1 -0
  68. package/examples/file in/will accept file name from msg obj.json +1 -0
  69. package/examples/filter/ignore initial value per topic.json +1 -0
  70. package/examples/filter/ignore initial value.json +1 -0
  71. package/examples/filter/post if value changed.json +1 -0
  72. package/examples/flowhubpull/retrieve flow id.json +1 -0
  73. package/examples/function/divide by zero throws kills node.json +1 -0
  74. package/examples/function/ensure /"on stop/" code is executed.json" +1 -0
  75. package/examples/function/function and module work together.json +1 -0
  76. package/examples/function/handle corrupt code.json +1 -0
  77. package/examples/function/return values are important.json +1 -0
  78. package/examples/function/set node context.json +1 -0
  79. package/examples/function/speaks Erlang.json +1 -0
  80. package/examples/function/supervisor interaction.json +1 -0
  81. package/examples/function/support multiple outputs.json +1 -0
  82. package/examples/function/support not returning a message.json +1 -0
  83. package/examples/function/support timeout setting.json +1 -0
  84. package/examples/function/supports completed node.json +1 -0
  85. package/examples/genserver/addressing modules.json +1 -0
  86. package/examples/genserver/triggering functionality.json +1 -0
  87. package/examples/http/Dynamic Routing.json +1 -0
  88. package/examples/http/POST & GET have different endpoints.json +1 -0
  89. package/examples/http/dynamic redirect.json +1 -0
  90. package/examples/http/have params in the path.json +1 -0
  91. package/examples/http/http static routing.json +1 -0
  92. package/examples/http/multiple endpoints don't all get the request.json +1 -0
  93. package/examples/http/nodes should be able to handle requests.json +1 -0
  94. package/examples/http/post requests - json content.json +1 -0
  95. package/examples/{f38603a59963386c/flows.json → http/request parses JSON conent.json } +1 -1
  96. package/examples/http/request, ensure url and method are handled.json +1 -0
  97. package/examples/http/set content type.json +1 -0
  98. package/examples/http/support query string on get request.json +1 -0
  99. package/examples/inject/repeat interval.json +1 -0
  100. package/examples/inject/support octal, binary & hex underscore values.json +1 -0
  101. package/examples/inject/trigger after - does not trigger.json +1 -0
  102. package/examples/inject/unsupported JSONata function.json +1 -0
  103. package/examples/join/manual config with count & nested property name.json +1 -0
  104. package/examples/json/parse example json content.json +1 -0
  105. package/examples/json/raise exception if content not valid.json +1 -0
  106. package/examples/json/support prettify json content.json +1 -0
  107. package/examples/link nodes/across flow tabs.json +1 -0
  108. package/examples/link nodes/cascading link calls.json +1 -0
  109. package/examples/markdown/allow for inline html.json +1 -0
  110. package/examples/markdown/convert markdown to html.json +1 -0
  111. package/examples/markdown/support code block.json +1 -0
  112. package/examples/module/Using with Statemachine.json +1 -0
  113. package/examples/module/Using with function node.json +1 -0
  114. package/examples/mqtt/auto-(re)connect.json +1 -0
  115. package/examples/noop/Noop node will error out.json +1 -0
  116. package/examples/process/Can send messages.json +1 -0
  117. package/examples/range/basic examples.json +1 -0
  118. package/examples/split/Array type.json +1 -0
  119. package/examples/split/binary type.json +1 -0
  120. package/examples/split/using strings and buffers.json +1 -0
  121. package/examples/split/work with binary data as string data.json +1 -0
  122. package/examples/statemachine/Representing gen_statem in Erlang-Red.json +1 -0
  123. package/examples/statemachine/combined with supervisor.json +1 -0
  124. package/examples/statemachine/exception if no action to perform.json +1 -0
  125. package/examples/status/basic working version.json +1 -0
  126. package/examples/status/only one message per status value.json +1 -0
  127. package/examples/status/source map inside the status map.json +1 -0
  128. package/examples/supervisor/inform user if config needs updating.json +1 -0
  129. package/examples/supervisor/multiple individual supervisors.json +1 -0
  130. package/examples/supervisor/order defined by Y coordinate..json +1 -0
  131. package/examples/supervisor/restart after exit call.json +1 -0
  132. package/examples/supervisor/supervising two function nodes.json +1 -0
  133. package/examples/supervisor/supervisor loops.json +1 -0
  134. package/examples/supervisor/supervisor of supervisor of supervisor of .....json +1 -0
  135. package/examples/supervisor/supervisor told to stop.json +1 -0
  136. package/examples/supervisor/supervisor tree.json +1 -0
  137. package/examples/supervisor/two supervisors cannot supervise the same nodes.json +1 -0
  138. package/examples/supervisor/unsupported configrations.json +1 -0
  139. package/examples/switch/JSONata undefined value & exceptions.json +1 -0
  140. package/examples/switch/post debug on JSONata exception.json +1 -0
  141. package/examples/switch/raise exception if JSONata has exception.json +1 -0
  142. package/examples/tcp/Bad value on output port (3425).json +1 -0
  143. package/examples/tcp/multiple tcp in connectors (1194).json +1 -0
  144. package/examples/tcp/request node - disconnect immediately (1001).json +1 -0
  145. package/examples/tcp/tcp-out node in reply mode (1202).json +1 -0
  146. package/examples/tcp/transfer string between nodes (1201).json +1 -0
  147. package/examples/template/handle base64 encoded data.json +1 -0
  148. package/examples/template/support mustache template.json +1 -0
  149. package/examples/trigger/initial example.json +1 -0
  150. package/nodes/ut-assert-debug.js +66 -17
  151. package/nodes/ut-assert-values.js +179 -161
  152. package/package.json +1 -1
  153. package/plugins/sidebar.html +20 -42
  154. package/examples/069552b2eb6bce48/flows.json +0 -265
  155. package/examples/08183069b5f8ef9c/flows.json +0 -156
  156. package/examples/084fb0fc954b7156/flows.json +0 -132
  157. package/examples/090eb2d5d71fd45f/flows.json +0 -158
  158. package/examples/0c35d269ca7178c6/flows.json +0 -443
  159. package/examples/0cc95e44532c14ec/flows.json +0 -94
  160. package/examples/16b0bc0cdb0c5807/flows.json +0 -1
  161. package/examples/16b254125478329a/flows.json +0 -114
  162. package/examples/182731f54d855071/flows.json +0 -52
  163. package/examples/1ace9e051618db79/flows.json +0 -125
  164. package/examples/1c1d2cb981cf9f01/flows.json +0 -120
  165. package/examples/1db9c9a1b92e0263/flows.json +0 -172
  166. package/examples/20eeaf41372f7b17/flows.json +0 -62
  167. package/examples/27804627fb8f56bd/flows.json +0 -178
  168. package/examples/2a2c508260b96236/flows.json +0 -141
  169. package/examples/34f859d75b76d03c/flows.json +0 -200
  170. package/examples/36846ad6698e1bc0/flows.json +0 -163
  171. package/examples/3be6bc074c7647bd/flows.json +0 -319
  172. package/examples/44f12f6e4a455084/flows.json +0 -272
  173. package/examples/45209c67f865ce73/flows.json +0 -1
  174. package/examples/4657dbc0aa4a97bb/flows.json +0 -268
  175. package/examples/47514a335b4cd67e/flows.json +0 -362
  176. package/examples/486c1412721bb241/flows.json +0 -525
  177. package/examples/51bfa9456b1745c0/flows.json +0 -639
  178. package/examples/538be5947c639b32/flows.json +0 -75
  179. package/examples/545871d31c3f5f3f/flows.json +0 -376
  180. package/examples/55f105cfd894b06c/flows.json +0 -121
  181. package/examples/57d44c342a1f00e2/flows.json +0 -1
  182. package/examples/597ee2a683d9908f/flows.json +0 -129
  183. package/examples/59da63b5adb460db/flows.json +0 -188
  184. package/examples/61142eb3e4e54eab/flows.json +0 -536
  185. package/examples/64445798b59d2630/flows.json +0 -257
  186. package/examples/6d46e3fe1f2245b8/flows.json +0 -86
  187. package/examples/6dd3a5754f83dc2e/flows.json +0 -232
  188. package/examples/6ff45e2a0ce77393/flows.json +0 -131
  189. package/examples/700c94899fdd3334/flows.json +0 -107
  190. package/examples/7581c2be261f9c17/flows.json +0 -1874
  191. package/examples/7ecfd18f58fc6510/flows.json +0 -1
  192. package/examples/7fea9696f6186962/flows.json +0 -141
  193. package/examples/80655e5d4035fa71/flows.json +0 -215
  194. package/examples/8421f37b6c40e1ec/flows.json +0 -1
  195. package/examples/866410b56fa42447/flows.json +0 -1076
  196. package/examples/89aeaeef64509bed/flows.json +0 -101
  197. package/examples/8a627c9bfe3b4aff/flows.json +0 -552
  198. package/examples/96f6f83dcab507e5/flows.json +0 -105
  199. package/examples/9746601768c3b3b6/flows.json +0 -93
  200. package/examples/9942fa1aeb1b2428/flows.json +0 -2346
  201. package/examples/9b1023c95a2613cc/flows.json +0 -141
  202. package/examples/9d11bfc3a6d88535/flows.json +0 -301
  203. package/examples/9e7ccc97f80d9afb/flows.json +0 -93
  204. package/examples/9f0d6c3ad7798a77/flows.json +0 -142
  205. package/examples/9f7351d7a7304584/flows.json +0 -83
  206. package/examples/a123cd431f1967cd/flows.json +0 -1757
  207. package/examples/a4c9cabf4b335488/flows.json +0 -86
  208. package/examples/a916165378c446e3/flows.json +0 -240
  209. package/examples/ae38b2dbd23d1681/flows.json +0 -3089
  210. package/examples/ae8a9b0bbbaff447/flows.json +0 -271
  211. package/examples/b07b511dc8bb8339/flows.json +0 -92
  212. package/examples/b1501de32c769cf2/flows.json +0 -94
  213. package/examples/b5fbcdbffb568569/flows.json +0 -1
  214. package/examples/b723353a316fa50e/flows.json +0 -1
  215. package/examples/b864b3e3510cd120/flows.json +0 -205
  216. package/examples/bdbe94d065f3b3a6/flows.json +0 -143
  217. package/examples/bfced61e72c69715/flows.json +0 -616
  218. package/examples/c0b1cf6656eac77f/flows.json +0 -518
  219. package/examples/c381b5135cc947cd/flows.json +0 -272
  220. package/examples/c4690c0a085d6ef5/flows.json +0 -145
  221. package/examples/c5f513bc380bc30a/flows.json +0 -696
  222. package/examples/cfa8595b2e2b8269/flows.json +0 -255
  223. package/examples/d17fb2553fe8013a/flows.json +0 -157
  224. package/examples/d61182e87a604efa/flows.json +0 -340
  225. package/examples/eb24c92ce5621760/flows.json +0 -141
  226. package/examples/eb447048178f6e16/flows.json +0 -201
  227. package/examples/eed68dbcecd1431f/flows.json +0 -204
  228. package/examples/ef61f644d5436dbe/flows.json +0 -1
  229. package/examples/f19fdae0c02b4f03/flows.json +0 -1008
  230. package/examples/f2f61ec9fc46a468/flows.json +0 -575
  231. package/examples/f346d45c81f595e5/flows.json +0 -501
  232. package/examples/f5f82ca50317fda7/flows.json +0 -121
  233. package/examples/f946aafaebb1398d/flows.json +0 -135
  234. package/examples/f94db507552f4934/flows.json +0 -165
  235. package/examples/fb50bac16667fc54/flows.json +0 -364
  236. /package/examples/{684b9066e98b9722/flows.json → .core/Disabled node should not be sent messages.json} +0 -0
  237. /package/examples/{0e54563ba63b1501/flows.json → .core/assert values ignores failures if requested.json} +0 -0
  238. /package/examples/{7b77600dcf78933f/flows.json → .core/attribute parsing.json} +0 -0
  239. /package/examples/{93c6e969dcf84e70/flows.json → .core/ensure that message ids don't change.json} +0 -0
  240. /package/examples/{d206746f9f2594a6/flows.json → .jsonata/$match operator.json} +0 -0
  241. /package/examples/{37883612d913fd66/flows.json → .jsonata/$not operator.json} +0 -0
  242. /package/examples/{caccb020fce3f485/flows.json → .jsonata/$pad function.json} +0 -0
  243. /package/examples/{a862ae412a70ded1/flows.json → .jsonata/$substring functionality.json} +0 -0
  244. /package/examples/{0b299a3175fc0df1/flows.json → .jsonata/array indexing both forwards and backwards.json} +0 -0
  245. /package/examples/{2037454a5ee0d6c3/flows.json → .jsonata/basic support for JSONata.json} +0 -0
  246. /package/examples/{3e9e526b992d4c48/flows.json → .jsonata/ensure random is seeded.json} +0 -0
  247. /package/examples/{e7184b7ca4f07907/flows.json → .jsonata/sum arrays of objects.json} +0 -0
  248. /package/examples/{218350f2e240a15d/flows.json → .jsonata/support $keys function.json} +0 -0
  249. /package/examples/{b50f775ae3b74d38/flows.json → .jsonata/testing the modulo operator.json} +0 -0
  250. /package/examples/{1658196c31549916/flows.json → batch/batch until batch is full.json} +0 -0
  251. /package/examples/{c843dacf753a19d8/flows.json → batch/ensure batch size of 1 works.json} +0 -0
  252. /package/examples/{9a1bdfdcd7b2be8e/flows.json → batch/performance.json} +0 -0
  253. /package/examples/{538d2f4704cd2eca/flows.json → catch/ensure source is inside error map.json} +0 -0
  254. /package/examples/{6a9ffd45c418497b/flows.json → catch/file not found exception.json} +0 -0
  255. /package/examples/{71f65246c742cfc9/flows.json → catch/multiple nodes in one flow is possible.json} +0 -0
  256. /package/examples/{ed621e03921c13de/flows.json → catch/uncaught catch - part 2 - work.json} +0 -0
  257. /package/examples/{f5bdafa844f6d280/flows.json → catch/uncaught catches.json} +0 -0
  258. /package/examples/{9c51a179141515b2/flows.json → change/change functionality.json} +0 -0
  259. /package/examples/{ea246f68766c8630/flows.json → change/delete functionality.json} +0 -0
  260. /package/examples/{30465efe017cc9b0/flows.json → change/delete nested keys.json} +0 -0
  261. /package/examples/{ced70c769db825eb/flows.json → change/ensure rules are expected in order.json} +0 -0
  262. /package/examples/{7dae2b1a7881c607/flows.json → change/move functionality.json} +0 -0
  263. /package/examples/{92054e0dd22f14c6/flows.json → change/raises an exception if JSONata has exception.json} +0 -0
  264. /package/examples/{b85795a24882502b/flows.json → change/set support nested properties.json} +0 -0
  265. /package/examples/{c28048d859db3773/flows.json → change/support boolean types.json} +0 -0
  266. /package/examples/{12572f9ac11e1786/flows.json → change/support json values in the set.json} +0 -0
  267. /package/examples/{def45a46c8f4da72/flows.json → change/support nested array indicies - setting & getting & deleting.json} +0 -0
  268. /package/examples/{0cb8971e5f88ed1e/flows.json → change/support nested keys on the set operation.json} +0 -0
  269. /package/examples/{48d9fdcde317974e/flows.json → change/support timestamp type.json} +0 -0
  270. /package/examples/{1bac0a78e0a36ec0/flows.json → comment/what is there to test?.json} +0 -0
  271. /package/examples/{b9cd19107a5145c4/flows.json → complete/disabled nodes don't receive.json} +0 -0
  272. /package/examples/{5e07acf2da13b504/flows.json → complete/ensure the altered msg object is sent.json} +0 -0
  273. /package/examples/{01b074cfa6ae8818/flows.json → complete/link nodes.json} +0 -0
  274. /package/examples/{cd44a688eb2ab3cf/flows.json → complete/messags from unconnected inject.json} +0 -0
  275. /package/examples/{30c79fc42a5c35eb/flows.json → complete/only handle messages from listened to nodes.json} +0 -0
  276. /package/examples/{f8727464c799eb22/flows.json → complete/switch node isn't compatible with complete.json} +0 -0
  277. /package/examples/{b2a67e301fabab0e/flows.json → debug/handle the button press to active and deactive debug output.json} +0 -0
  278. /package/examples/{a6dc7002d0a8640e/flows.json → debug/if not active, no debug message in panel.json} +0 -0
  279. /package/examples/{b1463d7bbf545725/flows.json → debug/inactive debug nodes still count messages.json} +0 -0
  280. /package/examples/{5a06352874fa379d/flows.json → debug/only send debug message to server console if asked to.json} +0 -0
  281. /package/examples/{c1370220fd37968e/flows.json → delay/ignore msg.delay if its not set.json} +0 -0
  282. /package/examples/{d17062b01c4a9435/flows.json → delay/random between two values.json} +0 -0
  283. /package/examples/{3ea113b4ec3b6e5e/flows.json → delay/set delay via msg.delay.json} +0 -0
  284. /package/examples/{e2a801d2b3e2143f/flows.json → exec/add payload and append arguments.json} +0 -0
  285. /package/examples/{b98d0b05a760ad79/flows.json → exec/execute simple command.json} +0 -0
  286. /package/examples/{6ea4c6b373eeaa8d/flows.json → filter/narrowband no topic.json} +0 -0
  287. /package/examples/{cef9dd7dc179b8b3/flows.json → filter/value differ by topic.json} +0 -0
  288. /package/examples/{b2fcc5806b2715c0/flows.json → inject/JSONata undefined value & exceptions.json} +0 -0
  289. /package/examples/{09aab59a2455cf15/flows.json → inject/Payload, topic and fubar set on inject.json} +0 -0
  290. /package/examples/{8180ae5891c673de/flows.json → inject/ensure that topic is set correctly.json} +0 -0
  291. /package/examples/{1eb35963b752eca9/flows.json → inject/json support for properties other than payload.json} +0 -0
  292. /package/examples/{61847d719e50f83f/flows.json → inject/jsonata support for both payload and other properties.json} +0 -0
  293. /package/examples/{459322e0f8e0b785/flows.json → inject/nested hash & array support.json} +0 -0
  294. /package/examples/{c163c627bd2a37c7/flows.json → inject/support boolean type.json} +0 -0
  295. /package/examples/{7e1d04570c6bdff9/flows.json → inject/support jsonata for topic values.json} +0 -0
  296. /package/examples/{1a196bce3e57f5c1/flows.json → inject/support nested property names.json} +0 -0
  297. /package/examples/{2a12af161b544aa1/flows.json → inject/support num types.json} +0 -0
  298. /package/examples/{ec921769b3c24fb6/flows.json → inject/support the msg property type.json} +0 -0
  299. /package/examples/{9ff2e8ab21d922c5/flows.json → inject/trigger once - default value.json} +0 -0
  300. /package/examples/{1d3326a724ecbea0/flows.json → join/automatic mode.json} +0 -0
  301. /package/examples/{24f35eaa8656755f/flows.json → join/count overrides parts, complete overrides count.json} +0 -0
  302. /package/examples/{987cd33b9cda8529/flows.json → join/manual configration with count and property name.json} +0 -0
  303. /package/examples/{50d5679818477b66/flows.json → join/manual configuration counting messages.json} +0 -0
  304. /package/examples/{894f6e38bfd1aca6/flows.json → join/remove parts once matched.json} +0 -0
  305. /package/examples/{5cf6aec7d688fce4/flows.json → join/results are not ordered by index.json} +0 -0
  306. /package/examples/{d5424657b497d5af/flows.json → join/useparts with count value.json} +0 -0
  307. /package/examples/{77854a5ea962257b/flows.json → join/useparts without count value.json} +0 -0
  308. /package/examples/{f1e71f2ccb34fd6e/flows.json → join/wait for complete until messages are sent.json} +0 -0
  309. /package/examples/{d4ce58359ff6ff96/flows.json → join/with parts until complete received.json} +0 -0
  310. /package/examples/{b3f365d0b7d1f97d/flows.json → json/overwrite the attribute.json} +0 -0
  311. /package/examples/{e1ced3b16782f7c8/flows.json → junction/should just pass on the message.json} +0 -0
  312. /package/examples/{51870a76d1aaf67a/flows.json → link nodes/_linkSource support.json} +0 -0
  313. /package/examples/{bbb1fc2d47c3cd5f/flows.json → link nodes/basic test whether out and in can connect.json} +0 -0
  314. /package/examples/{15c2fad089960984/flows.json → link nodes/dynamic targets and timeout.json} +0 -0
  315. /package/examples/{c274a07715a87ca4/flows.json → link nodes/exception if dynamic link does not exist.json} +0 -0
  316. /package/examples/{9463eba0ab843567/flows.json → link nodes/exception if multiple link nodes match.json} +0 -0
  317. /package/examples/{641ddaab2819c61d/flows.json → link nodes/flow for call and returning.json} +0 -0
  318. /package/examples/{b6d4e4592b27a344/flows.json → link nodes/implement time out on link call node.json} +0 -0
  319. /package/examples/{c6ee6e89a51c98fc/flows.json → link nodes/link call - return to sender.json} +0 -0
  320. /package/examples/{38616d22e1569aa5/flows.json → link nodes/link call to a dynamic link in node - by name.json} +0 -0
  321. /package/examples/{5433b57035d597f9/flows.json → link nodes/link call to a dynamic link in node - by node id.json} +0 -0
  322. /package/examples/{213803d61ecfde3a/flows.json → link nodes/mutliple links.json} +0 -0
  323. /package/examples/{b7ebaf91f4d66ab3/flows.json → sort/array of objects.json} +0 -0
  324. /package/examples/{cffa610c817beb43/flows.json → sort/msg.complete is not respected.json} +0 -0
  325. /package/examples/{5f6929bb3374b782/flows.json → sort/sort by parts.index.json} +0 -0
  326. /package/examples/{b1430ea37ba7cc19/flows.json → split/array split.json} +0 -0
  327. /package/examples/{4de34883c5d93dc3/flows.json → split/len value is the array split size.json} +0 -0
  328. /package/examples/{2c59ef974b2523ba/flows.json → split/nested parts.json} +0 -0
  329. /package/examples/{02b18fc0ed9de178/flows.json → split/parts id is identical.json} +0 -0
  330. /package/examples/{435d3b48dd0f462c/flows.json → split/silently ignore integer as a value to split.json} +0 -0
  331. /package/examples/{5cd133958df17529/flows.json → switch/catch all v. stop after first.json} +0 -0
  332. /package/examples/{562c518969666f24/flows.json → switch/empty, non-empty, null & not-null operators.json} +0 -0
  333. /package/examples/{3edda6bd788f88c2/flows.json → switch/ensure JSONata support.json} +0 -0
  334. /package/examples/{2c1c291ec8466bfb/flows.json → switch/handle is true & is false.json} +0 -0
  335. /package/examples/{59aa8a866d8d7a70/flows.json → switch/handle nested values.json} +0 -0
  336. /package/examples/{def56742e02f6a75/flows.json → switch/property is not defined on msg object.json} +0 -0
  337. /package/examples/{f4c4a57e77439a1b/flows.json → switch/regular expression operator.json} +0 -0
  338. /package/examples/{ce2f98273da05245/flows.json → switch/support otherwise /"catchall/" rule.json"} +0 -0
  339. /package/examples/{0616f795a4aee63e/flows.json → switch/working JSONata expression operator.json} +0 -0
  340. /package/examples/{84a5a362cafe703f/flows.json → tcp/request node - stream of strings (1101).json} +0 -0
  341. /package/examples/{6f0dcbf18234c5e2/flows.json → tcp/tcp in node connect to (9393).json} +0 -0
  342. /package/examples/{2a95a7b40a798878/flows.json → tcp/telnet server (2323).json} +0 -0
  343. /package/examples/{698b83b8aeb5d5b6/flows.json → template/contains plain text and no mustache content.json} +0 -0
  344. /package/examples/{63ca9baf860d1d8f/flows.json → template/support Json encoding.json} +0 -0
  345. /package/examples/{3ed472eab9503b4f/flows.json → template/support logic in logicless mustache template.json} +0 -0
  346. /package/examples/{ad2bf1089481dcfb/flows.json → trigger/extend timer.json} +0 -0
  347. /package/examples/{8bc7412d6a4869c6/flows.json → trigger/loops of triggers.json} +0 -0
  348. /package/examples/{55f7fbe90e5befa8/flows.json → trigger/msg.delay overrides the configured delay.json} +0 -0
  349. /package/examples/{34d211e37618313c/flows.json → trigger/override via delay but no delay set.json} +0 -0
  350. /package/examples/{988f27b9abdde6e9/flows.json → trigger/send both messages on one pipe.json} +0 -0
  351. /package/examples/{338c5b411f4edfe8/flows.json → trigger/send first but not second message.json} +0 -0
  352. /package/examples/{5d4908af3d4f95e5/flows.json → trigger/send second message only.json} +0 -0
  353. /package/examples/{d595c53abba88f72/flows.json → trigger/the noop trigger.json} +0 -0
  354. /package/examples/{1566e453a88578a9/flows.json → trigger/two outputs.json} +0 -0
@@ -0,0 +1 @@
1
+ [{"id":"f19fdae0c02b4f03","type":"tab","label":"[filter] post if value changed","disabled":false,"info":"## Filter Node - block unless value changes\n\n`rbe` mode with no topic\n\nrbe = Report by Exception \n\n","env":[{"name":"ERED_PENDING","value":"false","type":"bool"},{"name":"NRED_TIMEOUT","value":"10","type":"num"}]},{"id":"1fad26711775a40e","type":"group","z":"f19fdae0c02b4f03","name":"property name is payload","style":{"label":true},"nodes":["ba56e9576baa4861","9d20155046acc31d","8543499ae5fd3576","6bebc590dadbb889","91dc380dc998eb73","4a2e2509bb56578c","de9e7db23aa445d4","4ad5428bb1c2b43b","3a69a6eab42aa620"],"x":74.71431732177734,"y":169.25000762939453,"w":1501,"h":388.82148456573486},{"id":"bcbd77613b58fd14","type":"group","z":"f19fdae0c02b4f03","name":"property name is 'fubar'","style":{"label":true},"nodes":["93d6c55ad6d1226d","6a895b8bf87276db","59dce407eef8cca0","1d0568738eeca121","1b6070bfb3872cb0","48147307210ff02d","e55e7353f2bac7d8","0ca2a03e246542f6","5104a3873348939b"],"x":83.2857666015625,"y":617.9464721679688,"w":1501,"h":370.2500686645508},{"id":"fd7e9b5411af529a","type":"group","z":"f19fdae0c02b4f03","name":"initial value of one is passed through","style":{"label":true},"nodes":["efe7ba3be4543696","67ab18c23e6c587b","0b44e89a334f0d8a","db5d759eb00cc309","cf9d3c1218efdb76","bc46ed8ef3228081","ac89fbae93406c6b","0766942615326863","562c17db94814a4d","a97de0b6702f0df0","477a74766db49b18","fa0885e500e36329","70cbcae5d6ecbd90"],"x":82,"y":1100,"w":1130,"h":281},{"id":"5a6888198548f8a1","type":"group","z":"f19fdae0c02b4f03","name":"respect reset message and allow the payload of 1 to go through twice","style":{"label":true},"nodes":["7f05cc05bd28ba55","077dab67f1b3e189","7f756373695c6370","01f9ade51488b89b","932d64cad9078ef8","96d8d76f33ea1497","d153932e2569b829","5580785faab157d1","81db7508d0f3aeb5","4fbd1b0bdd4d239b"],"x":75,"y":1545,"w":1130,"h":249.5},{"id":"ba56e9576baa4861","type":"rbe","z":"f19fdae0c02b4f03","g":"1fad26711775a40e","name":"","func":"rbe","gap":"10%","start":"","inout":"out","septopics":false,"property":"payload","topi":"topic","x":1035.7143173217773,"y":429.87500762939453,"wires":[["91dc380dc998eb73","de9e7db23aa445d4","4ad5428bb1c2b43b"]]},{"id":"9d20155046acc31d","type":"inject","z":"f19fdae0c02b4f03","g":"1fad26711775a40e","name":"","props":[{"p":"counter","v":"0","vt":"num"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":170.71431732177734,"y":429.87500762939453,"wires":[["8543499ae5fd3576"]]},{"id":"8543499ae5fd3576","type":"change","z":"f19fdae0c02b4f03","g":"1fad26711775a40e","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"10","tot":"num"},{"t":"set","p":"counter","pt":"msg","to":"$$.counter + 1","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":616.7143173217773,"y":429.87500762939453,"wires":[["6bebc590dadbb889","ba56e9576baa4861","3a69a6eab42aa620"]]},{"id":"6bebc590dadbb889","type":"switch","z":"f19fdae0c02b4f03","g":"1fad26711775a40e","name":"limit to 1000 messages","property":"counter","propertyType":"msg","rules":[{"t":"lt","v":"1000","vt":"num"},{"t":"else"}],"checkall":"false","repair":false,"outputs":2,"x":616.7143173217773,"y":210.25000762939453,"wires":[["8543499ae5fd3576"],["4a2e2509bb56578c"]]},{"id":"91dc380dc998eb73","type":"ut-assert-success","z":"f19fdae0c02b4f03","g":"1fad26711775a40e","name":"","count":"2","x":1459.7143173217773,"y":429.87500762939453,"wires":[]},{"id":"4a2e2509bb56578c","type":"change","z":"f19fdae0c02b4f03","g":"1fad26711775a40e","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"11","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":855.7143249511719,"y":316.8572082519531,"wires":[["ba56e9576baa4861"]]},{"id":"de9e7db23aa445d4","type":"ut-assert-values","z":"f19fdae0c02b4f03","g":"1fad26711775a40e","name":"","ignore_failure_if_succeed":true,"rules":[{"t":"eql","p":"payload","pt":"msg","to":"10","tot":"num"}],"x":1266.7143173217773,"y":316.8572082519531,"wires":[[]]},{"id":"4ad5428bb1c2b43b","type":"ut-assert-values","z":"f19fdae0c02b4f03","g":"1fad26711775a40e","name":"","ignore_failure_if_succeed":true,"rules":[{"t":"eql","p":"payload","pt":"msg","to":"11","tot":"num"}],"x":1368.2143173217773,"y":373.3661079406738,"wires":[[]]},{"id":"3a69a6eab42aa620","type":"ut-assert-success","z":"f19fdae0c02b4f03","g":"1fad26711775a40e","name":"","count":"1000","x":953.5714263916016,"y":517.0714921951294,"wires":[]},{"id":"93d6c55ad6d1226d","type":"rbe","z":"f19fdae0c02b4f03","g":"bcbd77613b58fd14","name":"","func":"rbe","gap":"10%","start":"","inout":"out","septopics":false,"property":"fubar","topi":"topic","x":1044.2857666015625,"y":878.5714721679688,"wires":[["1b6070bfb3872cb0","e55e7353f2bac7d8","0ca2a03e246542f6"]]},{"id":"6a895b8bf87276db","type":"inject","z":"f19fdae0c02b4f03","g":"bcbd77613b58fd14","name":"","props":[{"p":"counter","v":"0","vt":"num"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":179.2857666015625,"y":878.5714721679688,"wires":[["59dce407eef8cca0"]]},{"id":"59dce407eef8cca0","type":"change","z":"f19fdae0c02b4f03","g":"bcbd77613b58fd14","name":"","rules":[{"t":"set","p":"fubar","pt":"msg","to":"10","tot":"num"},{"t":"set","p":"counter","pt":"msg","to":"$$.counter + 1","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":625.2857666015625,"y":878.5714721679688,"wires":[["1d0568738eeca121","93d6c55ad6d1226d","5104a3873348939b"]]},{"id":"1d0568738eeca121","type":"switch","z":"f19fdae0c02b4f03","g":"bcbd77613b58fd14","name":"limit to 1000 messages","property":"counter","propertyType":"msg","rules":[{"t":"lt","v":"1000","vt":"num"},{"t":"else"}],"checkall":"false","repair":false,"outputs":2,"x":625.2857666015625,"y":658.9464721679688,"wires":[["59dce407eef8cca0"],["48147307210ff02d"]]},{"id":"1b6070bfb3872cb0","type":"ut-assert-success","z":"f19fdae0c02b4f03","g":"bcbd77613b58fd14","name":"","count":"2","x":1468.2857666015625,"y":878.5714721679688,"wires":[]},{"id":"48147307210ff02d","type":"change","z":"f19fdae0c02b4f03","g":"bcbd77613b58fd14","name":"","rules":[{"t":"set","p":"fubar","pt":"msg","to":"11","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":864.285774230957,"y":765.5536727905273,"wires":[["93d6c55ad6d1226d"]]},{"id":"e55e7353f2bac7d8","type":"ut-assert-values","z":"f19fdae0c02b4f03","g":"bcbd77613b58fd14","name":"","ignore_failure_if_succeed":true,"rules":[{"t":"eql","p":"fubar","pt":"msg","to":"10","tot":"num"}],"x":1265.2857666015625,"y":765.5536727905273,"wires":[[]]},{"id":"0ca2a03e246542f6","type":"ut-assert-values","z":"f19fdae0c02b4f03","g":"bcbd77613b58fd14","name":"","ignore_failure_if_succeed":true,"rules":[{"t":"eql","p":"fubar","pt":"msg","to":"11","tot":"num"}],"x":1366.7857666015625,"y":822.062572479248,"wires":[[]]},{"id":"5104a3873348939b","type":"ut-assert-success","z":"f19fdae0c02b4f03","g":"bcbd77613b58fd14","name":"","count":"1000","x":939.2857437133789,"y":947.1965408325195,"wires":[]},{"id":"efe7ba3be4543696","type":"rbe","z":"f19fdae0c02b4f03","g":"fd7e9b5411af529a","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":false,"property":"payload","topi":"topic","x":772,"y":1141,"wires":[["bc46ed8ef3228081","ac89fbae93406c6b","0766942615326863","562c17db94814a4d","70cbcae5d6ecbd90"]]},{"id":"67ab18c23e6c587b","type":"inject","z":"f19fdae0c02b4f03","g":"fd7e9b5411af529a","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1","payloadType":"num","x":178,"y":1141,"wires":[["efe7ba3be4543696","a97de0b6702f0df0","477a74766db49b18","fa0885e500e36329"]]},{"id":"0b44e89a334f0d8a","type":"delay","z":"f19fdae0c02b4f03","g":"fd7e9b5411af529a","name":"","pauseType":"delay","timeout":"100","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":571,"y":1197.5,"wires":[["efe7ba3be4543696"]]},{"id":"db5d759eb00cc309","type":"delay","z":"f19fdae0c02b4f03","g":"fd7e9b5411af529a","name":"","pauseType":"delay","timeout":"200","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":576,"y":1249.5,"wires":[["efe7ba3be4543696"]]},{"id":"cf9d3c1218efdb76","type":"delay","z":"f19fdae0c02b4f03","g":"fd7e9b5411af529a","name":"","pauseType":"delay","timeout":"300","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":611,"y":1308.5,"wires":[["efe7ba3be4543696"]]},{"id":"bc46ed8ef3228081","type":"ut-assert-values","z":"f19fdae0c02b4f03","g":"fd7e9b5411af529a","name":"","ignore_failure_if_succeed":true,"rules":[{"t":"eql","p":"payload","pt":"msg","to":"2","tot":"num"}],"x":1076,"y":1237,"wires":[[]]},{"id":"ac89fbae93406c6b","type":"ut-assert-values","z":"f19fdae0c02b4f03","g":"fd7e9b5411af529a","name":"","ignore_failure_if_succeed":true,"rules":[{"t":"eql","p":"payload","pt":"msg","to":"3","tot":"num"}],"x":1076,"y":1288.5,"wires":[[]]},{"id":"0766942615326863","type":"ut-assert-values","z":"f19fdae0c02b4f03","g":"fd7e9b5411af529a","name":"","ignore_failure_if_succeed":true,"rules":[{"t":"eql","p":"payload","pt":"msg","to":"4","tot":"num"}],"x":1076,"y":1340,"wires":[[]]},{"id":"562c17db94814a4d","type":"ut-assert-success","z":"f19fdae0c02b4f03","g":"fd7e9b5411af529a","name":"","count":"4","x":1067,"y":1141,"wires":[]},{"id":"a97de0b6702f0df0","type":"change","z":"f19fdae0c02b4f03","g":"fd7e9b5411af529a","name":"payload = 2","rules":[{"t":"set","p":"payload","pt":"msg","to":"2","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":1197.5,"wires":[["0b44e89a334f0d8a"]]},{"id":"477a74766db49b18","type":"change","z":"f19fdae0c02b4f03","g":"fd7e9b5411af529a","name":"payload = 3 ","rules":[{"t":"set","p":"payload","pt":"msg","to":"3","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":374,"y":1249.5,"wires":[["db5d759eb00cc309"]]},{"id":"fa0885e500e36329","type":"change","z":"f19fdae0c02b4f03","g":"fd7e9b5411af529a","name":"payload = 4","rules":[{"t":"set","p":"payload","pt":"msg","to":"4","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":356,"y":1308.5,"wires":[["cf9d3c1218efdb76"]]},{"id":"70cbcae5d6ecbd90","type":"ut-assert-values","z":"f19fdae0c02b4f03","g":"fd7e9b5411af529a","name":"","ignore_failure_if_succeed":true,"rules":[{"t":"eql","p":"payload","pt":"msg","to":"1","tot":"num"}],"x":1076,"y":1186,"wires":[[]]},{"id":"7f05cc05bd28ba55","type":"rbe","z":"f19fdae0c02b4f03","g":"5a6888198548f8a1","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":false,"property":"payload","topi":"topic","x":765,"y":1586,"wires":[["96d8d76f33ea1497","4fbd1b0bdd4d239b"]]},{"id":"077dab67f1b3e189","type":"inject","z":"f19fdae0c02b4f03","g":"5a6888198548f8a1","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1","payloadType":"num","x":171,"y":1586,"wires":[["7f05cc05bd28ba55","d153932e2569b829","5580785faab157d1","81db7508d0f3aeb5"]]},{"id":"7f756373695c6370","type":"delay","z":"f19fdae0c02b4f03","g":"5a6888198548f8a1","name":"","pauseType":"delay","timeout":"100","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":564,"y":1642.5,"wires":[["7f05cc05bd28ba55"]]},{"id":"01f9ade51488b89b","type":"delay","z":"f19fdae0c02b4f03","g":"5a6888198548f8a1","name":"","pauseType":"delay","timeout":"200","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":584,"y":1698,"wires":[["7f05cc05bd28ba55"]]},{"id":"932d64cad9078ef8","type":"delay","z":"f19fdae0c02b4f03","g":"5a6888198548f8a1","name":"","pauseType":"delay","timeout":"300","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":604,"y":1753.5,"wires":[["7f05cc05bd28ba55"]]},{"id":"96d8d76f33ea1497","type":"ut-assert-success","z":"f19fdae0c02b4f03","g":"5a6888198548f8a1","name":"","count":"3","x":1060,"y":1586,"wires":[]},{"id":"d153932e2569b829","type":"change","z":"f19fdae0c02b4f03","g":"5a6888198548f8a1","name":"","rules":[],"action":"","property":"","from":"","to":"","reg":false,"x":383,"y":1642.5,"wires":[["7f756373695c6370"]]},{"id":"5580785faab157d1","type":"change","z":"f19fdae0c02b4f03","g":"5a6888198548f8a1","name":"","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":371,"y":1698,"wires":[["01f9ade51488b89b"]]},{"id":"81db7508d0f3aeb5","type":"change","z":"f19fdae0c02b4f03","g":"5a6888198548f8a1","name":"","rules":[],"action":"","property":"","from":"","to":"","reg":false,"x":359,"y":1753.5,"wires":[["932d64cad9078ef8"]]},{"id":"4fbd1b0bdd4d239b","type":"ut-assert-values","z":"f19fdae0c02b4f03","g":"5a6888198548f8a1","name":"","ignore_failure_if_succeed":false,"rules":[{"t":"eql","p":"payload","pt":"msg","to":"1","tot":"num"}],"x":1069,"y":1634,"wires":[[]]}]
@@ -0,0 +1 @@
1
+ [{"id":"70fb2a061a2b073d","type":"tab","label":"[flowhubpull] retrieve flow id","disabled":false,"info":"","env":[{"name":"ERED_ONLY","value":"true","type":"bool"}]},{"id":"25d0e57a7ef7d421","type":"group","z":"70fb2a061a2b073d","name":"flowid configured on node","style":{"label":true},"nodes":["4b46f1f2d5dc1263","a1dd14b5caad6cf0","dee10be3d9b662cd","2e58215af0d68b56","c2531fb627dbde3c","9de928a80f1a12fc","6436dc3078d96255","26796c184a940ef3","52cc643057d9e8b2"],"x":71,"y":76.77778100967407,"w":1110,"h":273.7222189903259},{"id":"b860f91f45ac9b1f","type":"group","z":"70fb2a061a2b073d","name":"flowid configured on msg","style":{"label":true},"nodes":["09a84c10ed4b3472","be03413177e0343e","80a8f5ec6e79f428","08051f4ce4b83c7c","87c27449f687518d","07dafc2b90dd1d07","a59661a14483d5a5","cdfaf380723de514","a1e701f0670d2837"],"x":112.4444580078125,"y":397.888916015625,"w":1066.6666564941406,"h":277.3333282470703},{"id":"5889b06b0bf92818","type":"group","z":"70fb2a061a2b073d","name":"no flowid set","style":{"label":true},"nodes":["05eb40ca93899f2a","250906ad1f0ece4d","d1a6c480c67cc4a0","7689c63c4de8ac44","dd292701c7ad5efe","e071e164dc3e31b0"],"x":231.77777099609375,"y":769.0000610351562,"w":777.5555534362793,"h":203.72218704223633},{"id":"4b46f1f2d5dc1263","type":"FlowHubPull","z":"70fb2a061a2b073d","g":"25d0e57a7ef7d421","name":"","notab":false,"flowid":"70fb2a061a2b073d","flowname":"[flowhubpull] retrieve flow id","flowrevision":"","x":453,"y":304.5,"wires":[["2e58215af0d68b56","c2531fb627dbde3c"],["dee10be3d9b662cd"]]},{"id":"a1dd14b5caad6cf0","type":"inject","z":"70fb2a061a2b073d","g":"25d0e57a7ef7d421","name":"","props":[],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":167,"y":240,"wires":[["4b46f1f2d5dc1263"]]},{"id":"dee10be3d9b662cd","type":"ut-assert-failure","z":"70fb2a061a2b073d","g":"25d0e57a7ef7d421","name":"","x":772.2222366333008,"y":309.5,"wires":[]},{"id":"2e58215af0d68b56","type":"ut-assert-success","z":"70fb2a061a2b073d","g":"25d0e57a7ef7d421","name":"","count":1,"x":772.2222366333008,"y":163.5,"wires":[]},{"id":"c2531fb627dbde3c","type":"json","z":"70fb2a061a2b073d","g":"25d0e57a7ef7d421","name":"","property":"payload","action":"","pretty":false,"x":752.2222366333008,"y":239.5,"wires":[["6436dc3078d96255"]]},{"id":"9de928a80f1a12fc","type":"ut-assert-values","z":"70fb2a061a2b073d","g":"25d0e57a7ef7d421","name":"","ignore_failure_if_succeed":false,"rules":[{"t":"eql","p":"payload","pt":"msg","to":"28","tot":"num"}],"x":1045,"y":309.5,"wires":[[]]},{"id":"6436dc3078d96255","type":"change","z":"70fb2a061a2b073d","g":"25d0e57a7ef7d421","name":"","rules":[{"p":"payload","pt":"msg","t":"set","to":"$count($$.payload)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1055,"y":239.5,"wires":[["9de928a80f1a12fc"]]},{"id":"09a84c10ed4b3472","type":"inject","z":"70fb2a061a2b073d","g":"b860f91f45ac9b1f","name":"set flowid","props":[{"p":"flowid","v":"70fb2a061a2b073d","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":218.4444580078125,"y":512.500057220459,"wires":[["a59661a14483d5a5"]]},{"id":"be03413177e0343e","type":"ut-assert-failure","z":"70fb2a061a2b073d","g":"b860f91f45ac9b1f","name":"","x":773.1111145019531,"y":634.2222442626953,"wires":[]},{"id":"80a8f5ec6e79f428","type":"ut-assert-success","z":"70fb2a061a2b073d","g":"b860f91f45ac9b1f","name":"","count":1,"x":773.1111145019531,"y":488.2222442626953,"wires":[]},{"id":"08051f4ce4b83c7c","type":"json","z":"70fb2a061a2b073d","g":"b860f91f45ac9b1f","name":"","property":"payload","action":"","pretty":false,"x":753.1111145019531,"y":564.2222442626953,"wires":[["07dafc2b90dd1d07"]]},{"id":"87c27449f687518d","type":"ut-assert-values","z":"70fb2a061a2b073d","g":"b860f91f45ac9b1f","name":"","ignore_failure_if_succeed":false,"rules":[{"t":"eql","p":"payload","pt":"msg","to":"28","tot":"num"}],"x":1043.1111145019531,"y":634.2222442626953,"wires":[[]]},{"id":"07dafc2b90dd1d07","type":"change","z":"70fb2a061a2b073d","g":"b860f91f45ac9b1f","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"$count($$.payload)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1053.1111145019531,"y":564.2222442626953,"wires":[["87c27449f687518d"]]},{"id":"a59661a14483d5a5","type":"FlowHubPull","z":"70fb2a061a2b073d","g":"b860f91f45ac9b1f","name":"","notab":false,"flowid":"","flowname":"","flowrevision":"","x":458.8888702392578,"y":627.2222652435303,"wires":[["80a8f5ec6e79f428","08051f4ce4b83c7c"],["be03413177e0343e"]]},{"id":"05eb40ca93899f2a","type":"inject","z":"70fb2a061a2b073d","g":"5889b06b0bf92818","name":"","props":[],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":327.77777099609375,"y":810.0000610351562,"wires":[["d1a6c480c67cc4a0"]]},{"id":"250906ad1f0ece4d","type":"ut-assert-failure","z":"70fb2a061a2b073d","g":"5889b06b0bf92818","name":"","x":893.333324432373,"y":931.7222480773926,"wires":[]},{"id":"d1a6c480c67cc4a0","type":"FlowHubPull","z":"70fb2a061a2b073d","g":"5889b06b0bf92818","name":"","notab":false,"flowid":"","flowname":"","flowrevision":"","x":578.2221832275391,"y":924.7222690582275,"wires":[["7689c63c4de8ac44"],["250906ad1f0ece4d"]]},{"id":"7689c63c4de8ac44","type":"ut-assert-failure","z":"70fb2a061a2b073d","g":"5889b06b0bf92818","name":"","x":893.333324432373,"y":886.6667289733887,"wires":[]},{"id":"dd292701c7ad5efe","type":"catch","z":"70fb2a061a2b073d","g":"5889b06b0bf92818","name":"","scope":["d1a6c480c67cc4a0"],"uncaught":false,"x":569.9999796549479,"y":816.6666937934027,"wires":[["e071e164dc3e31b0"]]},{"id":"e071e164dc3e31b0","type":"ut-assert-success","z":"70fb2a061a2b073d","g":"5889b06b0bf92818","name":"","count":1,"x":893.333324432373,"y":816.6666889190674,"wires":[]},{"id":"cdfaf380723de514","type":"catch","z":"70fb2a061a2b073d","g":"b860f91f45ac9b1f","name":"","scope":["a59661a14483d5a5"],"uncaught":false,"x":470.00001525878906,"y":438.888916015625,"wires":[["a1e701f0670d2837"]]},{"id":"a1e701f0670d2837","type":"ut-assert-failure","z":"70fb2a061a2b073d","g":"b860f91f45ac9b1f","name":"","x":773.1111145019531,"y":438.888916015625,"wires":[]},{"id":"26796c184a940ef3","type":"catch","z":"70fb2a061a2b073d","g":"25d0e57a7ef7d421","name":"","scope":["4b46f1f2d5dc1263"],"uncaught":false,"x":467.77779388427734,"y":117.77778100967407,"wires":[["52cc643057d9e8b2"]]},{"id":"52cc643057d9e8b2","type":"ut-assert-failure","z":"70fb2a061a2b073d","g":"25d0e57a7ef7d421","name":"","x":772.2222366333008,"y":117.77778100967407,"wires":[]}]
@@ -0,0 +1 @@
1
+ [{"id":"678153b1daa0529a","type":"tab","label":"[function] divide by zero throws kills node","disabled":false,"info":"## Function node and exceptions\n\nWhat happens if the function node raises an exception?\n\nThere are three cases to be considered:\n\n- <a class=\"ahl-group-only\" data-ids=\"b7e1e4d9d98ef1bb\">function node is under supervision</a>,\n- <a class=\"ahl-group-only\" data-ids=\"7ed7a1dc7f44409a\">function node is being caught</a> and\n- <a class=\"ahl-group-only\" data-ids=\"5bd563066938c2f3\">function node is neither</a>.\n\nThis is also the case for a <a class=\"ahl-group-only\" data-ids=\"e49cae74aca6e4aa\">time out exception</a> - if the function takes too long and there is a timeout set, then an exception is raised.\n","env":[{"name":"ERED_NOT_EUNIT","value":"true","type":"bool"},{"name":"ERED_TIMEOUT","value":"8","type":"num"},{"name":"ERED_ONLY","value":"true","type":"bool"}]},{"id":"e49cae74aca6e4aa","type":"group","z":"678153b1daa0529a","name":"time out exception","style":{"label":true},"nodes":["b2f1aafe54bf14d6","ae831a2255a48b68","3e2cbb65dff9baec"],"x":167.66665649414062,"y":1010,"w":1113.3333435058594,"h":759},{"id":"7d829222d2ef7ab2","type":"group","z":"678153b1daa0529a","name":"divide by zero exception","style":{"label":true},"nodes":["b7e1e4d9d98ef1bb","5bd563066938c2f3","7ed7a1dc7f44409a"],"x":168,"y":164,"w":1140,"h":797},{"id":"b7e1e4d9d98ef1bb","type":"group","z":"678153b1daa0529a","g":"7d829222d2ef7ab2","name":"no exception is raised if function is being supervised","style":{"label":true},"nodes":["e1926e702f82036d","0b270a75f19fe296","a7e6e47b5451fe98","f70d171602a22ea0","056c5807789fdd9f","a3c2a780a47683fa","25f64d67311491f0","c5616edc3d68cf06"],"x":199,"y":190,"w":1047,"h":217.125},{"id":"5bd563066938c2f3","type":"group","z":"678153b1daa0529a","g":"7d829222d2ef7ab2","name":"exception posted to the debug panel if exception not caught and function node not being supervised","style":{"label":true},"nodes":["2acfd9b89aa5a4f0","c2dc81f0f379b496","0610dfd55a620cd5","d36a8aa22bce4662","eb33aab579f867c1"],"x":194,"y":731,"w":1054,"h":204},{"id":"7ed7a1dc7f44409a","type":"group","z":"678153b1daa0529a","g":"7d829222d2ef7ab2","name":"if exception is caught, no debug message and the catch node handles it","style":{"label":true},"nodes":["1064a20a70a4d159","cbbdca5f81537d51","94f0dace67bcab25","714c969b3b036080","a7747cea4a1b7ac5","c35fef31f0dec2c7","6a4bfef352350b72"],"x":196,"y":452.5,"w":1086,"h":235.5},{"id":"b2f1aafe54bf14d6","type":"group","z":"678153b1daa0529a","g":"e49cae74aca6e4aa","name":"no exception is raised if function is being supervised","style":{"label":true},"nodes":["8c0d2959be4c8449","7c60e8efbf36cfb2","2bad596c31c9614c","478f54839df11249","5210bb11cbfd8184","637da1e5ea2fa8d2","8e15d37d50603cbe","0804f9de5cbb31b7"],"x":193.66665649414062,"y":1036,"w":1048.3333435058594,"h":217.125},{"id":"ae831a2255a48b68","type":"group","z":"678153b1daa0529a","g":"e49cae74aca6e4aa","name":"exception posted to the debug panel if exception not caught and function node not being supervised","style":{"label":true},"nodes":["e6bad32c2babea2d","43921beebe749863","247105e3e1174886","576520af1b49706d","e56ffd82b2beaec5"],"x":197.66665649414062,"y":1539,"w":1039.3333435058594,"h":204},{"id":"3e2cbb65dff9baec","type":"group","z":"678153b1daa0529a","g":"e49cae74aca6e4aa","name":"if exception is caught, no debug message and the catch node handles it","style":{"label":true},"nodes":["98af67622beba548","96a1bf65b0361c8d","6fd4f21bd30c0756","798d290779817374","0e5f5779ab066e4c","b20ed504160e56a2","ef0862b998bd51e6"],"x":195.66665649414062,"y":1281.5,"w":1059.3333435058594,"h":235.5},{"id":"e1926e702f82036d","type":"inject","z":"678153b1daa0529a","g":"b7e1e4d9d98ef1bb","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":305,"y":366.125,"wires":[["0b270a75f19fe296"]]},{"id":"0b270a75f19fe296","type":"function","z":"678153b1daa0529a","g":"b7e1e4d9d98ef1bb","name":"divide by zero causes an exception","func":"\n1 / 0","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":566,"y":366.125,"wires":[["f70d171602a22ea0"]]},{"id":"a7e6e47b5451fe98","type":"catch","z":"678153b1daa0529a","g":"b7e1e4d9d98ef1bb","name":"","scope":["0b270a75f19fe296"],"uncaught":false,"x":518,"y":239,"wires":[["a3c2a780a47683fa"]]},{"id":"f70d171602a22ea0","type":"ut-assert-failure","z":"678153b1daa0529a","g":"b7e1e4d9d98ef1bb","name":"","x":990,"y":366.125,"wires":[]},{"id":"056c5807789fdd9f","type":"erlsupervisor","z":"678153b1daa0529a","g":"b7e1e4d9d98ef1bb","auto_shutdown":"never","child_restart":"permanent","child_shutdown":"brutal_kill","child_shutdown_timeout":"0","child_type":"worker","intensity":"1","name":"","period":"5","scope":["0b270a75f19fe296"],"strategy":"one_for_one","supervisor_type":"static","x":327,"y":241.5,"wires":[[]]},{"id":"2acfd9b89aa5a4f0","type":"inject","z":"678153b1daa0529a","g":"5bd563066938c2f3","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":300,"y":772,"wires":[["c2dc81f0f379b496"]]},{"id":"c2dc81f0f379b496","type":"function","z":"678153b1daa0529a","g":"5bd563066938c2f3","name":"divide by zero causes an exception","func":"1 / 0","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":598,"y":829.75,"wires":[["0610dfd55a620cd5"]]},{"id":"0610dfd55a620cd5","type":"ut-assert-failure","z":"678153b1daa0529a","g":"5bd563066938c2f3","name":"","x":978,"y":829.75,"wires":[]},{"id":"d36a8aa22bce4662","type":"ut-assert-debug","z":"678153b1daa0529a","g":"5bd563066938c2f3","name":"","scope":["c2dc81f0f379b496"],"nodeid":"c2dc81f0f379b496","msgtype":"error","inverse":false,"x":664,"y":894,"wires":[["eb33aab579f867c1"]]},{"id":"a3c2a780a47683fa","type":"ut-assert-failure","z":"678153b1daa0529a","g":"b7e1e4d9d98ef1bb","name":"","x":827,"y":307,"wires":[]},{"id":"1064a20a70a4d159","type":"inject","z":"678153b1daa0529a","g":"7ed7a1dc7f44409a","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":302,"y":569.625,"wires":[["cbbdca5f81537d51"]]},{"id":"cbbdca5f81537d51","type":"function","z":"678153b1daa0529a","g":"7ed7a1dc7f44409a","name":"divide by zero causes an exception","func":"1 / 0","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":562,"y":569.625,"wires":[["94f0dace67bcab25"]]},{"id":"94f0dace67bcab25","type":"ut-assert-failure","z":"678153b1daa0529a","g":"7ed7a1dc7f44409a","name":"","x":890,"y":569.625,"wires":[]},{"id":"714c969b3b036080","type":"ut-assert-debug","z":"678153b1daa0529a","g":"7ed7a1dc7f44409a","name":"","scope":["cbbdca5f81537d51"],"nodeid":"cbbdca5f81537d51","msgtype":"error","inverse":true,"x":819,"y":647,"wires":[["6a4bfef352350b72"]]},{"id":"a7747cea4a1b7ac5","type":"catch","z":"678153b1daa0529a","g":"7ed7a1dc7f44409a","name":"","scope":["cbbdca5f81537d51"],"uncaught":false,"x":515,"y":493.5,"wires":[["c35fef31f0dec2c7"]]},{"id":"c35fef31f0dec2c7","type":"ut-assert-success","z":"678153b1daa0529a","g":"7ed7a1dc7f44409a","name":"","count":1,"x":940,"y":493.5,"wires":[]},{"id":"25f64d67311491f0","type":"ut-assert-debug","z":"678153b1daa0529a","g":"b7e1e4d9d98ef1bb","name":"","scope":["0b270a75f19fe296"],"nodeid":"0b270a75f19fe296","msgtype":"error","inverse":true,"x":882,"y":231,"wires":[["c5616edc3d68cf06"]]},{"id":"8c0d2959be4c8449","type":"inject","z":"678153b1daa0529a","g":"b2f1aafe54bf14d6","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":299.6666564941406,"y":1212.125,"wires":[["7c60e8efbf36cfb2"]]},{"id":"7c60e8efbf36cfb2","type":"function","z":"678153b1daa0529a","g":"b2f1aafe54bf14d6","name":"divide by zero causes an exception","func":"\ntimer:sleep(5_000)","outputs":1,"timeout":"1","noerr":0,"initialize":"","finalize":"","libs":[],"x":560.6666564941406,"y":1212.125,"wires":[["478f54839df11249"]]},{"id":"2bad596c31c9614c","type":"catch","z":"678153b1daa0529a","g":"b2f1aafe54bf14d6","name":"","scope":["7c60e8efbf36cfb2"],"uncaught":false,"x":512.6666564941406,"y":1085,"wires":[["637da1e5ea2fa8d2"]]},{"id":"478f54839df11249","type":"ut-assert-failure","z":"678153b1daa0529a","g":"b2f1aafe54bf14d6","name":"","x":984.6666564941406,"y":1212.125,"wires":[]},{"id":"5210bb11cbfd8184","type":"erlsupervisor","z":"678153b1daa0529a","g":"b2f1aafe54bf14d6","auto_shutdown":"never","child_restart":"permanent","child_shutdown":"brutal_kill","child_shutdown_timeout":"0","child_type":"worker","intensity":"1","name":"","period":"5","scope":["7c60e8efbf36cfb2"],"strategy":"one_for_one","supervisor_type":"static","x":321.6666564941406,"y":1087.5,"wires":[[]]},{"id":"637da1e5ea2fa8d2","type":"ut-assert-failure","z":"678153b1daa0529a","g":"b2f1aafe54bf14d6","name":"","x":821.6666564941406,"y":1153,"wires":[]},{"id":"8e15d37d50603cbe","type":"ut-assert-debug","z":"678153b1daa0529a","g":"b2f1aafe54bf14d6","name":"","scope":["7c60e8efbf36cfb2"],"nodeid":"7c60e8efbf36cfb2","msgtype":"error","inverse":true,"x":876.6666564941406,"y":1077,"wires":[["0804f9de5cbb31b7"]]},{"id":"e6bad32c2babea2d","type":"inject","z":"678153b1daa0529a","g":"ae831a2255a48b68","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":303.6666564941406,"y":1580,"wires":[["43921beebe749863"]]},{"id":"43921beebe749863","type":"function","z":"678153b1daa0529a","g":"ae831a2255a48b68","name":"divide by zero causes an exception","func":"timer:sleep(5_000)","outputs":1,"timeout":"1","noerr":0,"initialize":"","finalize":"","libs":[],"x":601.6666564941406,"y":1637.75,"wires":[["247105e3e1174886"]]},{"id":"247105e3e1174886","type":"ut-assert-failure","z":"678153b1daa0529a","g":"ae831a2255a48b68","name":"","x":981.6666564941406,"y":1637.75,"wires":[]},{"id":"576520af1b49706d","type":"ut-assert-debug","z":"678153b1daa0529a","g":"ae831a2255a48b68","name":"","scope":["43921beebe749863"],"nodeid":"43921beebe749863","msgtype":"error","inverse":false,"x":667.6666564941406,"y":1702,"wires":[["e56ffd82b2beaec5"]]},{"id":"98af67622beba548","type":"inject","z":"678153b1daa0529a","g":"3e2cbb65dff9baec","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":301.6666564941406,"y":1397.8125,"wires":[["96a1bf65b0361c8d"]]},{"id":"96a1bf65b0361c8d","type":"function","z":"678153b1daa0529a","g":"3e2cbb65dff9baec","name":"divide by zero causes an exception","func":"timer:sleep(5_000)","outputs":1,"timeout":"1","noerr":0,"initialize":"","finalize":"","libs":[],"x":561.6666564941406,"y":1397.8125,"wires":[["6fd4f21bd30c0756"]]},{"id":"6fd4f21bd30c0756","type":"ut-assert-failure","z":"678153b1daa0529a","g":"3e2cbb65dff9baec","name":"","x":889.6666564941406,"y":1397.8125,"wires":[]},{"id":"798d290779817374","type":"ut-assert-debug","z":"678153b1daa0529a","g":"3e2cbb65dff9baec","name":"","scope":["96a1bf65b0361c8d"],"nodeid":"96a1bf65b0361c8d","msgtype":"error","inverse":true,"x":818.6666564941406,"y":1476,"wires":[["ef0862b998bd51e6"]]},{"id":"0e5f5779ab066e4c","type":"catch","z":"678153b1daa0529a","g":"3e2cbb65dff9baec","name":"","scope":["96a1bf65b0361c8d"],"uncaught":false,"x":514.6666564941406,"y":1322.5,"wires":[["b20ed504160e56a2"]]},{"id":"b20ed504160e56a2","type":"ut-assert-success","z":"678153b1daa0529a","g":"3e2cbb65dff9baec","name":"","count":1,"x":939.6666564941406,"y":1322.5,"wires":[]},{"id":"0804f9de5cbb31b7","type":"ut-assert-failure","z":"678153b1daa0529a","g":"b2f1aafe54bf14d6","name":"","x":1146,"y":1153,"wires":[]},{"id":"ef0862b998bd51e6","type":"ut-assert-failure","z":"678153b1daa0529a","g":"3e2cbb65dff9baec","name":"","x":1159,"y":1397.8125,"wires":[]},{"id":"c5616edc3d68cf06","type":"ut-assert-failure","z":"678153b1daa0529a","g":"b7e1e4d9d98ef1bb","name":"","x":1150,"y":308,"wires":[]},{"id":"6a4bfef352350b72","type":"ut-assert-failure","z":"678153b1daa0529a","g":"7ed7a1dc7f44409a","name":"","x":1186,"y":569.625,"wires":[]},{"id":"e56ffd82b2beaec5","type":"ut-assert-values","z":"678153b1daa0529a","g":"ae831a2255a48b68","name":"","ignore_failure_if_succeed":false,"rules":[{"p":"debug.nodeid","pt":"msg","t":"eql","to":"43921beebe749863","tot":"str"},{"p":"payload['level']","pt":"msg","t":"eql","to":"20","tot":"num"},{"p":"payload.msg.error_msg","pt":"msg","t":"eql","to":"unexpected exit","tot":"str"},{"p":"payload.name","pt":"msg","t":"eql","to":"divide by zero causes an exception","tot":"str"}],"x":1131,"y":1702,"wires":[[]]},{"id":"eb33aab579f867c1","type":"ut-assert-values","z":"678153b1daa0529a","g":"5bd563066938c2f3","name":"","ignore_failure_if_succeed":false,"rules":[{"p":"debug.nodeid","pt":"msg","t":"eql","to":"c2dc81f0f379b496","tot":"str"},{"p":"payload['level']","pt":"msg","t":"eql","to":"20","tot":"num"},{"p":"payload.msg.error_msg","pt":"msg","t":"eql","to":"unexpected exit","tot":"str"},{"p":"payload.name","pt":"msg","t":"eql","to":"divide by zero causes an exception","tot":"str"}],"x":1142,"y":894,"wires":[[]]}]
@@ -0,0 +1 @@
1
+ [{"id":"dbc618ad5f0210bb","type":"tab","label":"[function] ensure \"on stop\" code is executed","disabled":false,"info":"## Function nodes can be stopped often\n\nEnsure that the on stop code is executed each time.\n\nThis is particular the case if the node is being supervised by a supervisor node.","env":[{"name":"ERED_PENDING","value":"true","type":"bool"}]},{"id":"eb66387c50c14a04","type":"inject","z":"dbc618ad5f0210bb","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":241,"y":625,"wires":[[]]},{"id":"81b2e5465a3b39d5","type":"function","z":"dbc618ad5f0210bb","name":"function 5","func":"%% Code here is wrapped in a fun (Msg) call\n%% fun (Msg) ->\n Msg\n%% end.\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":362,"y":862,"wires":[[]]},{"id":"6abf10a6ebdc0518","type":"erlsupervisor","z":"dbc618ad5f0210bb","name":"","scope":["81b2e5465a3b39d5"],"supervisor_type":"static","strategy":"one_for_one","auto_shutdown":"never","intensity":"1","period":"5","child_type":"worker","child_restart":"permanent","child_shutdown":"brutal_kill","child_shutdown_timeout":"0","x":443,"y":702.5,"wires":[[]]}]
@@ -0,0 +1 @@
1
+ [{"id":"442b3bf0d630e21d","type":"tab","label":"[function] function and module work together","disabled":false,"info":"## Function & Module = Working\n\nEnsure that a module can be defined in a module and then be used in a function node.\n\n## Module node\n\nA module node can be used to defined a complete Erlang module, i.e., something like \n\n```erlang\n-module(ered_http_nodered_inject_node_button_handler).\n\n-behaviour(cowboy_rest).\n\n-export([\n init/2,\n allowed_methods/2,\n content_types_accepted/2,\n handle_json_body/2,\n format_error/2\n]).\n\n-import(ered_nodes, [\n nodeid_to_pid/2\n]).\n-import(ered_nodered_comm, [\n websocket_name_from_request/1\n]).\n-import(ered_messages, [\n create_outgoing_msg/1\n]).\n\ninit(Req, State) ->\n {cowboy_rest, Req, State}.\n\nallowed_methods(Req, State) ->\n {[<<\"POST\">>], Req, State}.\n\ncontent_types_accepted(Req, State) ->\n {\n [\n {<<\"application/json\">>, handle_json_body},\n {<<\"application/json; charset=utf-8\">>, handle_json_body}\n ],\n Req,\n State\n }.\n\nhandle_json_body(Req, State) ->\n Resp = cowboy_req:set_resp_body(<<\"OK\">>, Req),\n WsName = websocket_name_from_request(Req),\n\n case cowboy_req:binding(nodeid, Req) of\n undefined ->\n ok;\n IdStr ->\n case nodeid_to_pid(WsName, IdStr) of\n {ok, Pid} ->\n gen_server:cast(Pid, create_outgoing_msg(WsName));\n {error, _} ->\n ignore\n end\n end,\n\n {true, Resp, State}.\n\nformat_error(Reason, Req) ->\n {\n [\n {<<\"error\">>, <<\"bad_request\">>},\n {<<\"reason\">>, Reason}\n ],\n Req\n }.\n```\n\ncan be defined in the module node and used in the functon node.\n\n## Code updates\n\nModule code is reload each time the flow is deployed to the server, thus updates to the module are immediately available on the server.\n\nThe advantage is that all code related to the application can be stored in the flow data and organised as a flow.","env":[]},{"id":"c4efa06c8868a6ac","type":"erlmodule","z":"442b3bf0d630e21d","name":"","module_name":"erlang_red_test_module_add","code":"-module(erlang_red_test_module_add).\n\n-export([add/2]).\n\nadd(V1,V2) when is_number(V1), is_number(V2) ->\n V1 + V2;\nadd(_,_) ->\n infinity.\n\n","x":218,"y":98,"wires":[]},{"id":"f11048ace112cc59","type":"erlmodule","z":"442b3bf0d630e21d","name":"","module_name":"erlang_red_test_module_subtract","code":"-module(erlang_red_test_module_subtract).\n\n-export([subtract/2]).\n\nsubtract(V1,V2) when is_number(V1), is_number(V2) ->\n V1 - V2;\nsubtract(_,_) ->\n infinity.\n\n","x":232,"y":152,"wires":[]},{"id":"bcee04fb6846c14a","type":"function","z":"442b3bf0d630e21d","name":"function 1","func":"Msg#{ <<\"payload\">> => erlang_red_test_module_add:add(maps:get(<<\"payload\">>,Msg), maps:get(<<\"value2\">>,Msg)) }\n\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":297,"y":531,"wires":[["9a932875c4eed899","beb2768ba33c85f3"]]},{"id":"aeedbfdc6212b89d","type":"inject","z":"442b3bf0d630e21d","name":"","props":[{"p":"payload"},{"p":"value2","v":"231","vt":"num"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"111","payloadType":"num","x":132,"y":427,"wires":[["bcee04fb6846c14a","0d5e040ea5a93d79"]]},{"id":"ac8cac1caf6a3507","type":"ut-assert-values","z":"442b3bf0d630e21d","name":"","rules":[{"p":"payload","pt":"msg","t":"eql","to":"-2033","tot":"num"}],"x":899,"y":657.5,"wires":[[]]},{"id":"9a932875c4eed899","type":"function","z":"442b3bf0d630e21d","name":"function 2","func":"Msg#{ <<\"payload\">> => erlang_red_test_module_subtract:subtract(maps:get(<<\"payload\">>,Msg), 1243) }\n\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":490,"y":635,"wires":[["8d5da91051689370","b3e32834498fdc02"]]},{"id":"8d5da91051689370","type":"function","z":"442b3bf0d630e21d","name":"function 3","func":"Msg#{ <<\"payload\">> => erlang_red_test_module_add:add(\n erlang_red_test_module_subtract:subtract(\n maps:get(<<\"payload\">>, Msg), \n 1243\n ), \n 111) \n}\n\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":665,"y":744,"wires":[["ac8cac1caf6a3507"]]},{"id":"b3e32834498fdc02","type":"ut-assert-values","z":"442b3bf0d630e21d","name":"","rules":[{"p":"payload","pt":"msg","t":"eql","to":"-901","tot":"num"}],"x":759,"y":541,"wires":[[]]},{"id":"beb2768ba33c85f3","type":"ut-assert-values","z":"442b3bf0d630e21d","name":"","rules":[{"p":"payload","pt":"msg","t":"eql","to":"342","tot":"num"}],"x":592,"y":428,"wires":[[]]},{"id":"0d5e040ea5a93d79","type":"ut-assert-values","z":"442b3bf0d630e21d","name":"","rules":[{"p":"payload","pt":"msg","t":"eql","to":"111","tot":"num"}],"x":429,"y":295,"wires":[[]]}]
@@ -0,0 +1 @@
1
+ [{"id":"13e6f82c8b9d1ff9","type":"tab","label":"[function] handle corrupt code","disabled":false,"info":"## Incorrect code handling\n\nEither the \"On Start\", \"On Stop\" or \"On Message\" tab code could be incorrect - handle that.\n","env":[{"name":"ERED_ONLY","value":"true","type":"bool"}]},{"id":"d91de7d1dc574185","type":"function","z":"13e6f82c8b9d1ff9","name":"On start function is broken","func":"%% Code here is wrapped in a fun (Msg) call\n%% fun (Msg) ->\n Msg\n%% end.\n","outputs":1,"timeout":0,"noerr":22,"initialize":"this code is broken","finalize":"","libs":[],"x":975.9999999999998,"y":903.9999999999998,"wires":[[]]},{"id":"ad590754b9e5860b","type":"inject","z":"13e6f82c8b9d1ff9","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":743,"y":853,"wires":[["d91de7d1dc574185"]]},{"id":"745cdff42a7f4a94","type":"ut-assert-debug","z":"13e6f82c8b9d1ff9","name":"","scope":["d91de7d1dc574185"],"nodeid":"d91de7d1dc574185","msgtype":"error","inverse":false,"x":929,"y":981.5,"wires":[["a5c4071c894817c8"]]},{"id":"499082d6c1e813a5","type":"function","z":"13e6f82c8b9d1ff9","name":"On message code is broken","func":"this code is broken","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":954,"y":1162,"wires":[[]]},{"id":"4e5d7ec31ac4fc81","type":"inject","z":"13e6f82c8b9d1ff9","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":725.0000000000002,"y":1111.0000000000002,"wires":[["499082d6c1e813a5"]]},{"id":"9a322bb94698aba1","type":"ut-assert-debug","z":"13e6f82c8b9d1ff9","name":"","scope":["499082d6c1e813a5"],"nodeid":"499082d6c1e813a5","msgtype":"error","inverse":false,"x":898.0000000000002,"y":1227.5000000000002,"wires":[["8010146b02a11c7a"]]},{"id":"bfdf612d581c6537","type":"function","z":"13e6f82c8b9d1ff9","name":"On stop code is broken","func":"%% non empty code","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"this code is broken","libs":[],"x":966,"y":1457,"wires":[[]]},{"id":"d2cdf70515beea42","type":"inject","z":"13e6f82c8b9d1ff9","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":747.0000000000002,"y":1406.0000000000002,"wires":[["bfdf612d581c6537"]]},{"id":"87d341bd9941f17b","type":"ut-assert-debug","z":"13e6f82c8b9d1ff9","name":"","scope":["bfdf612d581c6537"],"nodeid":"499082d6c1e813a5","msgtype":"error","inverse":false,"x":900.0000000000002,"y":1522.5000000000002,"wires":[["16a684a6a6a4c1b9"]]},{"id":"64af25711170b21d","type":"function","z":"13e6f82c8b9d1ff9","name":"On message code is empty","func":"","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1524,"y":1165,"wires":[[]]},{"id":"b840d4345d9cf807","type":"inject","z":"13e6f82c8b9d1ff9","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1295.0000000000002,"y":1114.0000000000002,"wires":[["64af25711170b21d"]]},{"id":"95ddd111838b531f","type":"ut-assert-debug","z":"13e6f82c8b9d1ff9","name":"","scope":["64af25711170b21d"],"nodeid":"499082d6c1e813a5","msgtype":"error","inverse":false,"x":1458.0000000000002,"y":1230.5000000000002,"wires":[["41f3b0a796fb5791","da11bba1cc74cd57"]]},{"id":"41f3b0a796fb5791","type":"ClientCode","z":"13e6f82c8b9d1ff9","name":"","clientcode":"console.log(msg)\nlet ary = Object.keys(msg).map( d => {\n return [d, msg[d]]\n})\n\nconsole.log(ary)\n\nnode.send(msg)","format":"javascript","x":1852,"y":1304,"wires":[[]]},{"id":"a5c4071c894817c8","type":"ut-assert-values","z":"13e6f82c8b9d1ff9","name":"","ignore_failure_if_succeed":false,"rules":[{"p":"payload['level']","pt":"msg","t":"eql","to":"20","tot":"num"},{"p":"payload.id","pt":"msg","t":"eql","to":"d91de7d1dc574185","tot":"str"},{"p":"payload.format","pt":"msg","t":"eql","to":"object","tot":"str"}],"x":1296,"y":940,"wires":[[]]},{"id":"8010146b02a11c7a","type":"ut-assert-values","z":"13e6f82c8b9d1ff9","name":"","ignore_failure_if_succeed":false,"rules":[{"p":"payload['level']","pt":"msg","t":"eql","to":"20","tot":"num"},{"p":"payload.id","pt":"msg","t":"eql","to":"499082d6c1e813a5","tot":"str"},{"p":"payload.format","pt":"msg","t":"eql","to":"object","tot":"str"}],"x":1221,"y":1187,"wires":[[]]},{"id":"da11bba1cc74cd57","type":"ut-assert-values","z":"13e6f82c8b9d1ff9","name":"","ignore_failure_if_succeed":false,"rules":[{"p":"payload['level']","pt":"msg","t":"eql","to":"20","tot":"num"},{"p":"payload.id","pt":"msg","t":"eql","to":"64af25711170b21d","tot":"str"},{"p":"payload.format","pt":"msg","t":"eql","to":"object","tot":"str"}],"x":1845,"y":1212,"wires":[[]]},{"id":"16a684a6a6a4c1b9","type":"ut-assert-values","z":"13e6f82c8b9d1ff9","name":"","ignore_failure_if_succeed":false,"rules":[{"p":"payload['level']","pt":"msg","t":"eql","to":"20","tot":"num"},{"p":"payload.id","pt":"msg","t":"eql","to":"bfdf612d581c6537","tot":"str"},{"p":"payload.format","pt":"msg","t":"eql","to":"object","tot":"str"}],"x":1331,"y":1456,"wires":[[]]}]
@@ -0,0 +1 @@
1
+ [{"id":"49c0a3ed69d61f56","type":"tab","label":"[function] return values are important","disabled":false,"info":"## Function nodes return values\n\nFunction nodes **must** return a Msg object or an array of message objects. Or an `undefined` token to indicate that a particular output port does not receive any message.\n\n","env":[{"name":"ERED_ONLY","value":"true","type":"bool"}]},{"id":"12ac51f64b58dfc0","type":"inject","z":"49c0a3ed69d61f56","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":206.5,"y":210.25,"wires":[["c7daf1deafbe05ce"]]},{"id":"c7daf1deafbe05ce","type":"function","z":"49c0a3ed69d61f56","name":"return a tuple","func":"{return, a, tuple}","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":438.75,"y":210.25,"wires":[["19eeb5692e6ca30b"]]},{"id":"19eeb5692e6ca30b","type":"ut-assert-failure","z":"49c0a3ed69d61f56","name":"","x":682,"y":210.25,"wires":[]},{"id":"aa218d7c915b496e","type":"catch","z":"49c0a3ed69d61f56","name":"","scope":["c7daf1deafbe05ce"],"uncaught":false,"x":438.75,"y":152.75,"wires":[["8b4ba4957e656594"]]},{"id":"8b4ba4957e656594","type":"ut-assert-success","z":"49c0a3ed69d61f56","name":"","count":1,"x":682,"y":152.75,"wires":[]},{"id":"a26838b467b5028a","type":"inject","z":"49c0a3ed69d61f56","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":206.5,"y":381.25,"wires":[["490e9a54ac06c84f"]]},{"id":"490e9a54ac06c84f","type":"function","z":"49c0a3ed69d61f56","name":"return a number","func":"1234","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":438.75,"y":381.25,"wires":[["5f22f9fe9317ee5d"]]},{"id":"5f22f9fe9317ee5d","type":"ut-assert-failure","z":"49c0a3ed69d61f56","name":"","x":682,"y":381.25,"wires":[]},{"id":"bbfcc0d1721e47cb","type":"catch","z":"49c0a3ed69d61f56","name":"","scope":["490e9a54ac06c84f"],"uncaught":false,"x":438.75,"y":314,"wires":[["bfceb15c851e4328"]]},{"id":"bfceb15c851e4328","type":"ut-assert-success","z":"49c0a3ed69d61f56","name":"","count":1,"x":682,"y":314,"wires":[]},{"id":"8918037f671145ac","type":"inject","z":"49c0a3ed69d61f56","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":206.5,"y":563.25,"wires":[["a47ef32a51d8bf82"]]},{"id":"a47ef32a51d8bf82","type":"function","z":"49c0a3ed69d61f56","name":"return a string","func":"\"a string\"","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":438.75,"y":563.25,"wires":[["5dfa4a56e733f5ba"]]},{"id":"5dfa4a56e733f5ba","type":"ut-assert-failure","z":"49c0a3ed69d61f56","name":"","x":682,"y":563.25,"wires":[]},{"id":"b0ef2b90f4a6b1c3","type":"catch","z":"49c0a3ed69d61f56","name":"","scope":["a47ef32a51d8bf82"],"uncaught":false,"x":438.75,"y":492,"wires":[["b8a6187dcb76bdf7"]]},{"id":"b8a6187dcb76bdf7","type":"ut-assert-success","z":"49c0a3ed69d61f56","name":"","count":1,"x":682,"y":492,"wires":[]},{"id":"10a49c20a6ab2aaa","type":"inject","z":"49c0a3ed69d61f56","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":206.5,"y":756.25,"wires":[["7e159d8f8bc7bd14"]]},{"id":"7e159d8f8bc7bd14","type":"function","z":"49c0a3ed69d61f56","name":"return a binary","func":"<<\"a binary\">>\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":438.75,"y":756.25,"wires":[["35011055e6d9f4ed"]]},{"id":"35011055e6d9f4ed","type":"ut-assert-failure","z":"49c0a3ed69d61f56","name":"","x":682,"y":756.25,"wires":[]},{"id":"e63faf6763878e3d","type":"catch","z":"49c0a3ed69d61f56","name":"","scope":["7e159d8f8bc7bd14"],"uncaught":false,"x":438.75,"y":687,"wires":[["8725edd697fb3efe"]]},{"id":"8725edd697fb3efe","type":"ut-assert-success","z":"49c0a3ed69d61f56","name":"","count":1,"x":682,"y":687,"wires":[]},{"id":"247d5be402ea2964","type":"inject","z":"49c0a3ed69d61f56","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":206.5,"y":930.25,"wires":[["675f2d9d34e1f52a"]]},{"id":"675f2d9d34e1f52a","type":"function","z":"49c0a3ed69d61f56","name":"return a empty tuple","func":"{}","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":438.75,"y":930.25,"wires":[["adb406494cd4a683"]]},{"id":"adb406494cd4a683","type":"ut-assert-failure","z":"49c0a3ed69d61f56","name":"","x":682,"y":930.25,"wires":[]},{"id":"01b540eded3c9aa3","type":"catch","z":"49c0a3ed69d61f56","name":"","scope":["675f2d9d34e1f52a"],"uncaught":false,"x":438.75,"y":864,"wires":[["b82a91361036f798"]]},{"id":"b82a91361036f798","type":"ut-assert-success","z":"49c0a3ed69d61f56","name":"","count":1,"x":682,"y":864,"wires":[]}]
@@ -0,0 +1 @@
1
+ [{"id":"6dd3a5754f83dc2e","type":"tab","label":"[function] set node context ","disabled":false,"info":"## Function Node Context\n\nBe able to set context between calls to the function node using the NodeDef parameter.\n\nThis does not work since the underlying implementation is async - meaning the function is triggered by a message and the results is sent as another message to the function node.\n\nIn the meantime, another message is received that uses an older context becase the updated context as not yet been sent back to the function node - from a previous message.\n\nHence this is a pending test that should be done down the road.\n\nMy preference would be to have a \"synchronised execution\" option on the function node so that it can be deactivated to speed up the function node.\n\nIf the function node only acts on the message, then there needs to be no serialisation of the execution.","env":[{"name":"ERED_PENDING","value":"true","type":"bool"}]},{"id":"bc538fc8417872a7","type":"inject","z":"6dd3a5754f83dc2e","name":"","props":[{"p":"counter","v":"0","vt":"num"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":257,"y":600.8392333984375,"wires":[["f243244784e79961"]]},{"id":"f243244784e79961","type":"change","z":"6dd3a5754f83dc2e","name":"update counter","rules":[{"t":"set","p":"payload","pt":"msg","to":"counter","tot":"msg"},{"t":"set","p":"counter","pt":"msg","to":"$$.counter + 1","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":501.5714111328125,"y":742.8392333984375,"wires":[["2c8c10171634cee5","e1e7f366de17a26c"]]},{"id":"2c8c10171634cee5","type":"switch","z":"6dd3a5754f83dc2e","name":"limit to 10_000 messages","property":"payload","propertyType":"msg","rules":[{"t":"lt","v":"10000","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":512.5714111328125,"y":511.9999542236328,"wires":[["f243244784e79961"]]},{"id":"e1e7f366de17a26c","type":"function","z":"6dd3a5754f83dc2e","name":"update context of Node","func":"#{ '_counter' := C } = NodeDef,\n{ \n NodeDef#{ '_counter' => C + 1}, \n Msg#{ <<\"payload\">> => C } \n}\n","outputs":1,"timeout":0,"noerr":0,"initialize":"%% Code added here will be run once\n%% whenever the node is started.\nNodeDef#{ '_counter' => 0 }","finalize":"","libs":[],"x":844,"y":600,"wires":[[]]}]
@@ -0,0 +1 @@
1
+ [{"id":"3bba732ae17b01a9","type":"tab","label":"[function] speaks Erlang","disabled":false,"info":"# Funtion node speaks Erlang \n\nI guess this would be an Erlang-Red only test. It's the function node now styled in Erlang code and only Erlang Code.\n\n## On Start and On Stop tabs\n\nImportant to note are the \"On Start\" and \"On Stop\" tabs in the function node. These can alter the definition of the node by returning a `NodeDef` map. In fact, they have to return the NodeDef map else bad things will happen.\n\nIf this is confusing then best not to use the start and stop tabs in the function definition.\n\nThe code found in the \"On Start\" and \"On Stop\" tabs is wrapped inside the following function definition:\n\n```erlang\nfun(NodeDef, Msg) -> \n %% code here\nend.\n```\n\nThat function is **required** to return the NodeDef argument (it's just a map) as it was passed in or altered. The Msg maps only contains a reference to the websocket - usefully for updating status information of the node.\n\n## On Message tab\n\nThe code in the \"On Message\" tab is also wrapped in a funtion with the following signature:\n\n```erlang\nfun(NodeDef, Msg) -> \n %% code here\nend.\n```\n\nThe \"On Message\" code is **required** to return one of:\n\n- `Msg` - a single message object which is sent to its first output port\n- `undefined` - single atom value of undefined indicates that the function node has no message to be passed on\n- `[Msg,undefined,...]` - a list of either maps or undefined atom. The list is used to define outputs for multiple output ports. See this [test](https://flows.red-erik.org/f/c5f513bc380bc30a) for more details.\n\nAny other return value will lead to bad things happening, what these things are remains unclear. See this [test](https://flows.red-erik.org/f/49c0a3ed69d61f56) for more details.\n\n","env":[{"name":"ERED_ONLY","value":"true","type":"bool"}]},{"id":"6080018c8cb9548a","type":"group","z":"3bba732ae17b01a9","name":"handle functions with no output ports","style":{"label":true},"nodes":["ddf62e1870de423c","08b00673ab69fa2a"],"x":70,"y":340,"w":311,"h":232},{"id":"77d7ebb1b0dbc1f2","type":"group","z":"3bba732ae17b01a9","name":"single output port","style":{"label":true},"nodes":["8635e881fe0a171d","f9fb40d63b894db4","91c695565075cf5b"],"x":470,"y":258,"w":343,"h":436.5},{"id":"8635e881fe0a171d","type":"inject","z":"3bba732ae17b01a9","g":"77d7ebb1b0dbc1f2","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":576,"y":299,"wires":[["f9fb40d63b894db4"]]},{"id":"f9fb40d63b894db4","type":"function","z":"3bba732ae17b01a9","g":"77d7ebb1b0dbc1f2","name":"function 2","func":"%% Code is called in a function wrapper:\n%% fun (NodeDef, Msg) -> .... end.\n%% and must return a Msg map.\n\nMsg2 = maps:put(<<\"payload\">>, \"hello world\", Msg),\nmaps:put(<<\"start_value\">>, maps:get('_start_was_called', NodeDef), Msg2)\n\n","outputs":1,"timeout":0,"noerr":0,"initialize":"%% Code added here will be run once\n%% whenever the node is started.\n%% This gets wrapped in a function definition:\n%% fun (NodeDef,Msg) -> ... end\n%% and must return a NodeDef map.\n\n%% ered_nodered_comm:send_out_debug_msg(NodeDef, Msg, <<\"function started\">>, normal),\n\nmaps:put('_start_was_called', 10, NodeDef)\n","finalize":"%% Code added here will be run once\n%% whenever the node is started.\n%% This gets wrapped in a function definition:\n%% fun (NodeDef,Msg) -> ... end\n%% and must return a NodeDef map.\n\nered_nodered_comm:send_out_debug_msg(NodeDef, Msg, <<\"function stopped\">>, warning),\n\nNodeDef\n","libs":[],"x":633,"y":486,"wires":[["91c695565075cf5b"]]},{"id":"91c695565075cf5b","type":"ut-assert-values","z":"3bba732ae17b01a9","g":"77d7ebb1b0dbc1f2","name":"","rules":[{"p":"payload","pt":"msg","t":"eql","to":"hello world","tot":"str"},{"p":"start_value","pt":"msg","t":"eql","to":"10","tot":"num"}],"x":707,"y":653.5,"wires":[[]]},{"id":"ddf62e1870de423c","type":"function","z":"3bba732ae17b01a9","g":"6080018c8cb9548a","name":"function 1","func":"%% Code is called in a function wrapper:\n%% fun (NodeDef, Msg) -> .... end.\n%% and must return a Msg map.\n\nMsg2 = maps:put(<<\"payload\">>, \"hello world\", Msg),\nmaps:put(<<\"start_value\">>, maps:get('_start_was_called', NodeDef), Msg2)\n\n","outputs":0,"timeout":0,"noerr":0,"initialize":"%% Code added here will be run once\n%% whenever the node is started.\n%% This gets wrapped in a function definition:\n%% fun (NodeDef,Msg) -> ... end\n%% and must return a NodeDef map.\n\n%% ered_nodered_comm:send_out_debug_msg(NodeDef, Msg, <<\"function started\">>, normal),\n\nmaps:put('_start_was_called', 10, NodeDef)\n","finalize":"%% Code added here will be run once\n%% whenever the node is started.\n%% This gets wrapped in a function definition:\n%% fun (NodeDef,Msg) -> ... end\n%% and must return a NodeDef map.\n\nered_nodered_comm:send_out_debug_msg(NodeDef, Msg, <<\"function stopped\">>, warning),\n\nNodeDef\n","libs":[],"x":295,"y":531,"wires":[]},{"id":"08b00673ab69fa2a","type":"inject","z":"3bba732ae17b01a9","g":"6080018c8cb9548a","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":176,"y":381,"wires":[["ddf62e1870de423c"]]}]
@@ -0,0 +1 @@
1
+ [{"id":"d97b4eeb4ce93f0b","type":"tab","label":"[function] supervisor interaction","disabled":false,"info":"## Function versus Supervisor Node - the battle of the Titans.\n\nHow to combine function nodes and supervisor nodes?\n\nBoth of these nodes create so many sub-processes, that it really is an Herculean effort to handle all possible uses cases. Just to think of a few:\n\n- Supervisor supervises two function nodes, one goes down and has \"one for all\" restart policy. The function nodes have spun up many processes because they generate a process per message. How to stop all these subprocesses of the function nodes?\n\n- Function node has timeout sent and times out. Does that mean the entire node fails and the supervisor should restart it? If there is no supervisor to restart the function node, what does it do then?\n\n## Scenarios\n\n- Without supervisor\n\n - Function node timeouts out\n - kill all subprocesses?\n - does the node die?\n - kill only the single function execution?","env":[{"name":"ERED_TIMEOUT","value":"10","type":"num"},{"name":"ERED_NOT_EUNIT","value":"true","type":"bool"},{"name":"ERED_ONLY","value":"true","type":"bool"}]},{"id":"6adce2d9100dbbc8","type":"group","z":"d97b4eeb4ce93f0b","name":"no supervisor","style":{"label":true},"nodes":["bc95ad55c8bf71e5","ecdb879db06be5b4","d0a2af3f953cd151","f4c1557ae869cd5d","69d38978303d7e16"],"x":299,"y":218.5,"w":697,"h":160.75},{"id":"04586e23cbceab99","type":"group","z":"d97b4eeb4ce93f0b","name":"restart one-for-one","style":{"label":true},"nodes":["aa4740bbcd60b01c","c8709d14b8a4779f","df8d703ede1b70d8","43d70610c6d0c6a3","e7ecae2332e26508","64bb065a9a7c72db"],"x":171,"y":632,"w":1047,"h":361.75},{"id":"bc95ad55c8bf71e5","type":"function","z":"d97b4eeb4ce93f0b","g":"6adce2d9100dbbc8","name":"function 1","func":"io:format( \"I was started with ~p~n\",[self()]),\ntimer:sleep(5_000),\nexit(self(), absolute_filaure)\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":647,"y":338.25,"wires":[["f4c1557ae869cd5d"]]},{"id":"ecdb879db06be5b4","type":"inject","z":"d97b4eeb4ce93f0b","g":"6adce2d9100dbbc8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":405,"y":259.5,"wires":[["bc95ad55c8bf71e5","d0a2af3f953cd151"]]},{"id":"d0a2af3f953cd151","type":"function","z":"d97b4eeb4ce93f0b","g":"6adce2d9100dbbc8","name":"function 3","func":"io:format( \"I was started with timeout ~p~n\",[self()]),\ntimer:sleep(10_000),\nexit(self(), absolute_filaure)\n","outputs":1,"timeout":"5","noerr":0,"initialize":"","finalize":"","libs":[],"x":646,"y":259.5,"wires":[["69d38978303d7e16"]]},{"id":"aa4740bbcd60b01c","type":"inject","z":"d97b4eeb4ce93f0b","g":"04586e23cbceab99","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":277,"y":868,"wires":[["c8709d14b8a4779f","df8d703ede1b70d8"]]},{"id":"c8709d14b8a4779f","type":"function","z":"d97b4eeb4ce93f0b","g":"04586e23cbceab99","name":"function with long running process - 5 second sleep and no node timeout","func":"io:format( \"I was started with as ~p with 5s sleep~n\",[self()]),\ntimer:sleep(5_000),\nio:format( \"Good morning, completed my sleep ~p ~n\",[self()]),\nMsg","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":696,"y":952.75,"wires":[["e7ecae2332e26508"]]},{"id":"df8d703ede1b70d8","type":"function","z":"d97b4eeb4ce93f0b","g":"04586e23cbceab99","name":"function with timeout after two seconds","func":"io:format( \"I was started with timeout ~p~n\",[self()]),\ntimer:sleep(10_000),\nio:format( \"slept ten secons, now exiting~n\",[]),\nexit(self(), absolute_filaure)\n","outputs":1,"timeout":"2","noerr":0,"initialize":"","finalize":"","libs":[],"x":596,"y":782.75,"wires":[["64bb065a9a7c72db"]]},{"id":"43d70610c6d0c6a3","type":"erlsupervisor","z":"d97b4eeb4ce93f0b","g":"04586e23cbceab99","name":"","scope":["c8709d14b8a4779f","df8d703ede1b70d8"],"supervisor_type":"static","strategy":"one_for_one","auto_shutdown":"never","intensity":"5","period":"15","child_type":"worker","child_restart":"permanent","child_shutdown":"brutal_kill","child_shutdown_timeout":"0","x":549,"y":673,"wires":[[]]},{"id":"f4c1557ae869cd5d","type":"ut-assert-failure","z":"d97b4eeb4ce93f0b","g":"6adce2d9100dbbc8","name":"","x":900,"y":338.25,"wires":[]},{"id":"69d38978303d7e16","type":"ut-assert-failure","z":"d97b4eeb4ce93f0b","g":"6adce2d9100dbbc8","name":"","x":900,"y":259.5,"wires":[]},{"id":"e7ecae2332e26508","type":"ut-assert-success","z":"d97b4eeb4ce93f0b","g":"04586e23cbceab99","name":"","count":1,"x":1102,"y":952.75,"wires":[]},{"id":"64bb065a9a7c72db","type":"ut-assert-failure","z":"d97b4eeb4ce93f0b","g":"04586e23cbceab99","name":"","x":1102,"y":782.75,"wires":[]}]
@@ -0,0 +1 @@
1
+ [{"id":"c5f513bc380bc30a","type":"tab","label":"[function] support multiple outputs","disabled":false,"info":"## Function node support multiple outputs\n\nMultiple output ports are addressed using a list as return value of the function. The list can be longer or shorter than the actual output port count.\n\nAlso respect `undefined` as an indicator that there is no data to be sent on a specific port.\n\nUsing `undefiend` because that is also the same key word for Node-RED when specifying an array (aka list) as return value and some slots shouldn't get data.","env":[{"name":"ERED_PENDING","value":"false","type":"bool"},{"name":"ERED_ONLY","value":"true","type":"bool"}]},{"id":"9cb3675ec715d003","type":"group","z":"c5f513bc380bc30a","name":"function generated a single message","style":{"label":true},"nodes":["99a0baa1793f0dd1","76e2bf5583bbede4","8ece321b5ccae3eb","fb27204856172c17","2f9fa1c08b03cd73","027dd925bdff5dc0","6678a62c7bfef1af"],"x":102,"y":199.5,"w":736,"h":310},{"id":"8420fb2b03bc6ff2","type":"group","z":"c5f513bc380bc30a","name":"function with undefined","style":{"label":true},"nodes":["5e6f29f5f19f96d6","ca42f1a951e6799e","93e980ac0c9d328e","3b291d3f3533dab8","7e0cb601b0dc0f85","a3d4e24eeee55b2b","5e435bc74890ae75"],"x":105,"y":571,"w":717,"h":294},{"id":"edd4648fd0386343","type":"group","z":"c5f513bc380bc30a","name":"partial list with undefined","style":{"label":true},"nodes":["a9d333f12acd1a90","c688af41c73aa885","12c34fb23c932829","3a08597abbd4dc70","8a7abbb925382332","7b8718e4e0deb3bf","ab1e12ba4c8cd598"],"x":93,"y":902.5,"w":741,"h":303},{"id":"5f95a730b6989c4b","type":"group","z":"c5f513bc380bc30a","name":"empty list as return value","style":{"label":true},"nodes":["7248b8732d320b86","aa664acff39d96cd","0d6981d5c41136e5","3fb8684626f059fc","f2fb17909c4e4d32","09a7c06a06f39140","8842302217d78ddc"],"x":99,"y":1244,"w":717,"h":301.5},{"id":"7416c3f55c2eba9f","type":"group","z":"c5f513bc380bc30a","name":"longer list than output ports","style":{"label":true},"nodes":["8966584e057f8e96","4b0717c879ceac59","abb3971f2e95389d","9ce84c1407cf616c","3eabd552265daab6","5ea401991e1b6dad","94660f4d95978c45"],"x":109,"y":1586,"w":728,"h":303},{"id":"99a0baa1793f0dd1","type":"function","z":"c5f513bc380bc30a","g":"9cb3675ec715d003","name":"function 1","func":"%% multiple outpus but only a single message\nMsg\n","outputs":5,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":436,"y":265.75,"wires":[["fb27204856172c17"],["6678a62c7bfef1af"],["027dd925bdff5dc0"],["2f9fa1c08b03cd73"],["8ece321b5ccae3eb"]]},{"id":"76e2bf5583bbede4","type":"inject","z":"c5f513bc380bc30a","g":"9cb3675ec715d003","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":208,"y":265.75,"wires":[["99a0baa1793f0dd1"]]},{"id":"8ece321b5ccae3eb","type":"ut-assert-failure","z":"c5f513bc380bc30a","g":"9cb3675ec715d003","name":"","x":722,"y":468.5,"wires":[]},{"id":"fb27204856172c17","type":"ut-assert-success","z":"c5f513bc380bc30a","g":"9cb3675ec715d003","name":"","count":1,"x":722,"y":240.5,"wires":[]},{"id":"2f9fa1c08b03cd73","type":"ut-assert-failure","z":"c5f513bc380bc30a","g":"9cb3675ec715d003","name":"","x":722,"y":411.5,"wires":[]},{"id":"027dd925bdff5dc0","type":"ut-assert-failure","z":"c5f513bc380bc30a","g":"9cb3675ec715d003","name":"","x":722,"y":354.5,"wires":[]},{"id":"6678a62c7bfef1af","type":"ut-assert-failure","z":"c5f513bc380bc30a","g":"9cb3675ec715d003","name":"","x":722,"y":297.5,"wires":[]},{"id":"5e6f29f5f19f96d6","type":"function","z":"c5f513bc380bc30a","g":"8420fb2b03bc6ff2","name":"function 2","func":"undefined","outputs":5,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":424,"y":676.5,"wires":[["5e435bc74890ae75"],["a3d4e24eeee55b2b"],["7e0cb601b0dc0f85"],["3b291d3f3533dab8"],["93e980ac0c9d328e"]]},{"id":"ca42f1a951e6799e","type":"inject","z":"c5f513bc380bc30a","g":"8420fb2b03bc6ff2","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":211,"y":676.5,"wires":[["5e6f29f5f19f96d6"]]},{"id":"93e980ac0c9d328e","type":"ut-assert-failure","z":"c5f513bc380bc30a","g":"8420fb2b03bc6ff2","name":"","x":726,"y":824,"wires":[]},{"id":"3b291d3f3533dab8","type":"ut-assert-failure","z":"c5f513bc380bc30a","g":"8420fb2b03bc6ff2","name":"","x":726,"y":771,"wires":[]},{"id":"7e0cb601b0dc0f85","type":"ut-assert-failure","z":"c5f513bc380bc30a","g":"8420fb2b03bc6ff2","name":"","x":726,"y":718,"wires":[]},{"id":"a3d4e24eeee55b2b","type":"ut-assert-failure","z":"c5f513bc380bc30a","g":"8420fb2b03bc6ff2","name":"","x":726,"y":665,"wires":[]},{"id":"5e435bc74890ae75","type":"ut-assert-failure","z":"c5f513bc380bc30a","g":"8420fb2b03bc6ff2","name":"","x":726,"y":612,"wires":[]},{"id":"a9d333f12acd1a90","type":"function","z":"c5f513bc380bc30a","g":"edd4648fd0386343","name":"function 4","func":"[Msg, undefined, Msg, undefined]","outputs":5,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":429,"y":1054.75,"wires":[["7b8718e4e0deb3bf"],["8a7abbb925382332"],["ab1e12ba4c8cd598"],["3a08597abbd4dc70"],["12c34fb23c932829"]]},{"id":"c688af41c73aa885","type":"inject","z":"c5f513bc380bc30a","g":"edd4648fd0386343","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":199,"y":1054.75,"wires":[["a9d333f12acd1a90"]]},{"id":"12c34fb23c932829","type":"ut-assert-failure","z":"c5f513bc380bc30a","g":"edd4648fd0386343","name":"","x":718,"y":1164.5,"wires":[]},{"id":"3a08597abbd4dc70","type":"ut-assert-failure","z":"c5f513bc380bc30a","g":"edd4648fd0386343","name":"","x":718,"y":1109.25,"wires":[]},{"id":"8a7abbb925382332","type":"ut-assert-failure","z":"c5f513bc380bc30a","g":"edd4648fd0386343","name":"","x":718,"y":998.75,"wires":[]},{"id":"7b8718e4e0deb3bf","type":"ut-assert-success","z":"c5f513bc380bc30a","g":"edd4648fd0386343","name":"","count":1,"x":718,"y":943.5,"wires":[]},{"id":"ab1e12ba4c8cd598","type":"ut-assert-success","z":"c5f513bc380bc30a","g":"edd4648fd0386343","name":"","count":1,"x":718,"y":1054,"wires":[]},{"id":"7248b8732d320b86","type":"function","z":"c5f513bc380bc30a","g":"5f95a730b6989c4b","name":"function 5","func":"[]","outputs":5,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":433,"y":1436.75,"wires":[["8842302217d78ddc"],["f2fb17909c4e4d32"],["09a7c06a06f39140"],["3fb8684626f059fc"],["0d6981d5c41136e5"]]},{"id":"aa664acff39d96cd","type":"inject","z":"c5f513bc380bc30a","g":"5f95a730b6989c4b","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":205,"y":1436.75,"wires":[["7248b8732d320b86"]]},{"id":"0d6981d5c41136e5","type":"ut-assert-failure","z":"c5f513bc380bc30a","g":"5f95a730b6989c4b","name":"","x":720,"y":1504.5,"wires":[]},{"id":"3fb8684626f059fc","type":"ut-assert-failure","z":"c5f513bc380bc30a","g":"5f95a730b6989c4b","name":"","x":720,"y":1449.625,"wires":[]},{"id":"f2fb17909c4e4d32","type":"ut-assert-failure","z":"c5f513bc380bc30a","g":"5f95a730b6989c4b","name":"","x":720,"y":1339.875,"wires":[]},{"id":"09a7c06a06f39140","type":"ut-assert-failure","z":"c5f513bc380bc30a","g":"5f95a730b6989c4b","name":"","x":720,"y":1394.75,"wires":[]},{"id":"8842302217d78ddc","type":"ut-assert-failure","z":"c5f513bc380bc30a","g":"5f95a730b6989c4b","name":"","x":720,"y":1285,"wires":[]},{"id":"8966584e057f8e96","type":"function","z":"c5f513bc380bc30a","g":"7416c3f55c2eba9f","name":"function 6","func":"[undefined, undefined, undefined, Msg, Msg, Msg, Msg, Msg, undefined]\n","outputs":5,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":447,"y":1822,"wires":[["3eabd552265daab6"],["abb3971f2e95389d"],["9ce84c1407cf616c"],["5ea401991e1b6dad"],["94660f4d95978c45"]]},{"id":"4b0717c879ceac59","type":"inject","z":"c5f513bc380bc30a","g":"7416c3f55c2eba9f","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":215,"y":1822,"wires":[["8966584e057f8e96"]]},{"id":"abb3971f2e95389d","type":"ut-assert-failure","z":"c5f513bc380bc30a","g":"7416c3f55c2eba9f","name":"","x":721,"y":1682.25,"wires":[]},{"id":"9ce84c1407cf616c","type":"ut-assert-failure","z":"c5f513bc380bc30a","g":"7416c3f55c2eba9f","name":"","x":721,"y":1737.5,"wires":[]},{"id":"3eabd552265daab6","type":"ut-assert-failure","z":"c5f513bc380bc30a","g":"7416c3f55c2eba9f","name":"","x":721,"y":1627,"wires":[]},{"id":"5ea401991e1b6dad","type":"ut-assert-success","z":"c5f513bc380bc30a","g":"7416c3f55c2eba9f","name":"","count":1,"x":721,"y":1792.75,"wires":[]},{"id":"94660f4d95978c45","type":"ut-assert-success","z":"c5f513bc380bc30a","g":"7416c3f55c2eba9f","name":"","count":1,"x":721,"y":1848,"wires":[]}]
@@ -0,0 +1 @@
1
+ [{"id":"bdbe94d065f3b3a6","type":"tab","label":"[function] support not returning a message","disabled":false,"info":"## Function no return\n\nFunction nodes can return a message object or not, there is no requirement to return a valid message object.\n\nIn Node-RED this is done by leaving off the \"return msg\" in the function definition.\n\nErlang-Red has made the assumption that the function always returns a value.\n\nTherefore there should be a `undefined` token for doing just that.\n\nWe use undefined as token because that is the same as Javascript and Node-RED - using undefined in an array will result in no message being sent on the corresponding output port.\n\n","env":[{"name":"ERED_PENDING","value":"false","type":"bool"},{"name":"ERED_ONLY","value":"true","type":"bool"}]},{"id":"b737c6397ee47bf0","type":"function","z":"bdbe94d065f3b3a6","name":"function 1","func":"Msg, undefined","outputs":1,"timeout":0,"noerr":2,"initialize":"","finalize":"","libs":[],"x":565,"y":320.5,"wires":[["a56ad2920885ace0"]]},{"id":"ba81fe83307f83c1","type":"inject","z":"bdbe94d065f3b3a6","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":387,"y":208,"wires":[["b737c6397ee47bf0"]]},{"id":"a56ad2920885ace0","type":"ut-assert-failure","z":"bdbe94d065f3b3a6","name":"","x":783,"y":319,"wires":[]},{"id":"5d65809aaf8ec259","type":"function","z":"bdbe94d065f3b3a6","name":"function 2","func":"Msg#{ <<\"payload\">> => hello }","outputs":1,"timeout":0,"noerr":8,"initialize":"","finalize":"","libs":[],"x":432,"y":563,"wires":[["e5432e698e4b402f"]]},{"id":"0f593e2bf460815c","type":"inject","z":"bdbe94d065f3b3a6","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":254,"y":450.5,"wires":[["5d65809aaf8ec259"]]},{"id":"e5432e698e4b402f","type":"ut-assert-values","z":"bdbe94d065f3b3a6","name":"","rules":[{"p":"payload","pt":"msg","t":"eql","to":"hello","tot":"str"}],"x":671,"y":631.5,"wires":[[]]}]
@@ -0,0 +1 @@
1
+ [{"id":"f2f61ec9fc46a468","type":"tab","label":"[function] support timeout setting","disabled":false,"info":"## Function timeout support\n\nNon-negative timeout values in seconds.\n\nNegative and zero are intrepreted as being Infinite timeout.\n","env":[{"name":"ERED_PENDING","value":"false","type":"bool"},{"name":"ERED_TIMEOUT","value":"7","type":"num"},{"name":"ERED_ONLY","value":"true","type":"bool"}]},{"id":"a2c9f90d9ea31a1f","type":"group","z":"f2f61ec9fc46a468","name":"disabled Node-RED Javascript code","style":{"label":true},"nodes":["1eee0e64c24bc099","2a05ee46ab296dc9"],"x":165,"y":1523,"w":494,"h":540},{"id":"e25627231644112e","type":"group","z":"f2f61ec9fc46a468","name":"timeout goes to debug panel if no catch caught the time out exception","style":{"label":true},"nodes":["5b347e54a92d9ff9","3e76245fbd5691b3","1fcfe383f4385b02","0e89114541b7fb2b","b5a8d6dddb17942c"],"x":161,"y":136.5,"w":960.5,"h":145},{"id":"0b1ae6a07c7f9ee1","type":"group","z":"f2f61ec9fc46a468","name":"all good, function completed before timeout - no exception, no debug","style":{"label":true},"nodes":["fd67b21de5786024","33112fdcb207fc20","9a58db73e33a0769","76a7f5738f160266","3695a84826fa554c","f2ea106b01f1a4c9","8fe028012828193d"],"x":155.5,"y":601.5,"w":969.5,"h":213},{"id":"28cbea3ee31a6c2a","type":"group","z":"f2f61ec9fc46a468","name":"timeout hits and catch handles exception","style":{"label":true},"nodes":["5186223e03d9b353","087e548f098823b0","c900bbc76f771c57","5bf64f22a8da1e1b","c589fe0cad265fb6","b4c5d5333e7fc298","0b8d34c24428d83e"],"x":161.5,"y":333,"w":960,"h":209.5},{"id":"fb9fdb40b651e3d8","type":"group","z":"f2f61ec9fc46a468","name":"all good, function completed before timeout - no exception, no debug","style":{"label":true},"nodes":["616ceb4757f22365","58d552991d0fc84b","d712e40a4c9c9ebf","9fabb5b3c93de925","0bae6e41684e87d5","375eb051e1d7e54c","e931271741768ce8"],"x":151,"y":868.5,"w":969.5,"h":213},{"id":"1eee0e64c24bc099","type":"group","z":"f2f61ec9fc46a468","g":"a2c9f90d9ea31a1f","name":"timeout of zero is infinity timeout","style":{"label":true},"nodes":["a2cf94ef446d743d","3363a0e7454b99ef","5504c9690eeecdc5"],"x":200,"y":1549,"w":433,"h":202},{"id":"2a05ee46ab296dc9","type":"group","z":"f2f61ec9fc46a468","g":"a2c9f90d9ea31a1f","name":"timeout of one","style":{"label":true},"nodes":["ee68ff84422283b9","71b45ad7258db27d","25a223e8463ca4fb"],"x":191,"y":1835,"w":422,"h":202},{"id":"5b347e54a92d9ff9","type":"function","z":"f2f61ec9fc46a468","g":"e25627231644112e","name":"one second timeout, 3 second sleep","func":"timer:sleep(3000), \nMsg\n","outputs":1,"timeout":"1","noerr":3,"initialize":"","finalize":"","libs":[],"x":577,"y":177.5,"wires":[["0e89114541b7fb2b"]]},{"id":"3e76245fbd5691b3","type":"inject","z":"f2f61ec9fc46a468","g":"e25627231644112e","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":267,"y":177.5,"wires":[["5b347e54a92d9ff9"]]},{"id":"a2cf94ef446d743d","type":"function","z":"f2f61ec9fc46a468","g":"1eee0e64c24bc099","name":"function 39","func":"var idx = 0\nwhile ( idx < 10_000_000_000 ) {\n idx++\n}\nreturn msg","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":526,"y":1590,"wires":[[]]},{"id":"3363a0e7454b99ef","type":"inject","z":"f2f61ec9fc46a468","d":true,"g":"1eee0e64c24bc099","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":306,"y":1710,"wires":[["a2cf94ef446d743d"]]},{"id":"5504c9690eeecdc5","type":"catch","z":"f2f61ec9fc46a468","g":"1eee0e64c24bc099","name":"","scope":["a2cf94ef446d743d"],"uncaught":false,"x":557,"y":1661,"wires":[[]]},{"id":"ee68ff84422283b9","type":"function","z":"f2f61ec9fc46a468","g":"2a05ee46ab296dc9","name":"function 40","func":"while(1==1){};\n\nreturn msg;\n","outputs":1,"timeout":"1","noerr":0,"initialize":"","finalize":"","libs":[],"x":517,"y":1876,"wires":[[]]},{"id":"71b45ad7258db27d","type":"inject","z":"f2f61ec9fc46a468","d":true,"g":"2a05ee46ab296dc9","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":297,"y":1996,"wires":[["ee68ff84422283b9"]]},{"id":"25a223e8463ca4fb","type":"catch","z":"f2f61ec9fc46a468","g":"2a05ee46ab296dc9","name":"","scope":["ee68ff84422283b9"],"uncaught":false,"x":534,"y":1927,"wires":[[]]},{"id":"1fcfe383f4385b02","type":"ut-assert-debug","z":"f2f61ec9fc46a468","g":"e25627231644112e","name":"","scope":["5b347e54a92d9ff9"],"nodeid":"5b347e54a92d9ff9","msgtype":"error","inverse":false,"x":642,"y":240.5,"wires":[["b5a8d6dddb17942c"]]},{"id":"0e89114541b7fb2b","type":"ut-assert-failure","z":"f2f61ec9fc46a468","g":"e25627231644112e","name":"","x":905,"y":177.5,"wires":[]},{"id":"fd67b21de5786024","type":"function","z":"f2f61ec9fc46a468","g":"0b1ae6a07c7f9ee1","name":"three second timeout, one second sleep","func":"timer:sleep(1000), \nMsg\n","outputs":1,"timeout":"3","noerr":0,"initialize":"","finalize":"","libs":[],"x":568.5,"y":710.5,"wires":[["76a7f5738f160266"]]},{"id":"33112fdcb207fc20","type":"inject","z":"f2f61ec9fc46a468","g":"0b1ae6a07c7f9ee1","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":261.5,"y":710.5,"wires":[["fd67b21de5786024"]]},{"id":"9a58db73e33a0769","type":"ut-assert-debug","z":"f2f61ec9fc46a468","g":"0b1ae6a07c7f9ee1","name":"","scope":["fd67b21de5786024"],"nodeid":"fd67b21de5786024","msgtype":"error","inverse":true,"x":633.5,"y":773.5,"wires":[["8fe028012828193d"]]},{"id":"76a7f5738f160266","type":"ut-assert-success","z":"f2f61ec9fc46a468","g":"0b1ae6a07c7f9ee1","name":"","count":1,"x":1009,"y":710.5,"wires":[]},{"id":"5186223e03d9b353","type":"function","z":"f2f61ec9fc46a468","g":"28cbea3ee31a6c2a","name":"one second timeout, 3 second sleep","func":"timer:sleep(3000), \nMsg\n","outputs":1,"timeout":"1","noerr":0,"initialize":"","finalize":"","libs":[],"x":577.5,"y":439,"wires":[["5bf64f22a8da1e1b"]]},{"id":"087e548f098823b0","type":"inject","z":"f2f61ec9fc46a468","g":"28cbea3ee31a6c2a","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":267.5,"y":439,"wires":[["5186223e03d9b353"]]},{"id":"c900bbc76f771c57","type":"ut-assert-debug","z":"f2f61ec9fc46a468","g":"28cbea3ee31a6c2a","name":"","scope":["5186223e03d9b353"],"nodeid":"5186223e03d9b353","msgtype":"error","inverse":true,"x":642.5,"y":501.5,"wires":[["0b8d34c24428d83e"]]},{"id":"5bf64f22a8da1e1b","type":"ut-assert-failure","z":"f2f61ec9fc46a468","g":"28cbea3ee31a6c2a","name":"","x":1005.5,"y":439,"wires":[]},{"id":"3695a84826fa554c","type":"catch","z":"f2f61ec9fc46a468","g":"0b1ae6a07c7f9ee1","name":"","scope":["fd67b21de5786024"],"uncaught":false,"x":461,"y":643,"wires":[["f2ea106b01f1a4c9"]]},{"id":"f2ea106b01f1a4c9","type":"ut-assert-failure","z":"f2f61ec9fc46a468","g":"0b1ae6a07c7f9ee1","name":"","x":1009,"y":642.5,"wires":[]},{"id":"c589fe0cad265fb6","type":"catch","z":"f2f61ec9fc46a468","g":"28cbea3ee31a6c2a","name":"","scope":["5186223e03d9b353"],"uncaught":false,"x":480,"y":374,"wires":[["b4c5d5333e7fc298"]]},{"id":"b4c5d5333e7fc298","type":"ut-assert-success","z":"f2f61ec9fc46a468","g":"28cbea3ee31a6c2a","name":"","count":1,"x":1005.5,"y":375,"wires":[]},{"id":"616ceb4757f22365","type":"function","z":"f2f61ec9fc46a468","g":"fb9fdb40b651e3d8","name":"zero second timeout, three second sleep","func":"timer:sleep(3000), \nMsg\n","outputs":1,"timeout":"0","noerr":0,"initialize":"","finalize":"","libs":[],"x":564,"y":977.5,"wires":[["9fabb5b3c93de925"]]},{"id":"58d552991d0fc84b","type":"inject","z":"f2f61ec9fc46a468","g":"fb9fdb40b651e3d8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":257,"y":977.5,"wires":[["616ceb4757f22365"]]},{"id":"d712e40a4c9c9ebf","type":"ut-assert-debug","z":"f2f61ec9fc46a468","g":"fb9fdb40b651e3d8","name":"","scope":["fd67b21de5786024"],"nodeid":"fd67b21de5786024","msgtype":"error","inverse":true,"x":629,"y":1040.5,"wires":[["e931271741768ce8"]]},{"id":"9fabb5b3c93de925","type":"ut-assert-success","z":"f2f61ec9fc46a468","g":"fb9fdb40b651e3d8","name":"","count":1,"x":1004.5,"y":977.5,"wires":[]},{"id":"0bae6e41684e87d5","type":"catch","z":"f2f61ec9fc46a468","g":"fb9fdb40b651e3d8","name":"","scope":["616ceb4757f22365"],"uncaught":false,"x":456.5,"y":910,"wires":[["375eb051e1d7e54c"]]},{"id":"375eb051e1d7e54c","type":"ut-assert-failure","z":"f2f61ec9fc46a468","g":"fb9fdb40b651e3d8","name":"","x":1004.5,"y":909.5,"wires":[]},{"id":"0b8d34c24428d83e","type":"ut-assert-failure","z":"f2f61ec9fc46a468","g":"28cbea3ee31a6c2a","name":"","x":1005.5,"y":501.5,"wires":[]},{"id":"8fe028012828193d","type":"ut-assert-failure","z":"f2f61ec9fc46a468","g":"0b1ae6a07c7f9ee1","name":"","x":1009,"y":773.5,"wires":[]},{"id":"e931271741768ce8","type":"ut-assert-failure","z":"f2f61ec9fc46a468","g":"fb9fdb40b651e3d8","name":"","x":1004.5,"y":1040.5,"wires":[]},{"id":"b5a8d6dddb17942c","type":"ut-assert-values","z":"f2f61ec9fc46a468","g":"e25627231644112e","name":"","ignore_failure_if_succeed":false,"rules":[{"p":"debug.nodeid","pt":"msg","t":"eql","to":"5b347e54a92d9ff9","tot":"str"},{"p":"debug.type","pt":"msg","t":"eql","to":"error","tot":"str"},{"p":"payload['level']","pt":"msg","t":"eql","to":"20","tot":"num"},{"p":"payload.format","pt":"msg","t":"eql","to":"object","tot":"str"},{"p":"payload.id","pt":"msg","t":"eql","to":"5b347e54a92d9ff9","tot":"str"},{"p":"payload.name","pt":"msg","t":"eql","to":"one second timeout, 3 second sleep","tot":"str"},{"p":"payload.msg.error_msg","pt":"msg","t":"eql","to":"unexpected exit","tot":"str"}],"x":1015.5,"y":240.5,"wires":[[]]}]
@@ -0,0 +1 @@
1
+ [{"id":"0c35d269ca7178c6","type":"tab","label":"[function] supports completed node","disabled":false,"info":"## Function node and message completion\n\nWhen has a function node completed with a message?\n\nIf that message was successfully handled, no timeout or illegal exit.\n\n","env":[{"name":"ERED_TIMEOUT","value":"8","type":"num"},{"name":"ERED_ONLY","value":"true","type":"bool"}]},{"id":"f20328830b376b23","type":"group","z":"0c35d269ca7178c6","name":"successfully handled message","style":{"label":true},"nodes":["e854140ab6f0d21c","731d488b92cd68f1","b93f2509fb2a5bcc","55336fe53a868e93","6e9d36928e0ca025"],"x":207,"y":223.5,"w":760,"h":176.75},{"id":"c165d28f8005d7c4","type":"group","z":"0c35d269ca7178c6","name":"time out - no complete notification","style":{"label":true},"nodes":["0cdc8b8fcada2b64","084ee5f93fe80d0a","381a28ec2492ce63","aa5971bdea0f354c","1b7b76e14556c769","5a408c1c86dbbb6a","4b361478f333e8e2"],"x":207,"y":482.5,"w":1028,"h":234},{"id":"db361fcb415409b2","type":"group","z":"0c35d269ca7178c6","name":"bad arith exception - no complete","style":{"label":true},"nodes":["f5af604e178c08c0","4a8146bae13b5087","67c13f891a224fef","e1e0adb799026724","c6a558ec0e5e8ec9","9cd1030d04babc9d","3c162b8fa00c4058"],"x":208,"y":763.5,"w":1027,"h":234},{"id":"e854140ab6f0d21c","type":"function","z":"0c35d269ca7178c6","g":"f20328830b376b23","name":"function 2","func":" Msg\n","outputs":1,"timeout":0,"noerr":1,"initialize":"","finalize":"","libs":[],"x":577,"y":359.25,"wires":[["6e9d36928e0ca025"]]},{"id":"731d488b92cd68f1","type":"complete","z":"0c35d269ca7178c6","g":"f20328830b376b23","name":"","scope":["e854140ab6f0d21c"],"uncaught":false,"x":584,"y":264.5,"wires":[["55336fe53a868e93"]]},{"id":"b93f2509fb2a5bcc","type":"inject","z":"0c35d269ca7178c6","g":"f20328830b376b23","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":313,"y":359.25,"wires":[["e854140ab6f0d21c"]]},{"id":"55336fe53a868e93","type":"ut-assert-success","z":"0c35d269ca7178c6","g":"f20328830b376b23","name":"","count":1,"x":848,"y":264.5,"wires":[]},{"id":"6e9d36928e0ca025","type":"ut-assert-success","z":"0c35d269ca7178c6","g":"f20328830b376b23","name":"","count":1,"x":851,"y":359.25,"wires":[]},{"id":"0cdc8b8fcada2b64","type":"function","z":"0c35d269ca7178c6","g":"c165d28f8005d7c4","name":"timeout - no complete","func":"timer:sleep(2_000)\n","outputs":1,"timeout":"1","noerr":0,"initialize":"","finalize":"","libs":[],"x":617,"y":613.5,"wires":[["1b7b76e14556c769"]]},{"id":"084ee5f93fe80d0a","type":"complete","z":"0c35d269ca7178c6","g":"c165d28f8005d7c4","name":"","scope":["0cdc8b8fcada2b64"],"uncaught":false,"x":584,"y":523.5,"wires":[["aa5971bdea0f354c"]]},{"id":"381a28ec2492ce63","type":"inject","z":"0c35d269ca7178c6","g":"c165d28f8005d7c4","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":313,"y":613.5,"wires":[["0cdc8b8fcada2b64"]]},{"id":"aa5971bdea0f354c","type":"ut-assert-failure","z":"0c35d269ca7178c6","g":"c165d28f8005d7c4","name":"","x":883,"y":523.5,"wires":[]},{"id":"1b7b76e14556c769","type":"ut-assert-failure","z":"0c35d269ca7178c6","g":"c165d28f8005d7c4","name":"","x":890,"y":613.5,"wires":[]},{"id":"5a408c1c86dbbb6a","type":"ut-assert-debug","z":"0c35d269ca7178c6","g":"c165d28f8005d7c4","name":"","scope":["0cdc8b8fcada2b64"],"nodeid":"0cdc8b8fcada2b64","msgtype":"error","inverse":false,"x":729,"y":675.5,"wires":[["4b361478f333e8e2"]]},{"id":"f5af604e178c08c0","type":"function","z":"0c35d269ca7178c6","g":"db361fcb415409b2","name":"divide by zero error","func":"1 / 0 ","outputs":1,"timeout":"0","noerr":0,"initialize":"","finalize":"","libs":[],"x":608,"y":894.5,"wires":[["c6a558ec0e5e8ec9"]]},{"id":"4a8146bae13b5087","type":"complete","z":"0c35d269ca7178c6","g":"db361fcb415409b2","name":"","scope":["f5af604e178c08c0"],"uncaught":false,"x":585,"y":804.5,"wires":[["e1e0adb799026724"]]},{"id":"67c13f891a224fef","type":"inject","z":"0c35d269ca7178c6","g":"db361fcb415409b2","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":314,"y":894.5,"wires":[["f5af604e178c08c0"]]},{"id":"e1e0adb799026724","type":"ut-assert-failure","z":"0c35d269ca7178c6","g":"db361fcb415409b2","name":"","x":884,"y":804.5,"wires":[]},{"id":"c6a558ec0e5e8ec9","type":"ut-assert-failure","z":"0c35d269ca7178c6","g":"db361fcb415409b2","name":"","x":891,"y":894.5,"wires":[]},{"id":"9cd1030d04babc9d","type":"ut-assert-debug","z":"0c35d269ca7178c6","g":"db361fcb415409b2","name":"","scope":["f5af604e178c08c0"],"nodeid":"f5af604e178c08c0","msgtype":"error","inverse":false,"x":720,"y":956.5,"wires":[["3c162b8fa00c4058"]]},{"id":"4b361478f333e8e2","type":"ut-assert-values","z":"0c35d269ca7178c6","g":"c165d28f8005d7c4","name":"","ignore_failure_if_succeed":false,"rules":[{"p":"debug.nodeid","pt":"msg","t":"eql","to":"0cdc8b8fcada2b64","tot":"str"},{"p":"payload['level']","pt":"msg","t":"eql","to":"20","tot":"num"},{"p":"payload.id","pt":"msg","t":"eql","to":"0cdc8b8fcada2b64","tot":"str"},{"p":"payload.name","pt":"msg","t":"eql","to":"timeout - no complete","tot":"str"},{"p":"payload.msg.error_msg","pt":"msg","t":"eql","to":"unexpected exit","tot":"str"}],"x":1129,"y":675.5,"wires":[[]]},{"id":"3c162b8fa00c4058","type":"ut-assert-values","z":"0c35d269ca7178c6","g":"db361fcb415409b2","name":"","ignore_failure_if_succeed":false,"rules":[{"p":"debug.nodeid","pt":"msg","t":"eql","to":"f5af604e178c08c0","tot":"str"},{"p":"payload['level']","pt":"msg","t":"eql","to":"20","tot":"num"},{"p":"payload.id","pt":"msg","t":"eql","to":"f5af604e178c08c0","tot":"str"},{"p":"payload.name","pt":"msg","t":"eql","to":"divide by zero error","tot":"str"},{"p":"payload.msg.error_msg","pt":"msg","t":"eql","to":"unexpected exit","tot":"str"}],"x":1129,"y":956.5,"wires":[[]]}]
@@ -0,0 +1 @@
1
+ [{"id":"368c348d25dfc2fe","type":"tab","label":"[genserver] addressing modules","disabled":false,"info":"## Generic Server Node - Addressing\n\nModules can be addressed using either process ids or module names.\n\nThe difference is that modules can only be started once, they become singletons. Which means that if a module dies, all gen server nodes that are using that module also die.\n\nOn the other hand, process-based addressing creates separate instance (i.e. processes) for each instane of the gen server node.\n\n## Technical details \n\nWhat the gen server node is doing at initialisation time is to unregister the module name atom and only use the `gen_server:call(Pid, ...)` method for addressing the module process.\n\nIn the case of the mdoule name addressing, `gen_server:call(?MODULE, ...)` is used via the exported functionality of the <a class=\"ahl-node-only\" data-ids=\"319a0c0cef7adff0\">sample_counter</a> module.\n\n## Test\n\nThe test contains two different configurations of the gen server node: <a class=\"ahl-group-only\" data-ids=\"16bc664dae3f609c\">process addressed modules</a> and <a class=\"ahl-group-only\" data-ids=\"6a046d4947c5b945\">module name addressing</a>. The assert nodes check for the status values of the various gen server nodes.\n\nThose gen server nodes that use module name addressing all crash when the <a class=\"ahl-node-only\" data-ids=\"e38405d7afb19f6b\">stop</a> inject node is triggered by the test. These nodes then generate two status messages, one for being started and the other for being stopped.\n\nThe <a class=\"ahl-group-only\" data-ids=\"16bc664dae3f609c\">process addressed</a> gen server nodes don't crash and hence have only one status message: started.\n\n","env":[{"name":"ERED_TIMEOUT","value":"8","type":"num"},{"name":"ERED_ONLY","value":"true","type":"bool"}]},{"id":"6a046d4947c5b945","type":"group","z":"368c348d25dfc2fe","name":"module name addressing","style":{"label":true},"nodes":["4a6bf5aa09990e85","7d9bb387cfc8a03d","ca5b1a0d83b1f860","15d052c1ea6f98cf","c95cbfbc0fba80cc","4881cc459271f61e","70817c9a8ca324cc","efe0bf43f94b65f2","9b68310750fc9309","4ae71fbc6020a7b1","734b02ab7078d2f0","3f34b1e5beacc35e","2ef18260a66f756d","cefeeeacb90abcd6","be8435b811c8b753","3e96b7f2ae1d426f","aaa208c5e450dd49","0cd9c37e8ee2b501"],"x":741,"y":304,"w":806.0000457763672,"h":814.5},{"id":"16bc664dae3f609c","type":"group","z":"368c348d25dfc2fe","name":"process addressed modules","style":{"label":true},"nodes":["e12eb464a0b54796","09a95610fc12d76a","0437927a34270706","9359c88c9def11ce","d690b97d147e2bc3","4d5b4f0e2302671f","90cb4957e41fa49a","ad9c15d4e98a5ca9","0f6c4b70f1c2b931","ae485c01a91bbe8c"],"x":1597.3332901000977,"y":205.66665649414062,"w":718.6667175292969,"h":389.49998346964514},{"id":"4a6bf5aa09990e85","type":"erlgenserver","z":"368c348d25dfc2fe","g":"6a046d4947c5b945","name":"","use_module_name_addressing":true,"scope":["319a0c0cef7adff0"],"x":857,"y":362,"wires":[[]]},{"id":"319a0c0cef7adff0","type":"erlmodule","z":"368c348d25dfc2fe","name":"","module_name":"sample_counter","code":"-module(sample_counter).\n\n%%\n%% APIs: https://www.erlang.org/doc/apps/stdlib/gen_server.html\n%%\n\n-behaviour(gen_server).\n\n-export([\n start_link/0,\n init/1,\n handle_call/3,\n handle_cast/2,\n handle_info/2,\n code_change/3,\n terminate/2,\n stop/0,\n fail/0\n]).\n\n%%\n%% Externer exports\n-export([\n increment/0,\n decrement/0,\n get_counter/0,\n set_counter/1\n]).\n\n%%\n%% External APIs\nincrement() ->\n gen_server:call(?MODULE, increment).\n\ndecrement() ->\n gen_server:call(?MODULE, decrement).\n\nget_counter() ->\n gen_server:call(?MODULE, get_counter).\n\nset_counter(Value) ->\n gen_server:call(?MODULE, {set_counter, Value}).\n\n%%\n%%\nstart_link() ->\n gen_server:start_link({local, ?MODULE}, ?MODULE, #{counter => 0}, []).\n\ninit(Args) ->\n {ok, Args#{ counter => 1 }}.\n\nstop() ->\n io:format(\"Terminging ~n\",[]),\n gen_server:cast(?MODULE, stop).\n\nfail() ->\n io:format(\"Failing ~n\",[]),\n gen_server:cast(?MODULE, fail).\n\n\nterminate(_Event, _State) ->\n ok.\n\ncode_change(_OldVersion, State, _Extra) ->\n {ok, State}.\n\n%%\n%%\nhandle_call(increment, _From, #{ counter := Counter } = State) ->\n {reply, ok, State#{ counter => Counter + 1}};\n\nhandle_call(decrement, _From, #{ counter := Counter } = State) ->\n {reply, ok, State#{ counter => Counter - 1}};\n\nhandle_call(get_counter, _From, #{ counter := Counter } = State) ->\n {reply, Counter, State};\n\nhandle_call({set_counter, Payload}, _From, State) when is_integer(Payload) ->\n {reply, ok, State#{ counter => Payload}};\n\nhandle_call({set_counter, Payload}, _From, State) when is_binary(Payload); is_list(Payload) ->\n case string:to_integer(Payload) of\n {error, _} ->\n {reply, not_integer, State};\n {Integer, _} ->\n {reply, ok, State#{ counter => Integer}}\n end;\n\nhandle_call({set_counter, _Payload}, _From, State) ->\n {reply, not_supported, State};\n\nhandle_call(Msg, _From, State) ->\n io:format(\"UNKNOWN CALL: ~p~n\", [Msg]),\n {stop, unknown_call, State}.\n\n%%\n%%\nhandle_cast(fail, State) ->\n {stop, failed, State};\nhandle_cast(stop, State) ->\n {stop, normal, State};\nhandle_cast(_Msg, State) ->\n {noreply, State}.\n\n%%\n%%\nhandle_info(_, State) ->\n {noreply, State}.\n\n","x":1560.666748046875,"y":98.99996948242188,"wires":[]},{"id":"7d9bb387cfc8a03d","type":"erlgenserver","z":"368c348d25dfc2fe","g":"6a046d4947c5b945","name":"","use_module_name_addressing":true,"scope":["319a0c0cef7adff0"],"x":857,"y":521,"wires":[[]]},{"id":"e38405d7afb19f6b","type":"inject","z":"368c348d25dfc2fe","name":"stop","props":[{"p":"module","v":"sample_counter","vt":"str"},{"p":"call","v":"stop","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":430,"y":836.6666870117188,"wires":[["7d9bb387cfc8a03d"]]},{"id":"ca5b1a0d83b1f860","type":"erlgenserver","z":"368c348d25dfc2fe","g":"6a046d4947c5b945","name":"","use_module_name_addressing":true,"scope":["319a0c0cef7adff0"],"x":857,"y":680,"wires":[[]]},{"id":"15d052c1ea6f98cf","type":"status","z":"368c348d25dfc2fe","g":"6a046d4947c5b945","name":"","scope":["4a6bf5aa09990e85"],"x":827,"y":441.5,"wires":[["c95cbfbc0fba80cc","cefeeeacb90abcd6"]]},{"id":"c95cbfbc0fba80cc","type":"ut-assert-values","z":"368c348d25dfc2fe","g":"6a046d4947c5b945","name":"check for started status","ignore_failure_if_succeed":true,"rules":[{"p":"status.fill","pt":"msg","t":"eql","to":"green","tot":"str"},{"p":"status.shape","pt":"msg","t":"eql","to":"dot","tot":"str"},{"p":"status.text","pt":"msg","t":"eql","to":"started","tot":"str"}],"x":1411.0000457763672,"y":448.5238023485456,"wires":[[]]},{"id":"4881cc459271f61e","type":"status","z":"368c348d25dfc2fe","g":"6a046d4947c5b945","name":"","scope":["7d9bb387cfc8a03d"],"x":827,"y":600.5,"wires":[["70817c9a8ca324cc","be8435b811c8b753"]]},{"id":"70817c9a8ca324cc","type":"ut-assert-values","z":"368c348d25dfc2fe","g":"6a046d4947c5b945","name":"check for started status","ignore_failure_if_succeed":true,"rules":[{"p":"status.fill","pt":"msg","t":"eql","to":"green","tot":"str"},{"p":"status.shape","pt":"msg","t":"eql","to":"dot","tot":"str"},{"p":"status.text","pt":"msg","t":"eql","to":"started","tot":"str"}],"x":1411.0000457763672,"y":655.5714070456368,"wires":[[]]},{"id":"efe0bf43f94b65f2","type":"status","z":"368c348d25dfc2fe","g":"6a046d4947c5b945","name":"","scope":["ca5b1a0d83b1f860"],"x":827,"y":759.5,"wires":[["9b68310750fc9309","3e96b7f2ae1d426f"]]},{"id":"9b68310750fc9309","type":"ut-assert-values","z":"368c348d25dfc2fe","g":"6a046d4947c5b945","name":"check for stopped status","ignore_failure_if_succeed":true,"rules":[{"p":"status.fill","pt":"msg","t":"eql","to":"green","tot":"str"},{"p":"status.shape","pt":"msg","t":"eql","to":"dot","tot":"str"},{"p":"status.text","pt":"msg","t":"eql","to":"started","tot":"str"}],"x":1411.0000457763672,"y":759.0952093941823,"wires":[[]]},{"id":"4ae71fbc6020a7b1","type":"erlgenserver","z":"368c348d25dfc2fe","g":"6a046d4947c5b945","name":"","use_module_name_addressing":true,"scope":["319a0c0cef7adff0"],"x":857,"y":918.5,"wires":[[]]},{"id":"734b02ab7078d2f0","type":"erlgenserver","z":"368c348d25dfc2fe","g":"6a046d4947c5b945","name":"","use_module_name_addressing":true,"scope":["319a0c0cef7adff0"],"x":857,"y":1077.5,"wires":[[]]},{"id":"e12eb464a0b54796","type":"erlgenserver","z":"368c348d25dfc2fe","g":"16bc664dae3f609c","name":"","use_module_name_addressing":false,"scope":["319a0c0cef7adff0"],"x":1713.3332901000977,"y":246.66665649414062,"wires":[[]]},{"id":"09a95610fc12d76a","type":"erlgenserver","z":"368c348d25dfc2fe","g":"16bc664dae3f609c","name":"","use_module_name_addressing":false,"scope":["319a0c0cef7adff0"],"x":1723.9999542236328,"y":478.6666564941406,"wires":[[]]},{"id":"0437927a34270706","type":"status","z":"368c348d25dfc2fe","g":"16bc664dae3f609c","name":"","scope":["e12eb464a0b54796"],"x":1774.6666259765625,"y":321.25001668930054,"wires":[["9359c88c9def11ce","ad9c15d4e98a5ca9"]]},{"id":"9359c88c9def11ce","type":"ut-assert-values","z":"368c348d25dfc2fe","g":"16bc664dae3f609c","name":"","ignore_failure_if_succeed":true,"rules":[{"p":"status.fill","pt":"msg","t":"eql","to":"green","tot":"str"},{"p":"status.shape","pt":"msg","t":"eql","to":"dot","tot":"str"},{"p":"status.text","pt":"msg","t":"eql","to":"started","tot":"str"}],"x":2005.6666259765625,"y":246.66665649414062,"wires":[[]]},{"id":"d690b97d147e2bc3","type":"status","z":"368c348d25dfc2fe","g":"16bc664dae3f609c","name":"","scope":["09a95610fc12d76a"],"x":1780.6666259765625,"y":554.1666399637858,"wires":[["4d5b4f0e2302671f","90cb4957e41fa49a"]]},{"id":"4d5b4f0e2302671f","type":"ut-assert-values","z":"368c348d25dfc2fe","g":"16bc664dae3f609c","name":"","ignore_failure_if_succeed":true,"rules":[{"p":"status.fill","pt":"msg","t":"eql","to":"green","tot":"str"},{"p":"status.shape","pt":"msg","t":"eql","to":"dot","tot":"str"},{"p":"status.text","pt":"msg","t":"eql","to":"started","tot":"str"}],"x":2011.6666259765625,"y":478.6666564941406,"wires":[[]]},{"id":"3f34b1e5beacc35e","type":"status","z":"368c348d25dfc2fe","g":"6a046d4947c5b945","name":"","scope":["ca5b1a0d83b1f860"],"x":827,"y":839,"wires":[["aaa208c5e450dd49"]]},{"id":"2ef18260a66f756d","type":"status","z":"368c348d25dfc2fe","g":"6a046d4947c5b945","name":"","scope":["ca5b1a0d83b1f860"],"x":827,"y":998,"wires":[["0cd9c37e8ee2b501"]]},{"id":"cefeeeacb90abcd6","type":"ut-assert-values","z":"368c348d25dfc2fe","g":"6a046d4947c5b945","name":"check for stopped status","ignore_failure_if_succeed":true,"rules":[{"p":"status.fill","pt":"msg","t":"eql","to":"red","tot":"str"},{"p":"status.shape","pt":"msg","t":"eql","to":"dot","tot":"str"},{"p":"status.text","pt":"msg","t":"eql","to":"stopped","tot":"str"}],"x":1411.0000457763672,"y":345,"wires":[[]]},{"id":"be8435b811c8b753","type":"ut-assert-values","z":"368c348d25dfc2fe","g":"6a046d4947c5b945","name":"check for stopped status","ignore_failure_if_succeed":true,"rules":[{"p":"status.fill","pt":"msg","t":"eql","to":"red","tot":"str"},{"p":"status.shape","pt":"msg","t":"eql","to":"dot","tot":"str"},{"p":"status.text","pt":"msg","t":"eql","to":"stopped","tot":"str"}],"x":1411.0000457763672,"y":552.0476046970912,"wires":[[]]},{"id":"3e96b7f2ae1d426f","type":"ut-assert-values","z":"368c348d25dfc2fe","g":"6a046d4947c5b945","name":"check for started status","ignore_failure_if_succeed":true,"rules":[{"p":"status.fill","pt":"msg","t":"eql","to":"red","tot":"str"},{"p":"status.shape","pt":"msg","t":"eql","to":"dot","tot":"str"},{"p":"status.text","pt":"msg","t":"eql","to":"stopped","tot":"str"}],"x":1411.0000457763672,"y":862.6190117427279,"wires":[[]]},{"id":"aaa208c5e450dd49","type":"ut-assert-values","z":"368c348d25dfc2fe","g":"6a046d4947c5b945","name":"check for stopped status","ignore_failure_if_succeed":true,"rules":[{"p":"status.fill","pt":"msg","t":"eql","to":"red","tot":"str"},{"p":"status.shape","pt":"msg","t":"eql","to":"dot","tot":"str"},{"p":"status.text","pt":"msg","t":"eql","to":"stopped","tot":"str"}],"x":1411.0000457763672,"y":966.1428140912735,"wires":[[]]},{"id":"0cd9c37e8ee2b501","type":"ut-assert-values","z":"368c348d25dfc2fe","g":"6a046d4947c5b945","name":"check for stopped status","ignore_failure_if_succeed":true,"rules":[{"p":"status.fill","pt":"msg","t":"eql","to":"red","tot":"str"},{"p":"status.shape","pt":"msg","t":"eql","to":"dot","tot":"str"},{"p":"status.text","pt":"msg","t":"eql","to":"stopped","tot":"str"}],"x":1411.0000457763672,"y":1069.6666164398193,"wires":[[]]},{"id":"90cb4957e41fa49a","type":"join","z":"368c348d25dfc2fe","g":"16bc664dae3f609c","name":"","mode":"custom","build":"array","property":"","propertyType":"full","key":"topic","joiner":"\\n","joinerType":"str","useparts":false,"accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":2013.333374023437,"y":554.1666399637858,"wires":[["ae485c01a91bbe8c"]]},{"id":"ad9c15d4e98a5ca9","type":"join","z":"368c348d25dfc2fe","g":"16bc664dae3f609c","name":"","mode":"custom","build":"array","property":"","propertyType":"full","key":"topic","joiner":"\\n","joinerType":"str","useparts":false,"accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":2006.6666259765625,"y":321.25001668930054,"wires":[["0f6c4b70f1c2b931"]]},{"id":"0f6c4b70f1c2b931","type":"ut-assert-failure","z":"368c348d25dfc2fe","g":"16bc664dae3f609c","name":"","x":2203.3333435058594,"y":321.25001668930054,"wires":[]},{"id":"ae485c01a91bbe8c","type":"ut-assert-failure","z":"368c348d25dfc2fe","g":"16bc664dae3f609c","name":"","x":2220.0000076293945,"y":554.1666399637858,"wires":[]}]
@@ -0,0 +1 @@
1
+ [{"id":"38f712d367cecffa","type":"tab","label":"[genserver] triggering functionality","disabled":false,"info":"## Triggering functions on the module\n\nThis flow demonstrates how to call functions on the module using the inject node.\n\nAlso this module uses module name addressing meaning that the module <a class=\"ahl-node-only\" data-ids=\"4a8b029644bfca0f\">sample_counter_test01</a> is only started once, i.e., singleton instance.\n\nA series of increments are performed on the module but a single value of thirteen is generated because there is only a single process for the module.\n\n## Reset \n\nInitially the module is <a class=\"ahl-node-only\" data-ids=\"f8d81fa3377c22b9\">resetted</a> because it continues to exist even after the test, the module isn't replaced for each test rather it contains an existence within the BEAM. Therefore the counter is reset to one at the beginning of the test.\n\n","env":[{"name":"ERED_ONLY","value":"true","type":"bool"}]},{"id":"e09eca284daec5b5","type":"junction","z":"38f712d367cecffa","x":3152,"y":457.75,"wires":[["393212952d795da0","ff66f7f6f04decf8"]]},{"id":"4a8b029644bfca0f","type":"erlmodule","z":"38f712d367cecffa","name":"","module_name":"sample_counter_test01","code":"-module(sample_counter_test01).\n\n%%\n%% APIs: https://www.erlang.org/doc/apps/stdlib/gen_server.html\n%%\n\n-behaviour(gen_server).\n\n-export([\n start_link/0,\n init/1,\n handle_call/3,\n handle_cast/2,\n handle_info/2,\n code_change/3,\n terminate/2,\n stop/0,\n fail/0\n]).\n\n%%\n%% Externer exports\n-export([\n increment/0,\n decrement/0,\n get_counter/0,\n set_counter/1,\n reset/0\n]).\n\n%%\n%% External APIs\nincrement() ->\n gen_server:call(?MODULE, increment).\n\nreset() ->\n gen_server:call(?MODULE, reset).\n\ndecrement() ->\n gen_server:call(?MODULE, decrement).\n\nget_counter() ->\n gen_server:call(?MODULE, get_counter).\n\nset_counter(Value) ->\n gen_server:call(?MODULE, {set_counter, Value}).\n\n%%\n%%\nstart_link() ->\n gen_server:start_link({local, ?MODULE}, ?MODULE, #{counter => 0}, []).\n\ninit(Args) ->\n {ok, Args#{ counter => 1 }}.\n\nstop() ->\n io:format(\"Terminging ~n\",[]),\n gen_server:cast(?MODULE, stop).\n\nfail() ->\n io:format(\"Failing ~n\",[]),\n gen_server:cast(?MODULE, fail).\n\n\nterminate(_Event, _State) ->\n ok.\n\ncode_change(_OldVersion, State, _Extra) ->\n {ok, State}.\n\n%%\n%%\nhandle_call(increment, _From, #{ counter := Counter } = State) ->\n {reply, ok, State#{ counter => Counter + 1}};\n\nhandle_call(reset, _From, State) ->\n {reply, ok, State#{ counter => 1}};\n\nhandle_call(decrement, _From, #{ counter := Counter } = State) ->\n {reply, ok, State#{ counter => Counter - 1}};\n\nhandle_call(get_counter, _From, #{ counter := Counter } = State) ->\n {reply, Counter, State};\n\nhandle_call({set_counter, Payload}, _From, State) when is_integer(Payload) ->\n {reply, ok, State#{ counter => Payload}};\n\nhandle_call({set_counter, Payload}, _From, State) when is_binary(Payload); is_list(Payload) ->\n case string:to_integer(Payload) of\n {error, _} ->\n {reply, not_integer, State};\n {Integer, _} ->\n {reply, ok, State#{ counter => Integer}}\n end;\n\nhandle_call({set_counter, _Payload}, _From, State) ->\n {reply, not_supported, State};\n\nhandle_call(Msg, _From, State) ->\n io:format(\"UNKNOWN CALL: ~p~n\", [Msg]),\n {stop, unknown_call, State}.\n\n%%\n%%\nhandle_cast(fail, State) ->\n {stop, failed, State};\nhandle_cast(stop, State) ->\n {stop, normal, State};\nhandle_cast(_Msg, State) ->\n {noreply, State}.\n\n%%\n%%\nhandle_info(_, State) ->\n {noreply, State}.\n\n","x":840,"y":148.5,"wires":[]},{"id":"17809b62fe4c8a51","type":"erlgenserver","z":"38f712d367cecffa","name":"","use_module_name_addressing":true,"scope":["4a8b029644bfca0f"],"x":1116,"y":351,"wires":[["a8bfffa7442a720d","c224f206be12b604"]]},{"id":"05db1c8b86106e07","type":"inject","z":"38f712d367cecffa","name":"get_counter","props":[{"p":"module","v":"sample_counter_test01","vt":"str"},{"p":"call","v":"get_counter","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":743,"y":351,"wires":[["ce54888e05af5fc3"]]},{"id":"a8bfffa7442a720d","type":"ut-assert-values","z":"38f712d367cecffa","name":"","ignore_failure_if_succeed":false,"rules":[{"t":"eql","p":"payload","pt":"msg","to":"1","tot":"num"}],"x":1390,"y":266.5,"wires":[[]]},{"id":"c224f206be12b604","type":"change","z":"38f712d367cecffa","name":"increment","rules":[{"t":"set","p":"module","pt":"msg","to":"sample_counter_test01","tot":"str"},{"t":"set","p":"call","pt":"msg","to":"increment","tot":"str"},{"t":"delete","p":"payload","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1459,"y":351,"wires":[["298a9c2fe4de2a56","8bd5a693f43505bf","844259c61795f83b"]]},{"id":"298a9c2fe4de2a56","type":"erlgenserver","z":"38f712d367cecffa","name":"","use_module_name_addressing":true,"scope":["4a8b029644bfca0f"],"x":1794,"y":291.5,"wires":[["af4fbb70a27c5d31","4e1035568c8b68f8"]]},{"id":"4e1035568c8b68f8","type":"ut-assert-values","z":"38f712d367cecffa","name":"","ignore_failure_if_succeed":false,"rules":[{"t":"eql","p":"payload","pt":"msg","to":"ok","tot":"str"}],"x":2113,"y":212.5,"wires":[[]]},{"id":"af4fbb70a27c5d31","type":"change","z":"38f712d367cecffa","name":"increment","rules":[{"t":"set","p":"module","pt":"msg","to":"sample_counter_test01","tot":"str"},{"t":"set","p":"call","pt":"msg","to":"increment","tot":"str"},{"t":"delete","p":"payload","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":2083,"y":291.5,"wires":[["6acef004c92340fe","30eeab7bc6b0ed79","1a789022d5aa8b23"]]},{"id":"6acef004c92340fe","type":"erlgenserver","z":"38f712d367cecffa","name":"","use_module_name_addressing":true,"scope":["4a8b029644bfca0f"],"x":2569,"y":291.5,"wires":[["95fe699811b62d34","5696ca1b2b7f9d22"]]},{"id":"5696ca1b2b7f9d22","type":"ut-assert-values","z":"38f712d367cecffa","name":"","ignore_failure_if_succeed":false,"rules":[{"t":"eql","p":"payload","pt":"msg","to":"ok","tot":"str"}],"x":2874,"y":354.5,"wires":[[]]},{"id":"95fe699811b62d34","type":"change","z":"38f712d367cecffa","name":"increment","rules":[{"t":"set","p":"module","pt":"msg","to":"sample_counter_test01","tot":"str"},{"t":"set","p":"call","pt":"msg","to":"increment","tot":"str"},{"t":"delete","p":"payload","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":2874,"y":291.5,"wires":[["e09eca284daec5b5"]]},{"id":"8bd5a693f43505bf","type":"erlgenserver","z":"38f712d367cecffa","name":"","use_module_name_addressing":true,"scope":["4a8b029644bfca0f"],"x":1794,"y":457.75,"wires":[["5a964d16867d34b9","3bebe55e7991ba40"]]},{"id":"3bebe55e7991ba40","type":"ut-assert-values","z":"38f712d367cecffa","name":"","ignore_failure_if_succeed":false,"rules":[{"t":"eql","p":"payload","pt":"msg","to":"ok","tot":"str"}],"x":2113,"y":380.5,"wires":[[]]},{"id":"5a964d16867d34b9","type":"change","z":"38f712d367cecffa","name":"increment","rules":[{"t":"set","p":"module","pt":"msg","to":"sample_counter_test01","tot":"str"},{"t":"set","p":"call","pt":"msg","to":"increment","tot":"str"},{"t":"delete","p":"payload","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":2083,"y":457.75,"wires":[["6acef004c92340fe","30eeab7bc6b0ed79","1a789022d5aa8b23"]]},{"id":"844259c61795f83b","type":"erlgenserver","z":"38f712d367cecffa","name":"","use_module_name_addressing":true,"scope":["4a8b029644bfca0f"],"x":1794,"y":623.5,"wires":[["e8632523573662f2","479a4eab41af42ab"]]},{"id":"479a4eab41af42ab","type":"ut-assert-values","z":"38f712d367cecffa","name":"","ignore_failure_if_succeed":false,"rules":[{"t":"eql","p":"payload","pt":"msg","to":"ok","tot":"str"}],"x":2113,"y":541.5,"wires":[[]]},{"id":"e8632523573662f2","type":"change","z":"38f712d367cecffa","name":"increment","rules":[{"t":"set","p":"module","pt":"msg","to":"sample_counter_test01","tot":"str"},{"t":"set","p":"call","pt":"msg","to":"increment","tot":"str"},{"t":"delete","p":"payload","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":2083,"y":623.5,"wires":[["6acef004c92340fe","30eeab7bc6b0ed79","1a789022d5aa8b23"]]},{"id":"30eeab7bc6b0ed79","type":"erlgenserver","z":"38f712d367cecffa","name":"","use_module_name_addressing":true,"scope":["4a8b029644bfca0f"],"x":2569,"y":623.5,"wires":[["117c80f9abaf0f42","3d5c69f7942cf55b"]]},{"id":"3d5c69f7942cf55b","type":"ut-assert-values","z":"38f712d367cecffa","name":"","ignore_failure_if_succeed":false,"rules":[{"t":"eql","p":"payload","pt":"msg","to":"ok","tot":"str"}],"x":2874,"y":703.5,"wires":[[]]},{"id":"117c80f9abaf0f42","type":"change","z":"38f712d367cecffa","name":"increment","rules":[{"t":"set","p":"module","pt":"msg","to":"sample_counter_test01","tot":"str"},{"t":"set","p":"call","pt":"msg","to":"increment","tot":"str"},{"t":"delete","p":"payload","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":2874,"y":623.5,"wires":[["e09eca284daec5b5"]]},{"id":"1a789022d5aa8b23","type":"erlgenserver","z":"38f712d367cecffa","name":"","use_module_name_addressing":true,"scope":["4a8b029644bfca0f"],"x":2569,"y":457.75,"wires":[["4bfce3d5d160003b","f0a22569491fb06c"]]},{"id":"f0a22569491fb06c","type":"ut-assert-values","z":"38f712d367cecffa","name":"","ignore_failure_if_succeed":false,"rules":[{"t":"eql","p":"payload","pt":"msg","to":"ok","tot":"str"}],"x":2874,"y":528.5,"wires":[[]]},{"id":"4bfce3d5d160003b","type":"change","z":"38f712d367cecffa","name":"increment","rules":[{"t":"set","p":"module","pt":"msg","to":"sample_counter_test01","tot":"str"},{"t":"set","p":"call","pt":"msg","to":"increment","tot":"str"},{"t":"delete","p":"payload","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":2874,"y":457.75,"wires":[["e09eca284daec5b5"]]},{"id":"f8d81fa3377c22b9","type":"inject","z":"38f712d367cecffa","name":"reset","props":[{"p":"module","v":"sample_counter_test01","vt":"str"},{"p":"call","v":"reset","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":617,"y":266.5,"wires":[["87ac5f6da94acad4"]]},{"id":"ce54888e05af5fc3","type":"delay","z":"38f712d367cecffa","name":"","pauseType":"delay","timeout":"100","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":909,"y":351,"wires":[["17809b62fe4c8a51"]]},{"id":"87ac5f6da94acad4","type":"erlgenserver","z":"38f712d367cecffa","name":"","use_module_name_addressing":true,"scope":["4a8b029644bfca0f"],"x":1121,"y":266.5,"wires":[["0486569d515cbdea"]]},{"id":"0486569d515cbdea","type":"ut-assert-values","z":"38f712d367cecffa","name":"","ignore_failure_if_succeed":false,"rules":[{"t":"eql","p":"payload","pt":"msg","to":"ok","tot":"str"}],"x":1390,"y":148.5,"wires":[[]]},{"id":"393212952d795da0","type":"join","z":"38f712d367cecffa","name":"","mode":"custom","build":"array","property":"","propertyType":"full","key":"topic","joiner":"\\n","joinerType":"str","useparts":false,"accumulate":false,"timeout":"","count":"9","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":3267,"y":404,"wires":[["329746c2b8858a0c"]]},{"id":"b2d4f0e84047b1c0","type":"erlgenserver","z":"38f712d367cecffa","name":"","use_module_name_addressing":true,"scope":["4a8b029644bfca0f"],"x":3770.333333333333,"y":404,"wires":[["f01c7322153f86c3"]]},{"id":"329746c2b8858a0c","type":"change","z":"38f712d367cecffa","name":"get_counter","rules":[{"t":"set","p":"module","pt":"msg","to":"sample_counter_test01","tot":"str"},{"t":"set","p":"call","pt":"msg","to":"get_counter","tot":"str"},{"t":"delete","p":"payload","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":3488.6666666666665,"y":404,"wires":[["b2d4f0e84047b1c0"]]},{"id":"f01c7322153f86c3","type":"ut-assert-values","z":"38f712d367cecffa","name":"","ignore_failure_if_succeed":false,"rules":[{"t":"eql","p":"payload","pt":"msg","to":"13","tot":"num"}],"x":4086,"y":404,"wires":[[]]},{"id":"ff66f7f6f04decf8","type":"ut-assert-success","z":"38f712d367cecffa","name":"","count":"9","x":4096,"y":457.75,"wires":[]}]
@@ -0,0 +1 @@
1
+ [{"id":"c562c43e69bcf0af","type":"tab","label":"[http] Dynamic Routing","disabled":false,"info":"This is taken from [FlowHub.org](https://flowhub.org/f/c562c43e69bcf0af).\n\n### aim\n\nUsing link-in and link-call nodes to implementing dynamic path routing. \n\n### warning\n\nThis flow contains Http-In endpoinst definitions that could interrupt existing endpoints and services or open your Node-RED installation to malicious attacks.\n\n\n### Explanation\n\nThis router, as opposed to the [static router](https://flowhub.org/f/40ea5f2aea6592ae), accepts all requests and directs the request to a handler *if* a handler happens to be defined. The dynamic router disects that path and *ensures* that a handler is defined for that path.\n\nIn this flow defining a new handler for a path is a matter of creating a link-in node. The <a class=\"ahl-node-only\" data-ids=\"63311a5c3e0b8520\">http-in</a> node accepts all GET requests that match the path specification `/<path1>/<path2>`: path1 and path2 can be anything that represents a path.\n\nRouting is based on the names of the link-in nodes, in this case the convention used is that a link-in node should be named `[:path1] :path2`. This convention is defined in the <a class=\"ahl-node-only\" data-ids=\"5117e34e38f7445f\">change node</a> that sets the `msg.target` attribute. This attribute is used by the <a class=\"ahl-node-only\" data-ids=\"f266975e312ddef6\">link-call</a> node, which calls the correponding link-in node.\n\nIf no link-in node is found by that name, the <a class=\"ahl-group-only\" data-ids=\"627be3679370b933\">exception handler</a> is triggered that ends the request with a Http Code 404 - page not found.\n\nA link-in node, once defined, is responsible for generate the HTML content for the request. A <a class=\"ahl-node-only\" data-ids=\"a78e640e4d0dad43,dafcc80764d7547d\">link-out node</a> in *return mode* (meaning the call returns to the original link-call node) ends the flow ensuring the HTML content is returned to the link-call node. The link-call node then returns the HTML content as response to the original request.\n\nIf the link-out node is missing or the handler takes too long (the link-call node has a timeout of 15 seconds) the exception handler is triggered. The response becomes a 404 not found.\n\nThis kind of routing is useful for blog sites where content is generated over time and maintaining a static router would be an extra step for each page. Instead link-in nodes are created at will and become connected to the site.\n\nA <a href=\"https://flowhub.org/f/40ea5f2aea6592ae\">static router</a> is more useful for APIs where endpoints need to be clearly defined along with their purpose. Also with API its more important to differentiate between http methods, that is, GET, POST, PUT, PATCH.\n\nFor an API it is advantageous to have an overview of the complete structure defined in one flow tab. \n\nIn this flow has two endpoints:\n\n- `/hello/world` since <a class=\"ahl-node-only\" data-ids=\"6eafc7df3d7fa16c\">link-in node</a> is named `[hello] world`.\n- `/node/red` since <a class=\"ahl-node-only\" data-ids=\"4be3e088622e9054\">link-in node</a> is named `[node] red`.\n\nThe name convention is chosen by the author, there is no requirement to keep it. There simple needs to be a mapping between the paths of requests and the naming of link-in nodes, whatever mapping that might be.\n\n### Related Flows\n\n- [Static Router](https://flowhub.org/f/40ea5f2aea6592ae) routing paths to *specific* endpoints.","env":[{"name":"ERED_NOT_EUNIT","type":"bool","value":"true"},{"name":"ERED_TIMEOUT","type":"num","value":"6"},{"name":"ERED_PENDING","type":"bool","value":"false"}]},{"id":"627be3679370b933","type":"group","z":"c562c43e69bcf0af","name":"Route not found","style":{"label":true},"nodes":["e47df6c462833421","cc0c614b1e1e6104","8d7b5b2ee31e3e96"],"x":764,"y":755,"w":801,"h":82},{"id":"207fa856ae4a3b07","type":"group","z":"c562c43e69bcf0af","name":"router","style":{"label":true},"nodes":["63311a5c3e0b8520","f266975e312ddef6","5117e34e38f7445f","df4ccd20486f7567","a6b3f178d410ef1f"],"x":246,"y":582,"w":1319,"h":130},{"id":"8bae3ca1893c2c87","type":"group","z":"c562c43e69bcf0af","name":"GET /hello/world","style":{"label":true},"nodes":["6eafc7df3d7fa16c","8022ad08a9ca1c78","a78e640e4d0dad43"],"x":239,"y":352,"w":455,"h":82},{"id":"fabeb20aa2bae1f8","type":"group","z":"c562c43e69bcf0af","name":"GET /node/red","style":{"label":true},"nodes":["4be3e088622e9054","e7110ab46bd47bad","dafcc80764d7547d"],"x":239,"y":491,"w":455,"h":82},{"id":"ef8a88e4ca600a52","type":"group","z":"c562c43e69bcf0af","name":"GET /erlang/red","style":{"label":true},"nodes":["88bee951ca1d55b6","0e76b7678533cde6","d3d2fcad3090e646"],"x":240,"y":228,"w":455,"h":82},{"id":"63311a5c3e0b8520","type":"http in","z":"c562c43e69bcf0af","g":"207fa856ae4a3b07","name":"","url":"/c562c43e69bcf0af/example02/:path1/:path2","method":"get","upload":false,"swaggerDoc":"","x":462,"y":623,"wires":[["5117e34e38f7445f"]]},{"id":"f266975e312ddef6","type":"link call","z":"c562c43e69bcf0af","g":"207fa856ae4a3b07","name":"","links":[],"linkType":"dynamic","timeout":"15","x":962,"y":671,"wires":[["a6b3f178d410ef1f"]]},{"id":"5117e34e38f7445f","type":"change","z":"c562c43e69bcf0af","g":"207fa856ae4a3b07","name":"set msg.target \"[:path1] :path2\"","rules":[{"p":"target","pt":"msg","t":"set","to":"\"[\" & msg.req.params.path1 & \"] \" & msg.req.params.path2","tot":"jsonata"},{"p":"target","pt":"msg","t":"set","to":"$toString($$.target)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":713.5,"y":671,"wires":[["f266975e312ddef6"]]},{"id":"e47df6c462833421","type":"catch","z":"c562c43e69bcf0af","g":"627be3679370b933","name":"","scope":["f266975e312ddef6"],"uncaught":false,"x":840,"y":796,"wires":[["8d7b5b2ee31e3e96"]]},{"id":"cc0c614b1e1e6104","type":"http response","z":"c562c43e69bcf0af","g":"627be3679370b933","name":"resp (404)","statusCode":"","headers":{},"x":1479,"y":796,"wires":[]},{"id":"8d7b5b2ee31e3e96","type":"change","z":"c562c43e69bcf0af","g":"627be3679370b933","name":"statusCode = 404, payload = Not Found","rules":[{"p":"payload","pt":"msg","t":"set","to":"Not Found Here","tot":"str"},{"p":"statusCode","pt":"msg","t":"set","to":"404","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":1181,"y":796,"wires":[["cc0c614b1e1e6104"]]},{"id":"df4ccd20486f7567","type":"http response","z":"c562c43e69bcf0af","g":"207fa856ae4a3b07","name":"resp (200)","statusCode":"","headers":{},"x":1479,"y":671,"wires":[]},{"id":"a6b3f178d410ef1f","type":"change","z":"c562c43e69bcf0af","g":"207fa856ae4a3b07","name":"set statusCode = 200","rules":[{"p":"statusCode","pt":"msg","t":"set","to":"200","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":1220.5,"y":671,"wires":[["df4ccd20486f7567"]]},{"id":"6eafc7df3d7fa16c","type":"link in","z":"c562c43e69bcf0af","g":"8bae3ca1893c2c87","name":"[hello] world","links":[],"x":280,"y":393,"wires":[["8022ad08a9ca1c78"]]},{"id":"8022ad08a9ca1c78","type":"template","z":"c562c43e69bcf0af","g":"8bae3ca1893c2c87","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<html>\n <head>\n <title>Hello World</title>\n </head>\n <body>\n Hello World\n </body>\n</html>","output":"str","x":466.5,"y":393,"wires":[["a78e640e4d0dad43"]]},{"id":"a78e640e4d0dad43","type":"link out","z":"c562c43e69bcf0af","g":"8bae3ca1893c2c87","name":"link out 110","mode":"return","links":[],"x":653,"y":393,"wires":[]},{"id":"4be3e088622e9054","type":"link in","z":"c562c43e69bcf0af","g":"fabeb20aa2bae1f8","name":"[node] red","links":[],"x":280,"y":532,"wires":[["e7110ab46bd47bad"]]},{"id":"e7110ab46bd47bad","type":"template","z":"c562c43e69bcf0af","g":"fabeb20aa2bae1f8","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<html>\n <head>\n <title>Node RED</title>\n </head>\n <body>\n Node-RED\n </body>\n</html>","output":"str","x":466.5,"y":532,"wires":[["dafcc80764d7547d"]]},{"id":"dafcc80764d7547d","type":"link out","z":"c562c43e69bcf0af","g":"fabeb20aa2bae1f8","name":"link out 111","mode":"return","links":[],"x":653,"y":532,"wires":[]},{"id":"88bee951ca1d55b6","type":"link in","z":"c562c43e69bcf0af","g":"ef8a88e4ca600a52","name":"[erlang] red","links":[],"x":281,"y":269,"wires":[["0e76b7678533cde6"]]},{"id":"0e76b7678533cde6","type":"template","z":"c562c43e69bcf0af","g":"ef8a88e4ca600a52","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<html>\n <head>\n <title>Erlang RED</title>\n </head>\n <body>\n Erlang-RED\n </body>\n</html>","output":"str","x":467.5,"y":269,"wires":[["d3d2fcad3090e646"]]},{"id":"d3d2fcad3090e646","type":"link out","z":"c562c43e69bcf0af","g":"ef8a88e4ca600a52","name":"link out 1","mode":"return","links":[],"x":654,"y":269,"wires":[]},{"id":"5ef99a8f388e3579","type":"inject","z":"c562c43e69bcf0af","name":"test starts here","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":343,"y":997,"wires":[["0d18c87ae65b4697"]]},{"id":"89d3370d9127c78d","type":"http request","z":"c562c43e69bcf0af","name":"/erlang/red","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://localhost:8080/c562c43e69bcf0af/example02/erlang/red","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":654,"y":1118,"wires":[["4945c17057fb3588","9a715cf1a06dce43"]]},{"id":"74b7789f10ff8395","type":"http request","z":"c562c43e69bcf0af","name":"/page/unknown","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://localhost:8080/c562c43e69bcf0af/example02/page/unknown","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":663,"y":1207,"wires":[["2b3aa74e2cb36b3a","8782c1802f1ebf38"]]},{"id":"e8063bc6f5121b66","type":"http request","z":"c562c43e69bcf0af","name":"/node/red","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://localhost:8080/c562c43e69bcf0af/example02/node/red","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":647,"y":1035.5,"wires":[["190218dd2197c204","f23e0e07c9aa32b3"]]},{"id":"2b3aa74e2cb36b3a","type":"ut-assert-values","z":"c562c43e69bcf0af","name":"","ignore_failure_if_succeed":false,"rules":[{"t":"eql","p":"statusCode","pt":"msg","to":"404","tot":"num"},{"t":"mth","p":"payload","pt":"msg","to":"Not Found Here","tot":"str"}],"x":907,"y":1165.5,"wires":[[]]},{"id":"190218dd2197c204","type":"ut-assert-values","z":"c562c43e69bcf0af","name":"","ignore_failure_if_succeed":false,"rules":[{"t":"eql","p":"statusCode","pt":"msg","to":"200","tot":"num"},{"t":"mth","p":"payload","pt":"msg","to":"Node RED","tot":"str"}],"x":907,"y":980,"wires":[[]]},{"id":"4945c17057fb3588","type":"ut-assert-values","z":"c562c43e69bcf0af","name":"","ignore_failure_if_succeed":false,"rules":[{"t":"eql","p":"statusCode","pt":"msg","to":"200","tot":"num"},{"t":"mth","p":"payload","pt":"msg","to":"Erlang RED","tot":"str"}],"x":907,"y":1072.75,"wires":[[]]},{"id":"0d18c87ae65b4697","type":"delay","z":"c562c43e69bcf0af","name":"","pauseType":"random","timeout":"950","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"100","randomLast":"500","randomUnits":"milliseconds","drop":false,"allowrate":false,"outputs":1,"x":390,"y":1092,"wires":[["89d3370d9127c78d","e8063bc6f5121b66","74b7789f10ff8395"]]},{"id":"f23e0e07c9aa32b3","type":"ut-assert-success","z":"c562c43e69bcf0af","name":"","count":1,"x":1123,"y":1035.5,"wires":[]},{"id":"9a715cf1a06dce43","type":"ut-assert-success","z":"c562c43e69bcf0af","name":"","count":1,"x":1123,"y":1118,"wires":[]},{"id":"8782c1802f1ebf38","type":"ut-assert-success","z":"c562c43e69bcf0af","name":"","count":1,"x":1123,"y":1207,"wires":[]}]