Anomalous behaviour - Batch Node

v1.1.2

I'm seeing some strange behaviour from the batch node.

I am trying to do a sliding window calculation on an array and getting some strange results when I change the nodes parameters.
After changing the parameters to the following the first time I trigger the flow it performs as I expect, when I trigger it the second time it wraps around the end of the array.
Screenshot-25
Screenshot-26

1st trigger of the flow:
Screenshot-27

2nd and subsequent triggers:
Screenshot-28

I would have thought that the first trigger results are correct? Definitely something wrong, or am I missing something?

Example flow:

[{"id":"287fe1a.bbf611e","type":"inject","z":"cf21b550.de9ba8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]","payloadType":"jsonata","x":110,"y":80,"wires":[["6a776a01.f070d4"]]},{"id":"6a776a01.f070d4","type":"split","z":"cf21b550.de9ba8","name":"","splt":"\\n","spltType":"str","arraySplt":"1","arraySpltType":"len","stream":false,"addname":"","x":250,"y":80,"wires":[["5ee58042.23a3d"]]},{"id":"5ee58042.23a3d","type":"batch","z":"cf21b550.de9ba8","name":"","mode":"count","count":"4","overlap":"3","interval":10,"allowEmptySequence":false,"topics":[],"x":390,"y":80,"wires":[["cb1f4b99.15e788"]]},{"id":"c629899a.af6528","type":"debug","z":"cf21b550.de9ba8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":750,"y":160,"wires":[]},{"id":"cb1f4b99.15e788","type":"join","z":"cf21b550.de9ba8","name":"","mode":"auto","build":"array","property":"payload","propertyType":"msg","key":"payload[0][0].Valid_From","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"2","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":530,"y":80,"wires":[["e68468eb.ce4768"]]},{"id":"e68468eb.ce4768","type":"join","z":"cf21b550.de9ba8","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"payload[0][0].Valid_From","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"2","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":610,"y":160,"wires":[["c629899a.af6528"]]}]

you asked for an overlap of three - so there are still 3 items of the previous input still there ready to be the overlap.

OK Dave, now I understand. Is there any way I can emulate the first behaviour?
[edit] I.e. without the wrap at the end.

the end of the info says... " If a message is received with the msg.reset property set, the buffered messages are deleted and not sent."

Being able to read is a virtue :slight_smile:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.