-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprocessinstance-delete.html
110 lines (96 loc) · 3.89 KB
/
processinstance-delete.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<script type="text/javascript">
RED.nodes.registerType('processinstance-delete', {
category: 'ProcessCube DevOps',
color: '#02AFD6',
defaults: {
name: { value: '' },
engine: { value: '', type: 'processcube-engine-config' },
modelid: { value: '' },
duration: { value: '', type: 'number' },
time_type: { value: '' },
batch_size: { value: '100', type: 'number' },
},
inputs: 1,
outputs: 1,
icon: 'font-awesome/fa-sign-in',
label: function () {
return this.name || 'processinstance-delete';
},
});
</script>
<script type="text/html" data-template-name="processinstance-delete">
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name" />
</div>
<div class="form-row">
<label for="node-input-engine"><i class="fa fa-tag"></i> Engine-URL</label>
<input type="text" id="node-input-engine" placeholder="Engine-URL" />
</div>
<div class="form-row">
<label for="node-input-modelid"><i class="fa fa-tag"></i> Model-ID</label>
<input type="text" id="node-input-modelid" />
</div>
<div class="form-row">
<label for="node-input-duration"><i class="fa fa-tag"></i> Duration</label>
<input type="text" id="node-input-duration" />
</div>
<div class="form-row">
<label for="node-input-time_type"><i class="fa fa-sliders"></i> Time Unit</label>
<select id="node-input-time_type" style="width: 70%;">
<option value="hours">Hours</option>
<option value="days">Days</option>
</select>
</div>
<div class="form-row">
<label for="node-input-batch-size"><i class="fa fa-tag"></i> Batch Size</label>
<input type="text" id="node-input-batch_size" />
</div>
</script>
<script type="text/markdown" data-help-name="processinstance-delete">
Delete old instances of a process model in the ProcessCube.
## Inputs
: payload.duration (number): The number of given time periods.
: payload.time_type ('hours' | 'days'): The type of time period to use.
: payload.batch_size (number): The number of instances to be deleted simultaneously. (default 100)
## Outputs
: Explanation of the payload:
Object
{
successfulDeletions: [Array of strings],
failedDeletions: [Array of objects]
}
- successfulDeletions:
- Type: Array<String>
- Content: A list of successfully deleted process instance IDs.
- excample:
successfulDeletions: [
"instanceId1",
"instanceId2",
"instanceId3"
]
- failedDeletions:
- Type: Array<Object>
- Content: A list of objects containing details of the failed deletions.
- Each object has the following fields:
- id: The ID of the process instance that could not be deleted.
- error: The error message or the reason for the error.
- Example of a complete output:
{
successfulDeletions: [
"instanceId1",
"instanceId2",
"instanceId3"
],
failedDeletions: [
{ id: "instanceId4", error: "Permission denied" },
{ id: "instanceId5", error: "Instance not found" }
]
}
The node processes the IDs in configurable batches (default value: 100) and inserts successfully deleted or failed instances into the arrays accordingly.
As processing is currently forced to batch, a detailed error output is not possible.
If an error occurs during the processing of a batch, all Id's of this batch are marked as faulty.
### References
- [The ProcessCube Developer Network](https://processcube.io) - All documentation for the ProcessCube© platform
- [Node-RED Integration in ProcessCube©](https://processcube.io/docs/node-red) - Node-RED integration in ProcessCube©
</script>