@5minds/node-red-contrib-processcube
Advanced tools
Comparing version 1.6.0-process-instance-delete-hotfix-ac32d5-m4vc6xuq to 1.6.0-process-instance-delete-hotfix-babe1e-m4ve9aj6
{ | ||
"name": "@5minds/node-red-contrib-processcube", | ||
"version": "1.6.0-process-instance-delete-hotfix-ac32d5-m4vc6xuq", | ||
"version": "1.6.0-process-instance-delete-hotfix-babe1e-m4ve9aj6", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "Node-RED nodes for ProcessCube", |
@@ -25,5 +25,5 @@ module.exports = function (RED) { | ||
const multiplier = isHours ? 1 : 24; | ||
node.log(`Multiplikator: ${multiplier}`); | ||
const deletionDate = new Date(Date.now() - timeToUse * multiplier * 60 * 60 * 1000); | ||
node.log(`Errechnetes Datum: ${deletionDate}`); | ||
const modelId = msg.payload.processModelId?.trim() || config.modelid?.trim(); | ||
@@ -41,3 +41,3 @@ if (!modelId) { | ||
finishedBefore: deletionDate.toISOString(), | ||
state: ['finished', 'error', 'terminated'], | ||
state: ["finished", "error", "terminated"], | ||
}, | ||
@@ -48,3 +48,3 @@ { identity: node.engine.identity } | ||
if (result.processInstances.length === 0) { | ||
node.log(`No process instances to delete for Model-ID: ${modelId}`); | ||
node.log(`No process instances to delete for Model-ID: ${modelId} and given Date: ${deletionDate.toISOString()}`); | ||
node.send(msg); | ||
@@ -51,0 +51,0 @@ return; |
515312
9864