@5minds/node-red-contrib-processcube 1.6.0-process-instance-delete-hotfix-8d236b-m4wobqqt → 1.6.0-process-instance-delete-hotfix-ae3190-m4wq1fcd
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.
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@5minds/node-red-contrib-processcube",
|
3
|
-
"version": "1.6.0-process-instance-delete-hotfix-
|
3
|
+
"version": "1.6.0-process-instance-delete-hotfix-ae3190-m4wq1fcd",
|
4
4
|
"license": "MIT",
|
5
5
|
"description": "Node-RED nodes for ProcessCube",
|
6
6
|
"scripts": {
|
@@ -54,7 +54,8 @@ module.exports = function (RED) {
|
|
54
54
|
msg.payload = { successfulDeletions: [], failedDeletions: [] };
|
55
55
|
|
56
56
|
let hasMoreResults = true;
|
57
|
-
|
57
|
+
let sumSuccessful = 0;
|
58
|
+
let sumFailed = 0;
|
58
59
|
while (hasMoreResults) {
|
59
60
|
const result = await client.processInstances.query(
|
60
61
|
{
|
@@ -78,15 +79,18 @@ module.exports = function (RED) {
|
|
78
79
|
try {
|
79
80
|
await client.processInstances.deleteProcessInstances(ids, true);
|
80
81
|
msg.payload.successfulDeletions.push(...ids);
|
81
|
-
|
82
|
+
sumSuccessful += ids.length;
|
82
83
|
} catch (deleteError) {
|
83
84
|
var message = JSON.stringify(deleteError);
|
85
|
+
sumFailed += ids.length;
|
84
86
|
ids.forEach((id) => {
|
85
87
|
msg.payload.failedDeletions.push({ id, error: message });
|
86
88
|
});
|
87
89
|
node.warn(`Failed to delete some process instances for Model-ID: ${modelId}. Error: ${message}`);
|
88
90
|
}
|
89
91
|
}
|
92
|
+
node.log(`Successfully deleted ${sumSuccessful} process instances and ${sumFailed} failed to delete process instances for Model-ID: ${modelId}.`);
|
93
|
+
|
90
94
|
|
91
95
|
node.send(msg);
|
92
96
|
} catch (queryError) {
|