@5minds/node-red-contrib-processcube 1.3.2-feature-a99d33-m24jmsi2 → 1.4.0-develop-d2cbe1-m2d1k6k4
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/externaltask-input.html +23 -0
- package/externaltask-input.js +64 -62
- package/package.json +2 -3
- package/processcube-engine-config.html +41 -5
- package/processcube-engine-config.js +9 -6
- package/processes/User-Task-Sample.bpmn +20 -17
- package/processinstance-delete.html +58 -0
- package/processinstance-delete.js +55 -0
package/externaltask-input.html
CHANGED
@@ -6,6 +6,8 @@
|
|
6
6
|
name: { value: '' },
|
7
7
|
engine: { value: '', type: 'processcube-engine-config' },
|
8
8
|
topic: { value: '' },
|
9
|
+
workerConfig: { value: '{}'},
|
10
|
+
workerConfigType: { value: 'json'}
|
9
11
|
},
|
10
12
|
inputs: 0,
|
11
13
|
outputs: 1,
|
@@ -13,6 +15,23 @@
|
|
13
15
|
label: function () {
|
14
16
|
return this.name || 'externaltask-input';
|
15
17
|
},
|
18
|
+
oneditprepare: function () {
|
19
|
+
$('#node-input-workerConfig').typedInput({
|
20
|
+
default: 'json',
|
21
|
+
types: ['json'],
|
22
|
+
});
|
23
|
+
|
24
|
+
$('#node-input-workerConfig').typedInput('value', this.workerConfig);
|
25
|
+
$('#node-input-workerConfig').typedInput('type', this.workerConfigType);
|
26
|
+
},
|
27
|
+
oneditsave: function () {
|
28
|
+
this.workerConfig = $('#node-input-workerConfig').typedInput('value');
|
29
|
+
if (this.workerConfig == '') {
|
30
|
+
this.workerConfig = '{}'
|
31
|
+
$('#node-input-workerConfig').typedInput('value', '{}');
|
32
|
+
}
|
33
|
+
this.workerConfigType = $('#node-input-workerConfig').typedInput('type');
|
34
|
+
},
|
16
35
|
});
|
17
36
|
</script>
|
18
37
|
|
@@ -29,6 +48,10 @@
|
|
29
48
|
<label for="node-input-topic"><i class="fa fa-tag"></i> Topic</label>
|
30
49
|
<input type="text" id="node-input-topic" placeholder="Topic of ExternalTask" />
|
31
50
|
</div>
|
51
|
+
<div class="form-row">
|
52
|
+
<label for="node-input-workerConfig"><i class="fa fa-tag"></i> Config</label>
|
53
|
+
<input type="text" id="node-input-workerConfig" />
|
54
|
+
</div>
|
32
55
|
</script>
|
33
56
|
|
34
57
|
<script type="text/markdown" data-help-name="externaltask-input">
|
package/externaltask-input.js
CHANGED
@@ -16,7 +16,7 @@ module.exports = function (RED) {
|
|
16
16
|
var node = this;
|
17
17
|
var flowContext = node.context().flow;
|
18
18
|
|
19
|
-
const engine =
|
19
|
+
const engine = RED.nodes.getNode(config.engine);
|
20
20
|
|
21
21
|
const client = engine.engineClient;
|
22
22
|
|
@@ -32,83 +32,85 @@ module.exports = function (RED) {
|
|
32
32
|
eventEmitter = flowContext.get('emitter');
|
33
33
|
}
|
34
34
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
};
|
35
|
+
const etwCallback = async (payload, externalTask) => {
|
36
|
+
const saveHandleCallback = (data, callback) => {
|
37
|
+
try {
|
38
|
+
callback(data);
|
39
|
+
} catch (error) {
|
40
|
+
node.error(`Error in callback 'saveHandleCallback': ${error.message}`);
|
41
|
+
}
|
42
|
+
};
|
44
43
|
|
45
|
-
|
46
|
-
|
47
|
-
|
44
|
+
return await new Promise((resolve, reject) => {
|
45
|
+
const handleFinishTask = (msg) => {
|
46
|
+
let result = RED.util.encodeObject(msg.payload);
|
48
47
|
|
49
|
-
|
50
|
-
|
51
|
-
|
48
|
+
node.log(
|
49
|
+
`handle event for *external task flowNodeInstanceId* '${externalTask.flowNodeInstanceId}' and *processInstanceId* ${externalTask.processInstanceId} with result ${result} on msg._msgid ${msg._msgid}.`
|
50
|
+
);
|
52
51
|
|
53
|
-
|
54
|
-
|
55
|
-
|
52
|
+
if (externalTask.flowNodeInstanceId) {
|
53
|
+
delete started_external_tasks[externalTask.flowNodeInstanceId];
|
54
|
+
}
|
56
55
|
|
57
|
-
|
56
|
+
showStatus(node, Object.keys(started_external_tasks).length);
|
58
57
|
|
59
|
-
|
60
|
-
|
61
|
-
|
58
|
+
//resolve(result);
|
59
|
+
saveHandleCallback(result, resolve);
|
60
|
+
};
|
61
|
+
|
62
|
+
const handleErrorTask = (msg) => {
|
63
|
+
node.log(
|
64
|
+
`handle error event for *external task flowNodeInstanceId* '${externalTask.flowNodeInstanceId}' and *processInstanceId* '${externalTask.processInstanceId}' on *msg._msgid* '${msg._msgid}'.`
|
65
|
+
);
|
62
66
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
);
|
67
|
+
if (externalTask.flowNodeInstanceId) {
|
68
|
+
delete started_external_tasks[externalTask.flowNodeInstanceId];
|
69
|
+
}
|
67
70
|
|
68
|
-
|
69
|
-
delete started_external_tasks[externalTask.flowNodeInstanceId];
|
70
|
-
}
|
71
|
+
showStatus(node, Object.keys(started_external_tasks).length);
|
71
72
|
|
72
|
-
|
73
|
+
// TODO: with reject, the default error handling is proceed
|
74
|
+
// SEE: https://github.com/5minds/ProcessCube.Engine.Client.ts/blob/develop/src/ExternalTaskWorker.ts#L180
|
75
|
+
// reject(result);
|
76
|
+
//resolve(msg);
|
77
|
+
saveHandleCallback(msg, resolve);
|
78
|
+
};
|
73
79
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
saveHandleCallback(msg, resolve);
|
79
|
-
};
|
80
|
+
eventEmitter.once(`handle-${externalTask.flowNodeInstanceId}`, (msg, isError = false) => {
|
81
|
+
node.log(
|
82
|
+
`handle event for *external task flowNodeInstanceId* '${externalTask.flowNodeInstanceId}' and *processInstanceId* '${externalTask.processInstanceId}' with *msg._msgid* '${msg._msgid}' and *isError* '${isError}'`
|
83
|
+
);
|
80
84
|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
);
|
85
|
+
if (isError) {
|
86
|
+
handleErrorTask(msg);
|
87
|
+
} else {
|
88
|
+
handleFinishTask(msg);
|
89
|
+
}
|
90
|
+
});
|
85
91
|
|
86
|
-
|
87
|
-
handleErrorTask(msg);
|
88
|
-
} else {
|
89
|
-
handleFinishTask(msg);
|
90
|
-
}
|
91
|
-
});
|
92
|
+
started_external_tasks[externalTask.flowNodeInstanceId] = externalTask;
|
92
93
|
|
93
|
-
|
94
|
+
showStatus(node, Object.keys(started_external_tasks).length);
|
94
95
|
|
95
|
-
|
96
|
+
let msg = {
|
97
|
+
_msgid: RED.util.generateId(),
|
98
|
+
task: RED.util.encodeObject(externalTask),
|
99
|
+
payload: payload,
|
100
|
+
flowNodeInstanceId: externalTask.flowNodeInstanceId,
|
101
|
+
processInstanceId: externalTask.processInstanceId
|
102
|
+
};
|
96
103
|
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
payload: payload,
|
101
|
-
flowNodeInstanceId: externalTask.flowNodeInstanceId,
|
102
|
-
processInstanceId: externalTask.processInstanceId
|
103
|
-
};
|
104
|
+
node.log(
|
105
|
+
`Received *external task flowNodeInstanceId* '${externalTask.flowNodeInstanceId}' and *processInstanceId* '${externalTask.processInstanceId}' with *msg._msgid* '${msg._msgid}'`
|
106
|
+
);
|
104
107
|
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
+
node.send(msg);
|
109
|
+
});
|
110
|
+
};
|
108
111
|
|
109
|
-
|
110
|
-
|
111
|
-
})
|
112
|
+
client.externalTasks
|
113
|
+
.subscribeToExternalTaskTopic(config.topic, etwCallback, RED.util.evaluateNodeProperty(config.workerConfig, 'json', node))
|
112
114
|
.then(async (externalTaskWorker) => {
|
113
115
|
node.status({ fill: 'blue', shape: 'ring', text: 'subcribed' });
|
114
116
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@5minds/node-red-contrib-processcube",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.4.0-develop-d2cbe1-m2d1k6k4",
|
4
4
|
"license": "MIT",
|
5
5
|
"description": "Node-RED nodes for ProcessCube",
|
6
6
|
"scripts": {
|
@@ -45,12 +45,11 @@
|
|
45
45
|
"processEventListener": "process-event-listener.js",
|
46
46
|
"processcubeEngineConfig": "processcube-engine-config.js",
|
47
47
|
"ProcessinstanceQuery": "processinstance-query.js",
|
48
|
+
"ProcessinstanceDelete": "processinstance-delete.js",
|
48
49
|
"ProcessdefinitionQuery": "processdefinition-query.js",
|
49
50
|
"messageEventTrigger": "message-event-trigger.js",
|
50
51
|
"signalEventTrigger": "signal-event-trigger.js",
|
51
52
|
"userTaskEventListener": "usertask-event-listener.js",
|
52
|
-
"UserTaskNewListener": "usertask-new-listener.js",
|
53
|
-
"UserTaskFinishedListener": "usertask-finished-listener.js",
|
54
53
|
"UserTaskInput": "usertask-input.js",
|
55
54
|
"UserTaskOutput": "usertask-output.js",
|
56
55
|
"WaitForUsertask": "wait-for-usertask.js"
|
@@ -2,16 +2,52 @@
|
|
2
2
|
RED.nodes.registerType('processcube-engine-config', {
|
3
3
|
category: 'config',
|
4
4
|
defaults: {
|
5
|
-
name
|
5
|
+
name: { value: '' },
|
6
6
|
url: { value: 'http://engine:8000', required: true },
|
7
|
+
urlType: { type: 'str'},
|
8
|
+
clientId: { value: '' },
|
9
|
+
clientIdType: { type: 'str' },
|
10
|
+
clientSecret: { value: '' },
|
11
|
+
clientSecretType: { type: 'str' },
|
7
12
|
},
|
8
13
|
label: function () {
|
9
14
|
return this.name || this.url;
|
10
15
|
},
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
16
|
+
oneditprepare: function () {
|
17
|
+
$('#node-config-input-url').typedInput({
|
18
|
+
default: 'str',
|
19
|
+
types: ['str', 'global', 'flow', 'env', 'msg', 'cred'],
|
20
|
+
});
|
21
|
+
|
22
|
+
$('#node-config-input-clientId').typedInput({
|
23
|
+
default: 'str',
|
24
|
+
types: ['str', 'global', 'flow', 'env', 'msg', 'cred'],
|
25
|
+
});
|
26
|
+
|
27
|
+
$('#node-config-input-clientSecret').typedInput({
|
28
|
+
default: 'str',
|
29
|
+
types: ['str', 'global', 'flow', 'env', 'msg', 'cred'],
|
30
|
+
});
|
31
|
+
|
32
|
+
$('#node-config-input-url').typedInput('value', this.url);
|
33
|
+
$('#node-config-input-url').typedInput('type', this.urlType);
|
34
|
+
|
35
|
+
$('#node-config-input-clientId').typedInput('value', this.clientId);
|
36
|
+
$('#node-config-input-clientId').typedInput('type', this.clientIdType);
|
37
|
+
|
38
|
+
$('#node-config-input-clientSecret').typedInput('value', this.clientSecret);
|
39
|
+
$('#node-config-input-clientSecret').typedInput('type', this.clientSecretType);
|
40
|
+
},
|
41
|
+
oneditsave: function () {
|
42
|
+
this.url = $('#node-config-input-url').typedInput('value');
|
43
|
+
this.urlType = $('#node-config-input-url').typedInput('type');
|
44
|
+
|
45
|
+
this.clientId = $('#node-config-input-clientId').typedInput('value');
|
46
|
+
this.clientIdType = $('#node-config-input-clientId').typedInput('type');
|
47
|
+
|
48
|
+
this.clientSecret = $('#node-config-input-clientSecret').typedInput('value');
|
49
|
+
this.clientSecretType = $('#node-config-input-clientSecret').typedInput('type');
|
50
|
+
},
|
15
51
|
});
|
16
52
|
</script>
|
17
53
|
|
@@ -9,20 +9,23 @@ module.exports = function (RED) {
|
|
9
9
|
RED.nodes.createNode(this, n);
|
10
10
|
const node = this;
|
11
11
|
const identityChangedCallbacks = [];
|
12
|
-
this.url = n.url;
|
12
|
+
this.url = RED.util.evaluateNodeProperty(n.url, n.urlType, node);
|
13
13
|
this.identity = null;
|
14
|
-
|
14
|
+
|
15
|
+
this.credentials.clientId = RED.util.evaluateNodeProperty(n.clientId, n.clientIdType, node);
|
16
|
+
this.credentials.clientSecret = RED.util.evaluateNodeProperty(n.clientSecret, n.clientSecretType, node);
|
17
|
+
|
15
18
|
this.registerOnIdentityChanged = function (callback) {
|
16
19
|
identityChangedCallbacks.push(callback);
|
17
20
|
};
|
18
21
|
|
19
|
-
this.isIdentityReady = function() {
|
22
|
+
this.isIdentityReady = function () {
|
20
23
|
if (this.credentials.clientId && this.credentials.clientSecret) {
|
21
24
|
return this.identity != null;
|
22
25
|
} else {
|
23
26
|
return true;
|
24
27
|
}
|
25
|
-
}
|
28
|
+
};
|
26
29
|
|
27
30
|
this.setIdentity = (identity) => {
|
28
31
|
node.log(`setIdentity: ${JSON.stringify(identity)}`);
|
@@ -50,7 +53,7 @@ module.exports = function (RED) {
|
|
50
53
|
this.credentials.clientId,
|
51
54
|
this.credentials.clientSecret,
|
52
55
|
authorityUrl,
|
53
|
-
node
|
56
|
+
node
|
54
57
|
).catch((reason) => {
|
55
58
|
console.error(reason);
|
56
59
|
node.error(reason);
|
@@ -136,7 +139,7 @@ async function startRefreshingIdentityCycle(clientId, clientSecret, authorityUrl
|
|
136
139
|
if (retries === 0) {
|
137
140
|
console.error(
|
138
141
|
'Could not refresh identity for external task worker processes. Stopping all external task workers.',
|
139
|
-
{ error }
|
142
|
+
{ error }
|
140
143
|
);
|
141
144
|
return;
|
142
145
|
}
|
@@ -16,23 +16,26 @@
|
|
16
16
|
<bpmn:userTask id="user_task" name="User Task">
|
17
17
|
<bpmn:extensionElements>
|
18
18
|
<camunda:formData>
|
19
|
-
<camunda:formField id="checkbox" label="
|
20
|
-
<camunda:formField id="
|
21
|
-
<camunda:formField id="date
|
22
|
-
<camunda:formField id="
|
23
|
-
<camunda:formField id="
|
24
|
-
<camunda:formField id="
|
25
|
-
<camunda:formField id="
|
26
|
-
<camunda:formField id="
|
27
|
-
<camunda:formField id="
|
28
|
-
<camunda:formField id="
|
29
|
-
<camunda:formField id="
|
30
|
-
<camunda:formField id="
|
31
|
-
<camunda:formField id="
|
32
|
-
<camunda:formField id="
|
33
|
-
<camunda:formField id="
|
34
|
-
<camunda:formField id="
|
35
|
-
<camunda:formField id="
|
19
|
+
<camunda:formField id="checkbox" label="Checkbox" type="checkbox" customForm="{"entries":[{"key":"key","value":"value"}],"hint":"hint"}" />
|
20
|
+
<camunda:formField id="colorpicker" label="Colorpicker" type="color" defaultValue="#e32626" customForm="{"hint":"hint"}" />
|
21
|
+
<camunda:formField id="date" label="Date" type="date" defaultValue="2024-10-18" customForm="{"hint":"hint"}" />
|
22
|
+
<camunda:formField id="datetime" label="Datetime" type="datetime-local" defaultValue="2024-10-19T12:41" customForm="{"hint":"hint"}" />
|
23
|
+
<camunda:formField id="email" label="Email" type="email" customForm="{"hint":"hint"}" />
|
24
|
+
<camunda:formField id="header" type="header" defaultValue="Header" />
|
25
|
+
<camunda:formField id="hidden" type="hidden" defaultValue="hidden" />
|
26
|
+
<camunda:formField id="number" label="Number" type="number" customForm="{"step":1.5,"hint":"hint"}" />
|
27
|
+
<camunda:formField id="month" label="Month" type="month" defaultValue="2024-07" customForm="{"hint":"hint"}" />
|
28
|
+
<camunda:formField id="paragraph" type="paragraph" defaultValue="A lot of words..." />
|
29
|
+
<camunda:formField id="password" label="Pasword" type="password" customForm="{"hint":"hint"}" />
|
30
|
+
<camunda:formField id="radio" label="Radio" type="radio" customForm="{"entries":[{"key":"key","value":"value"}],"hint":"hint"}" />
|
31
|
+
<camunda:formField id="range" label="Range" type="range" defaultValue="30" customForm="{"step":0.4,"min":3,"hint":"hint"}" />
|
32
|
+
<camunda:formField id="select" label="Select" type="select" customForm="{"entries":[{"key":"key","value":"value"}],"hint":"hint"}" />
|
33
|
+
<camunda:formField id="tel" label="Tel." type="tel" customForm="{"hint":"hint"}" />
|
34
|
+
<camunda:formField id="text" label="Text" type="string" customForm="{"hint":"hint"}" />
|
35
|
+
<camunda:formField id="textarea" label="Textarea" type="textarea" defaultValue="more words..." customForm="{"rows":14,"hint":"hint"}" />
|
36
|
+
<camunda:formField id="time" label="Time" type="time" defaultValue="11:54" customForm="{"hint":"hint"}" />
|
37
|
+
<camunda:formField id="url" label="URL" type="url" customForm="{"hint":"hint"}" />
|
38
|
+
<camunda:formField id="week" label="Week" type="week" defaultValue="2024-W37" customForm="{"hint":"hint"}" />
|
36
39
|
</camunda:formData>
|
37
40
|
</bpmn:extensionElements>
|
38
41
|
<bpmn:incoming>Flow_142awo6</bpmn:incoming>
|
@@ -0,0 +1,58 @@
|
|
1
|
+
<script type="text/javascript">
|
2
|
+
RED.nodes.registerType('processinstance-delete', {
|
3
|
+
category: 'ProcessCube DevOps',
|
4
|
+
color: '#02AFD6',
|
5
|
+
defaults: {
|
6
|
+
name: { value: '' },
|
7
|
+
engine: { value: '', type: 'processcube-engine-config' },
|
8
|
+
time: { value: '', type: 'number' },
|
9
|
+
time_type: { value: 'hours' },
|
10
|
+
},
|
11
|
+
inputs: 1,
|
12
|
+
outputs: 1,
|
13
|
+
icon: 'font-awesome/fa-sign-in',
|
14
|
+
label: function () {
|
15
|
+
return this.name || 'processinstance-delete';
|
16
|
+
},
|
17
|
+
});
|
18
|
+
</script>
|
19
|
+
|
20
|
+
<script type="text/html" data-template-name="processinstance-delete">
|
21
|
+
<div class="form-row">
|
22
|
+
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
23
|
+
<input type="text" id="node-input-name" placeholder="Name" />
|
24
|
+
</div>
|
25
|
+
<div class="form-row">
|
26
|
+
<label for="node-input-engine"><i class="fa fa-tag"></i> Engine-URL</label>
|
27
|
+
<input type="text" id="node-input-engine" placeholder="Engine-URL" />
|
28
|
+
</div>
|
29
|
+
<div class="form-row">
|
30
|
+
<label for="node-input-time"><i class="fa fa-tag"></i> Time</label>
|
31
|
+
<input type="text" id="node-input-time" />
|
32
|
+
</div>
|
33
|
+
<div class="form-row">
|
34
|
+
<label for="node-input-time_type"><i class="fa fa-sliders"></i> Period</label>
|
35
|
+
<select id="node-input-time_type" style="width: 70%;">
|
36
|
+
<option value="hours">Hours</option>
|
37
|
+
<option value="days">Days</option>
|
38
|
+
</select>
|
39
|
+
</div>
|
40
|
+
</script>
|
41
|
+
|
42
|
+
<script type="text/markdown" data-help-name="processinstance-delete">
|
43
|
+
Delete old instances of a process model in the ProcessCube.
|
44
|
+
|
45
|
+
## Inputs
|
46
|
+
|
47
|
+
: payload.time (number): The number of given time periods.
|
48
|
+
: payload.time_type ('hours' | 'days'): The type of time period to use.
|
49
|
+
|
50
|
+
## Outputs
|
51
|
+
|
52
|
+
: payload (string[]): The ids of the processinstances that were deleted.
|
53
|
+
|
54
|
+
### References
|
55
|
+
|
56
|
+
- [The ProcessCube Developer Network](https://processcube.io) - All documentation for the ProcessCube© platform
|
57
|
+
- [Node-RED Integration in ProcessCube©](https://processcube.io/docs/node-red) - Node-RED integration in ProcessCube©
|
58
|
+
</script>
|
@@ -0,0 +1,55 @@
|
|
1
|
+
module.exports = function (RED) {
|
2
|
+
function ProcessInstanceDelete(config) {
|
3
|
+
RED.nodes.createNode(this, config);
|
4
|
+
var node = this;
|
5
|
+
|
6
|
+
node.on('input', async function (msg) {
|
7
|
+
const engine = RED.nodes.getNode(config.engine);
|
8
|
+
const client = engine.engineClient;
|
9
|
+
|
10
|
+
if (!client) {
|
11
|
+
node.error('No engine configured.');
|
12
|
+
return;
|
13
|
+
}
|
14
|
+
let timeMultiplier;
|
15
|
+
if (msg.payload.time_type) {
|
16
|
+
timeMultiplier = msg.payload.time_type == 'hours' ? 1 : 24;
|
17
|
+
} else {
|
18
|
+
timeMultiplier = config.time_type == 'hours' ? 1 : 24;
|
19
|
+
}
|
20
|
+
|
21
|
+
const timeToUse = msg.payload.time ? msg.payload.time : config.time;
|
22
|
+
|
23
|
+
try {
|
24
|
+
const fetchInstancesByState = async (state) => {
|
25
|
+
const result = await client.processInstances.query({ state });
|
26
|
+
return result.processInstances;
|
27
|
+
};
|
28
|
+
|
29
|
+
const finishedInstances = await fetchInstancesByState('finished');
|
30
|
+
const terminatedInstances = await fetchInstancesByState('terminated');
|
31
|
+
const errorInstances = await fetchInstancesByState('error');
|
32
|
+
|
33
|
+
let allInstances = [...finishedInstances, ...terminatedInstances, ...errorInstances];
|
34
|
+
|
35
|
+
const today = new Date();
|
36
|
+
|
37
|
+
const oldTasks = allInstances.filter((instance) => {
|
38
|
+
const finishedDate = new Date(instance.finishedAt);
|
39
|
+
const diffInHours = (today - finishedDate) / (1000 * 60 * 60);
|
40
|
+
return diffInHours > Number(timeToUse) * timeMultiplier;
|
41
|
+
});
|
42
|
+
|
43
|
+
const ids = oldTasks.map((obj) => obj.processInstanceId);
|
44
|
+
msg.payload = ids;
|
45
|
+
|
46
|
+
await client.processInstances.deleteProcessInstances(ids, true, engine.identity);
|
47
|
+
node.send(msg);
|
48
|
+
} catch (error) {
|
49
|
+
node.error(error);
|
50
|
+
}
|
51
|
+
});
|
52
|
+
}
|
53
|
+
|
54
|
+
RED.nodes.registerType('processinstance-delete', ProcessInstanceDelete);
|
55
|
+
};
|