mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Split node - fix complete to send msg for k/v object
and update info to try to clarify.
This commit is contained in:
parent
7703875740
commit
72b8dbb45b
@ -295,7 +295,8 @@
|
||||
For object outputs, once this count has been reached, the node can be configured to send a message for each subsequent message
|
||||
received.</p>
|
||||
<p>A <i>timeout</i> can be set to trigger sending the new message using whatever has been received so far.</p>
|
||||
<p>If a message is received with the <b>msg.complete</b> property set, the output message is sent.</p>
|
||||
<p>If a message is received with the <b>msg.complete</b> property set, the output message is finalised and sent.
|
||||
This resets any part counts.</p>
|
||||
|
||||
<h4>Reduce Sequence mode</h4>
|
||||
<p>When configured to join in reduce mode, an expression is applied to each
|
||||
|
@ -586,14 +586,18 @@ module.exports = function(RED) {
|
||||
}
|
||||
else {
|
||||
if (msg.hasOwnProperty('complete')) {
|
||||
if (inflight[partId]) {
|
||||
inflight[partId].msg.complete = msg.complete;
|
||||
completeSend(partId);
|
||||
}
|
||||
}
|
||||
else {
|
||||
node.warn("Message missing key property 'msg."+node.key+"' - cannot add to object")
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (!inflight.hasOwnProperty(partId)) {
|
||||
if (payloadType === 'object' || payloadType === 'merged') {
|
||||
inflight[partId] = {
|
||||
@ -604,19 +608,6 @@ module.exports = function(RED) {
|
||||
msg:RED.util.cloneMessage(msg)
|
||||
};
|
||||
}
|
||||
else if (node.accumulate === true) {
|
||||
if (msg.hasOwnProperty("reset")) { delete inflight[partId]; }
|
||||
inflight[partId] = inflight[partId] || {
|
||||
currentCount:0,
|
||||
payload:{},
|
||||
targetCount:targetCount,
|
||||
type:payloadType,
|
||||
msg:RED.util.cloneMessage(msg)
|
||||
}
|
||||
if (payloadType === 'string' || payloadType === 'array' || payloadType === 'buffer') {
|
||||
inflight[partId].payload = [];
|
||||
}
|
||||
}
|
||||
else {
|
||||
inflight[partId] = {
|
||||
currentCount:0,
|
||||
|
Loading…
Reference in New Issue
Block a user