@5minds/node-red-contrib-processcube
Advanced tools
Comparing version 1.1.4-feature-b3c80b-m14rvpwu to 1.1.4-feature-b953ba-m17k0vnb
{ | ||
"name": "@5minds/node-red-contrib-processcube", | ||
"version": "1.1.4-feature-b3c80b-m14rvpwu", | ||
"version": "1.1.4-feature-b953ba-m17k0vnb", | ||
"license": "MIT", | ||
@@ -48,2 +48,3 @@ "description": "Node-RED nodes for ProcessCube", | ||
"ProcessinstanceQuery": "processinstance-query.js", | ||
"ProcessinstanceDelete": "processinstance-delete.js", | ||
"ProcessdefinitionQuery": "processdefinition-query.js", | ||
@@ -50,0 +51,0 @@ "messageEventTrigger": "message-event-trigger.js", |
@@ -7,2 +7,3 @@ module.exports = function (RED) { | ||
node.on('input', function (msg) { | ||
const engine = RED.nodes.getNode(config.engine); | ||
@@ -20,22 +21,42 @@ | ||
query = { | ||
...query, | ||
...query | ||
}; | ||
client.userTasks | ||
.query(query, { identity: engine.identity }) | ||
client.userTasks.query(query, { identity: engine.identity} ) | ||
.then((matchingFlowNodes) => { | ||
if (config.sendtype === 'array') { | ||
msg.payload = { userTasks: matchingFlowNodes.userTasks || [] }; | ||
if ( | ||
!config.force_send_array && | ||
matchingFlowNodes && | ||
matchingFlowNodes.userTasks && | ||
matchingFlowNodes.userTasks.length == 1 | ||
) { | ||
userTask = matchingFlowNodes.userTasks[0]; | ||
msg.payload = { userTask: userTask }; | ||
node.send(msg); | ||
} else if (config.sendtype === 'multi' && matchingFlowNodes?.userTasks?.length > 1) { | ||
matchingFlowNodes.userTasks.forEach((userTask) => { | ||
msg.payload = { userTask }; | ||
} else { | ||
if (!config.force_send_array) { | ||
if (config.multisend && matchingFlowNodes.userTasks && matchingFlowNodes.userTasks.length > 1) { | ||
matchingFlowNodes.userTasks.forEach((userTask) => { | ||
msg.payload = { userTask: userTask }; | ||
node.send(msg); | ||
}); | ||
} else { | ||
if (matchingFlowNodes.userTasks == 1) { | ||
msg.payload = { | ||
userTasks: matchingFlowNodes.userTasks, | ||
}; | ||
node.send(msg); | ||
} else { | ||
node.log(`No user tasks found for query: ${JSON.stringify(query)}`); | ||
} | ||
} | ||
} else { | ||
msg.payload = { | ||
userTasks: matchingFlowNodes.userTasks || [], | ||
}; | ||
node.send(msg); | ||
}); | ||
} else if (matchingFlowNodes?.userTasks?.length >= 1) { | ||
msg.payload = { userTask: matchingFlowNodes.userTasks[0] }; | ||
node.send(msg); | ||
} else node.log(`No user tasks found for query: ${JSON.stringify(query)}`); | ||
}) | ||
.catch((error) => { | ||
} | ||
} | ||
}).catch((error) => { | ||
node.error(error); | ||
@@ -42,0 +63,0 @@ }); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
304979
71
4519