@5minds/node-red-contrib-processcube 1.5.1-feature-6ba46c-m2lk79r9 → 1.5.2-develop-7add47-m2xezg12
Sign up to get free protection for your applications and to get access to all the features.
- package/externaltask-input.js +2 -9
- package/package.json +1 -1
- package/processinstance-delete.html +16 -11
- package/processinstance-delete.js +12 -9
package/externaltask-input.js
CHANGED
@@ -98,7 +98,7 @@ module.exports = function (RED) {
|
|
98
98
|
task: RED.util.encodeObject(externalTask),
|
99
99
|
payload: payload,
|
100
100
|
flowNodeInstanceId: externalTask.flowNodeInstanceId,
|
101
|
-
processInstanceId: externalTask.processInstanceId
|
101
|
+
processInstanceId: externalTask.processInstanceId
|
102
102
|
};
|
103
103
|
|
104
104
|
node.log(
|
@@ -110,11 +110,7 @@ module.exports = function (RED) {
|
|
110
110
|
};
|
111
111
|
|
112
112
|
client.externalTasks
|
113
|
-
.subscribeToExternalTaskTopic(
|
114
|
-
config.topic,
|
115
|
-
etwCallback,
|
116
|
-
RED.util.evaluateNodeProperty(config.workerConfig, 'json', node)
|
117
|
-
)
|
113
|
+
.subscribeToExternalTaskTopic(config.topic, etwCallback, RED.util.evaluateNodeProperty(config.workerConfig, 'json', node))
|
118
114
|
.then(async (externalTaskWorker) => {
|
119
115
|
node.status({ fill: 'blue', shape: 'ring', text: 'subcribed' });
|
120
116
|
|
@@ -139,9 +135,6 @@ module.exports = function (RED) {
|
|
139
135
|
|
140
136
|
showStatus(node, Object.keys(started_external_tasks).length);
|
141
137
|
break;
|
142
|
-
case 'fetchAndLock':
|
143
|
-
node.status({});
|
144
|
-
node.error(`Worker error ${errorType}: ${error.message}`);
|
145
138
|
default:
|
146
139
|
node.error(`Worker error ${errorType}: ${error.message}`);
|
147
140
|
break;
|
package/package.json
CHANGED
@@ -5,6 +5,7 @@
|
|
5
5
|
defaults: {
|
6
6
|
name: { value: '' },
|
7
7
|
engine: { value: '', type: 'processcube-engine-config' },
|
8
|
+
modelid: { value: '' },
|
8
9
|
time: { value: '', type: 'number' },
|
9
10
|
time_type: { value: 'hours' },
|
10
11
|
},
|
@@ -27,11 +28,15 @@
|
|
27
28
|
<input type="text" id="node-input-engine" placeholder="Engine-URL" />
|
28
29
|
</div>
|
29
30
|
<div class="form-row">
|
30
|
-
<label for="node-input-
|
31
|
+
<label for="node-input-modelid"><i class="fa fa-tag"></i> Model-ID</label>
|
32
|
+
<input type="text" id="node-input-modelid" />
|
33
|
+
</div>
|
34
|
+
<div class="form-row">
|
35
|
+
<label for="node-input-time"><i class="fa fa-tag"></i> Duration</label>
|
31
36
|
<input type="text" id="node-input-time" />
|
32
37
|
</div>
|
33
38
|
<div class="form-row">
|
34
|
-
<label for="node-input-time_type"><i class="fa fa-sliders"></i>
|
39
|
+
<label for="node-input-time_type"><i class="fa fa-sliders"></i> Time Unit</label>
|
35
40
|
<select id="node-input-time_type" style="width: 70%;">
|
36
41
|
<option value="hours">Hours</option>
|
37
42
|
<option value="days">Days</option>
|
@@ -40,19 +45,19 @@
|
|
40
45
|
</script>
|
41
46
|
|
42
47
|
<script type="text/markdown" data-help-name="processinstance-delete">
|
43
|
-
Delete old instances of a process model in the ProcessCube.
|
48
|
+
Delete old instances of a process model in the ProcessCube.
|
44
49
|
|
45
|
-
## Inputs
|
50
|
+
## Inputs
|
46
51
|
|
47
|
-
: payload.time (number): The number of given time periods.
|
48
|
-
: payload.time_type ('hours' | 'days'): The type of time period to use.
|
52
|
+
: payload.time (number): The number of given time periods.
|
53
|
+
: payload.time_type ('hours' | 'days'): The type of time period to use.
|
49
54
|
|
50
|
-
## Outputs
|
55
|
+
## Outputs
|
51
56
|
|
52
|
-
: payload (string[]): The ids of the processinstances that were deleted.
|
57
|
+
: payload (string[]): The ids of the processinstances that were deleted.
|
53
58
|
|
54
|
-
### References
|
59
|
+
### References
|
55
60
|
|
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©
|
61
|
+
- [The ProcessCube Developer Network](https://processcube.io) - All documentation for the ProcessCube© platform
|
62
|
+
- [Node-RED Integration in ProcessCube©](https://processcube.io/docs/node-red) - Node-RED integration in ProcessCube©
|
58
63
|
</script>
|
@@ -19,18 +19,21 @@ module.exports = function (RED) {
|
|
19
19
|
}
|
20
20
|
|
21
21
|
const timeToUse = msg.payload.time ? msg.payload.time : config.time;
|
22
|
+
const modelId = msg.payload.processModelId
|
23
|
+
? msg.payload.processModelId != ''
|
24
|
+
? msg.payload.processModelId
|
25
|
+
: undefined
|
26
|
+
: config.modelid != ''
|
27
|
+
? config.modelid
|
28
|
+
: undefined;
|
22
29
|
|
23
30
|
try {
|
24
|
-
const
|
25
|
-
|
26
|
-
|
27
|
-
};
|
28
|
-
|
29
|
-
const finishedInstances = await fetchInstancesByState('finished');
|
30
|
-
const terminatedInstances = await fetchInstancesByState('terminated');
|
31
|
-
const errorInstances = await fetchInstancesByState('error');
|
31
|
+
const result = await client.processInstances.query({
|
32
|
+
processModelId: modelId,
|
33
|
+
identity: engine.identity,
|
34
|
+
});
|
32
35
|
|
33
|
-
let allInstances =
|
36
|
+
let allInstances = result.processInstances.filter((instance) => instance.state != 'suspended');
|
34
37
|
|
35
38
|
const today = new Date();
|
36
39
|
|