Skip to content

Commit

Permalink
readd engine identity
Browse files Browse the repository at this point in the history
  • Loading branch information
aScharfe committed Dec 20, 2024
1 parent 7eea00e commit eacdd0a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions processinstance-delete.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ module.exports = function (RED) {
processModelId: modelId,
finishedBefore: deletionDate.toISOString(),
state: ["finished", "error", "terminated"],
},
{ identity: node.engine.identity }
}
);

if (result.processInstances.length === 0) {
Expand All @@ -69,13 +68,13 @@ module.exports = function (RED) {
var batch = ids.slice(i, i + batchSize);
try
{
await client.processInstances.deleteProcessInstances(batch, true);
await client.processInstances.deleteProcessInstances(batch, true, node.engine.identity);
msg.payload.successfulDeletions.push(...batch);
}
catch (deleteError)
{
batch.forEach((id) => {msg.payload.failedDeletions.push({ id, error: deleteError.message });});
//node.warn(`Failed to delete process instances in batch for Model-ID: ${modelId}: ${batch.join(', ')}. Error: ${deleteError.message}`);
node.warn(`Failed to delete process instances in batch for Model-ID: ${modelId}: ${batch.join(', ')}. Error: ${deleteError.message}`);
}
}

Expand Down

0 comments on commit eacdd0a

Please sign in to comment.