Hi All,
I'm trying to use the loop node and define an exit via the msg.command = break. Injecting the command does appear to register and I can capture a message indicating that the break has been processed however the loop continues.
5/24/2024, 11:14:12 AMnode: debug 20
msg.payload : number
0
5/24/2024, 11:14:13 AMnode: debug 20
msg.payload : number
1
5/24/2024, 11:14:14 AMnode: debug 20
msg.payload : number
2
5/24/2024, 11:14:15 AMnode: debug 21
topic : msg : Object
object
_msgid: "96d0410fb5333bd0"
topic: "topic"
payload: "payload"
loop: object
broken: true
timeout: false
passed: object
total: 0
last: 0
restarts: 0
5/24/2024, 11:14:15 AMnode: debug 20
msg.payload : number
3
5/24/2024, 11:14:16 AMnode: debug 20
msg.payload : number
4
5/24/2024, 11:14:16 AMnode: debug 21
msg : Object
object
_msgid: "5e10f86d527a835a"
payload: 4
topic: ""
loop: object
broken: false
timeout: false
passed: object
restarts: 0
I've listed the flow json below, hoping it is just something simple I've overlooked.
[{"id":"22c641bcc0419780","type":"delay","z":"525d27d5.bbddc8","name":"Delay","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1010,"y":700,"wires":[["8f9eb289a9cfd82c","3578abf5b63c0ba6"]]},{"id":"3f410fd90ec1f7b1","type":"inject","z":"525d27d5.bbddc8","name":"Start","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":610,"y":680,"wires":[["3578abf5b63c0ba6"]]},{"id":"08f079cc12eaacc0","type":"inject","z":"525d27d5.bbddc8","name":"Break","props":[{"p":"command","v":"break","vt":"str"},{"p":"topic","vt":"str"},{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"topic","payload":"payload","payloadType":"str","x":610,"y":740,"wires":[["3578abf5b63c0ba6"]]},{"id":"8f9eb289a9cfd82c","type":"debug","z":"525d27d5.bbddc8","name":"debug 20","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1040,"y":800,"wires":[]},{"id":"23396c11dfe8bffc","type":"debug","z":"525d27d5.bbddc8","name":"debug 21","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1020,"y":640,"wires":[]},{"id":"3578abf5b63c0ba6","type":"loop","z":"525d27d5.bbddc8","name":"","kind":"fcnt","count":"5","initial":"1","step":"1","condition":"","conditionType":"js","when":"before","enumeration":"enum","enumerationType":"msg","limit":"","loopPayload":"loop-index","finalPayload":"final-count","x":810,"y":700,"wires":[["23396c11dfe8bffc"],["22c641bcc0419780"]]}]