@5minds/node-red-contrib-processcube 1.7.5-develop-2217df-m6qhi9ff → 1.7.5-feature-f9d61e-m6l18es1
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/.processcube/nodered/.config.nodes.json +1 -1
- package/.processcube/nodered/config.js +2 -3
- package/.processcube/nodered/settings.js +1 -1
- package/doc_generator/generator.js +5 -5
- package/doc_generator/generator_with_swagger.js +80 -78
- package/endevent-finished-listener.html +16 -16
- package/externaltask-error.html +11 -11
- package/externaltask-error.js +3 -1
- package/externaltask-event-listener.html +9 -9
- package/externaltask-input.html +26 -26
- package/externaltask-input.js +6 -7
- package/externaltask-output.html +7 -7
- package/message-event-trigger.html +8 -8
- package/message-event-trigger.js +2 -2
- package/package.json +5 -2
- package/process-event-listener.html +74 -74
- package/process-event-listener.js +1 -2
- package/process-start.html +12 -12
- package/process-start.js +3 -3
- package/process-terminate.html +9 -9
- package/process-terminate.js +1 -1
- package/processcube-engine-config.html +8 -8
- package/processdefinition-deploy.html +9 -9
- package/processdefinition-deploy.js +2 -2
- package/processdefinition-query.html +139 -140
- package/processdefinition-query.js +1 -1
- package/processinstance-delete.html +48 -46
- package/processinstance-delete.js +20 -11
- package/processinstance-query.html +120 -119
- package/processinstance-query.js +2 -2
- package/signal-event-trigger.html +8 -9
- package/signal-event-trigger.js +2 -2
- package/usertask-event-listener.html +126 -127
- package/usertask-input.html +126 -125
- package/usertask-input.js +2 -2
- package/usertask-output.html +7 -7
- package/usertask-output.js +4 -3
- package/wait-for-usertask.html +173 -164
- package/wait-for-usertask.js +34 -27
@@ -61,144 +61,143 @@
|
|
61
61
|
</script>
|
62
62
|
|
63
63
|
<script type="text/markdown" data-help-name="processdefinition-query">
|
64
|
-
A node to query process definition on the ProcessCube Engine.
|
65
|
-
|
66
|
-
The `query` can be given a direkt query field from the configutation or a message property.
|
67
|
-
|
68
|
-
Only models can be queried by setting the `models_only` flag.
|
69
|
-
|
70
|
-
## Inputs
|
71
|
-
|
72
|
-
: payload (Object | JSON) : Will be used as the input for the query or can be directly set as JSON.
|
73
|
-
|
74
|
-
## Outputs
|
75
|
-
|
76
|
-
: processDefinitions / models (Array) : The processDefinitions / models that matched the query.
|
77
|
-
: totalCount (number) : The number of matches.
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
- Name: `offset` Required: `false`
|
88
|
-
|
89
|
-
|
90
|
-
- Name: `limit` Required: `false`
|
91
|
-
|
92
|
-
|
93
|
-
- Name: `correlationId` Required: `false`
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
- Name: `processInstanceId` Required: ``
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
- Name: `processDefinitionId` Required: ``
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
- Name: `processModelId` Required: ``
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
- Name: `processModelName` Required: ``
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
- Name: `processModelHash` Required: ``
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
- Name: `ownerId` Required: ``
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
- Name: `state` Required: ``
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
- Name: `parentProcessInstanceId` Required: ``
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
- Name: `embeddedProcessModelId` Required: ``
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
- Name: `terminatedByUserId` Required: ``
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
- Name: `createdBefore` Required: ``
|
160
|
-
|
161
|
-
|
162
|
-
- Name: `createdAt` Required: ``
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
- Name: `createdAfter` Required: ``
|
168
|
-
|
169
|
-
|
170
|
-
- Name: `updatedBefore` Required: ``
|
171
|
-
|
172
|
-
|
173
|
-
- Name: `updatedAt` Required: ``
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
- Name: `updatedAfter` Required: ``
|
179
|
-
|
180
|
-
|
181
|
-
- Name: `finishedBefore` Required: ``
|
182
|
-
|
183
|
-
|
184
|
-
- Name: `finishedAt` Required: ``
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
- Name: `finishedAfter` Required: ``
|
190
|
-
|
191
|
-
|
192
|
-
- Name: `triggeredByFlowNodeInstance` Required: ``
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
-
|
203
|
-
- [ProcessCube© LowCode Integration](https://processcube.io/docs/node-red) - LowCode integration in ProcessCube©
|
64
|
+
A node to query process definition on the ProcessCube Engine.
|
65
|
+
|
66
|
+
The `query` can be given a direkt query field from the configutation or a message property.
|
67
|
+
|
68
|
+
Only models can be queried by setting the `models_only` flag.
|
69
|
+
|
70
|
+
## Inputs
|
71
|
+
|
72
|
+
: payload (Object | JSON) : Will be used as the input for the query or can be directly set as JSON.
|
73
|
+
|
74
|
+
## Outputs
|
75
|
+
|
76
|
+
: processDefinitions / models (Array) : The processDefinitions / models that matched the query.
|
77
|
+
: totalCount (number) : The number of matches.
|
78
|
+
|
79
|
+
### Query fields
|
80
|
+
|
81
|
+
**Summary**:
|
82
|
+
|
83
|
+
**Description**: Filter result for 'ProcessInstance Query'
|
84
|
+
|
85
|
+
#### Parameters:
|
86
|
+
|
87
|
+
- Name: `offset` Required: `false`
|
88
|
+
- Type: number
|
89
|
+
- Description: The index of the first ProcessInstance to include in the result set.
|
90
|
+
- Name: `limit` Required: `false`
|
91
|
+
- Type: number
|
92
|
+
- Description: The maximum number of ProcessInstances to return.
|
93
|
+
- Name: `correlationId` Required: `false`
|
94
|
+
- Type: Array<string> | string | SearchQuery
|
95
|
+
- string: myCorrelationId
|
96
|
+
- Array<string>: myCorrelationId1,myCorrelationId2
|
97
|
+
- object:
|
98
|
+
- Description: Filter by the CorrelationId of the ProcessInstances.
|
99
|
+
- Name: `processInstanceId` Required: ``
|
100
|
+
- Type: Array<string> | string | SearchQuery
|
101
|
+
- string: myProcessInstance_12345678
|
102
|
+
- Array<string>: myProcessInstance_12345678,myProcessInstance_87654321
|
103
|
+
- object:
|
104
|
+
- Description: Filter by the ID of the ProcessInstances.
|
105
|
+
- Name: `processDefinitionId` Required: ``
|
106
|
+
- Type: Array<string> | string | SearchQuery
|
107
|
+
- string: myProcess_12345678
|
108
|
+
- Array<string>: myProcess_12345678,myProcess_87654321
|
109
|
+
- object:
|
110
|
+
- Description: Filter by the ID of the ProcessDefinition that the ProcessInstances belong to.
|
111
|
+
- Name: `processModelId` Required: ``
|
112
|
+
- Type: Array<string> | string | SearchQuery
|
113
|
+
- string: myProcessModel_12345678
|
114
|
+
- Array<string>: myProcessModel_12345678,myProcessModel_87654321
|
115
|
+
- object:
|
116
|
+
- Description: Filter by the ID of the ProcessModel that the ProcessInstances belong to.
|
117
|
+
- Name: `processModelName` Required: ``
|
118
|
+
- Type: Array<string> | string | SearchQuery
|
119
|
+
- string: My Process Model
|
120
|
+
- Array<string>: My Process Model,My Other Process Model
|
121
|
+
- object:
|
122
|
+
- Description: Filter by the name of the ProcessModel that the ProcessInstances belong to.
|
123
|
+
- Name: `processModelHash` Required: ``
|
124
|
+
- Type: Array<string> | string | SearchQuery
|
125
|
+
- string: 12345678
|
126
|
+
- Array<string>: 12345678,87654321
|
127
|
+
- object:
|
128
|
+
- Description: Filter by the hash of the ProcessModel that the ProcessInstances belong to.
|
129
|
+
- Name: `ownerId` Required: ``
|
130
|
+
- Type: Array<string> | string | SearchQuery
|
131
|
+
- string: 12345678
|
132
|
+
- Array<string>: 12345678,87654321
|
133
|
+
- object:
|
134
|
+
- Description: Filter by the ID of the User that owns the ProcessInstances.
|
135
|
+
- Name: `state` Required: ``
|
136
|
+
- Type: Array<string> | string | SearchQuery
|
137
|
+
- string: running
|
138
|
+
- Array<string>: running,finished
|
139
|
+
- object:
|
140
|
+
- Description: Filter by the state of the ProcessInstances.
|
141
|
+
- Name: `parentProcessInstanceId` Required: ``
|
142
|
+
- Type: Array<string> | string | SearchQuery
|
143
|
+
- string: myParentProcessInstance_12345678
|
144
|
+
- Array<string>: myParentProcessInstance_12345678,myParentProcessInstance_87654321
|
145
|
+
- object:
|
146
|
+
- Description: Filter by the ID of the parent ProcessInstance.
|
147
|
+
- Name: `embeddedProcessModelId` Required: ``
|
148
|
+
- Type: Array<string> | string | SearchQuery
|
149
|
+
- string: myModel1
|
150
|
+
- Array<string>: myModel1,myModel2
|
151
|
+
- object:
|
152
|
+
- Description: Filter by the ID of the embedded process model.
|
153
|
+
- Name: `terminatedByUserId` Required: ``
|
154
|
+
- Type: Array<string> | string | SearchQuery
|
155
|
+
- string: 12345678
|
156
|
+
- Array<string>: 12345678,87654321
|
157
|
+
- object:
|
158
|
+
- Description: Filter by the ID of the User that terminated the ProcessInstances.
|
159
|
+
- Name: `createdBefore` Required: ``
|
160
|
+
- Type: string
|
161
|
+
- Description: The maximum created date of the ProcessInstances to include in the results.
|
162
|
+
- Name: `createdAt` Required: ``
|
163
|
+
- Type: Array<string> | string
|
164
|
+
- string: 2021-01-01T00:00:00.000Z
|
165
|
+
- array: 2021-01-01T00:00:00.000Z,2021-01-02T00:00:00.000Z
|
166
|
+
- Description: The minimum created date of the ProcessInstances to include in the results.
|
167
|
+
- Name: `createdAfter` Required: ``
|
168
|
+
- Type: string
|
169
|
+
- Description: The minimum created date of the ProcessInstances to include in the results.
|
170
|
+
- Name: `updatedBefore` Required: ``
|
171
|
+
- Type: string
|
172
|
+
- Description: The maximum updated date of the ProcessInstances to include in the results.
|
173
|
+
- Name: `updatedAt` Required: ``
|
174
|
+
- Type: Array<string> | string
|
175
|
+
- string: 2021-01-01T00:00:00.000Z
|
176
|
+
- array: 2021-01-01T00:00:00.000Z,2021-01-02T00:00:00.000Z
|
177
|
+
- Description: The exact updated date of the ProcessInstances to include in the results.
|
178
|
+
- Name: `updatedAfter` Required: ``
|
179
|
+
- Type: string
|
180
|
+
- Description: The minimum updated date of the ProcessInstances to include in the results.
|
181
|
+
- Name: `finishedBefore` Required: ``
|
182
|
+
- Type: string
|
183
|
+
- Description: The maximum finished date of the ProcessInstances to include in the results.
|
184
|
+
- Name: `finishedAt` Required: ``
|
185
|
+
- Type: Array<string> | string
|
186
|
+
- string: 2021-01-01T00:00:00.000Z
|
187
|
+
- array: 2021-01-01T00:00:00.000Z,2021-01-02T00:00:00.000Z
|
188
|
+
- Description: The exact finished date of the ProcessInstances to include in the results.
|
189
|
+
- Name: `finishedAfter` Required: ``
|
190
|
+
- Type: string
|
191
|
+
- Description: The minimum finished date of the ProcessInstances to include in the results.
|
192
|
+
- Name: `triggeredByFlowNodeInstance` Required: ``
|
193
|
+
- Type: Array<string> | string | SearchQuery
|
194
|
+
- string: myFlowNodeInstance_12345678
|
195
|
+
- array: myFlowNodeInstance_12345678,myFlowNodeInstance_87654321
|
196
|
+
- object:
|
197
|
+
- Description: Filter by the ID of the FlowNodeInstance that triggered the ProcessInstance.
|
198
|
+
|
199
|
+
### References
|
200
|
+
|
201
|
+
- [The ProcessCube© Developer Network](https://processcube.io) - All documentation for the ProcessCube© platform
|
202
|
+
- [ProcessCube© LowCode Integration](https://processcube.io/docs/node-red) - LowCode integration in ProcessCube©
|
204
203
|
</script>
|
@@ -16,7 +16,7 @@ module.exports = function (RED) {
|
|
16
16
|
|
17
17
|
node.log(`Querying process definitions with query: ${JSON.stringify(query)}`);
|
18
18
|
|
19
|
-
const isUser = !!msg._client?.user
|
19
|
+
const isUser = !!msg._client?.user;
|
20
20
|
const identity = isUser ? { userId: msg._client.user.id, token: msg._client.user.accessToken } : null;
|
21
21
|
query.identity = identity;
|
22
22
|
|
@@ -50,61 +50,63 @@
|
|
50
50
|
</script>
|
51
51
|
|
52
52
|
<script type="text/markdown" data-help-name="processinstance-delete">
|
53
|
-
Delete old instances of a process model in the ProcessCube.
|
53
|
+
Delete old instances of a process model in the ProcessCube.
|
54
54
|
|
55
|
-
## Inputs
|
55
|
+
## Inputs
|
56
56
|
|
57
|
-
: payload.duration (number): The number of given time periods.
|
58
|
-
: payload.time_type ('hours' | 'days'): The type of time period to use.
|
59
|
-
: payload.batch_size (number): The number of instances to be deleted simultaneously. (default 100)
|
57
|
+
: payload.duration (number): The number of given time periods.
|
58
|
+
: payload.time_type ('hours' | 'days'): The type of time period to use.
|
59
|
+
: payload.batch_size (number): The number of instances to be deleted simultaneously. (default 100)
|
60
60
|
|
61
|
-
## Outputs
|
61
|
+
## Outputs
|
62
62
|
|
63
|
-
: Explanation of the payload:
|
63
|
+
: Explanation of the payload:
|
64
64
|
|
65
|
-
Object
|
66
|
-
{
|
65
|
+
Object
|
66
|
+
{
|
67
67
|
successfulDeletions: [Array of strings],
|
68
68
|
failedDeletions: [Array of objects]
|
69
|
-
}
|
70
|
-
|
71
|
-
- successfulDeletions:
|
72
|
-
- Type: Array<String>
|
73
|
-
- Content: A list of successfully deleted process instance IDs.
|
74
|
-
|
75
|
-
- excample:
|
76
|
-
successfulDeletions: [
|
77
|
-
"instanceId1",
|
78
|
-
"instanceId2",
|
79
|
-
"instanceId3"
|
80
|
-
]
|
81
|
-
|
82
|
-
- failedDeletions:
|
83
|
-
- Type: Array<Object>
|
84
|
-
- Content: A list of objects containing details of the failed deletions.
|
85
|
-
- Each object has the following fields:
|
86
|
-
- id: The ID of the process instance that could not be deleted.
|
87
|
-
- error: The error message or the reason for the error.
|
88
|
-
|
89
|
-
- Example of a complete output:
|
90
|
-
{
|
91
|
-
successfulDeletions: [
|
92
|
-
"instanceId1",
|
93
|
-
"instanceId2",
|
94
|
-
"instanceId3"
|
95
|
-
],
|
96
|
-
failedDeletions: [
|
97
|
-
{ id: "instanceId4", error: "Permission denied" },
|
98
|
-
{ id: "instanceId5", error: "Instance not found" }
|
99
|
-
]
|
100
69
|
}
|
101
70
|
|
102
|
-
|
103
|
-
|
104
|
-
|
71
|
+
- successfulDeletions:
|
72
|
+
|
73
|
+
- Type: Array<String>
|
74
|
+
- Content: A list of successfully deleted process instance IDs.
|
75
|
+
|
76
|
+
- excample:
|
77
|
+
successfulDeletions: [
|
78
|
+
"instanceId1",
|
79
|
+
"instanceId2",
|
80
|
+
"instanceId3"
|
81
|
+
]
|
82
|
+
|
83
|
+
- failedDeletions:
|
84
|
+
|
85
|
+
- Type: Array<Object>
|
86
|
+
- Content: A list of objects containing details of the failed deletions.
|
87
|
+
- Each object has the following fields:
|
88
|
+
- id: The ID of the process instance that could not be deleted.
|
89
|
+
- error: The error message or the reason for the error.
|
90
|
+
|
91
|
+
- Example of a complete output:
|
92
|
+
{
|
93
|
+
successfulDeletions: [
|
94
|
+
"instanceId1",
|
95
|
+
"instanceId2",
|
96
|
+
"instanceId3"
|
97
|
+
],
|
98
|
+
failedDeletions: [
|
99
|
+
{ id: "instanceId4", error: "Permission denied" },
|
100
|
+
{ id: "instanceId5", error: "Instance not found" }
|
101
|
+
]
|
102
|
+
}
|
103
|
+
|
104
|
+
The node processes the IDs in configurable batches (default value: 100) and inserts successfully deleted or failed instances into the arrays accordingly.
|
105
|
+
As processing is currently forced to batch, a detailed error output is not possible.
|
106
|
+
If an error occurs during the processing of a batch, all Id's of this batch are marked as faulty.
|
105
107
|
|
106
|
-
### References
|
108
|
+
### References
|
107
109
|
|
108
|
-
-
|
109
|
-
-
|
110
|
+
- [The ProcessCube Developer Network](https://processcube.io) - All documentation for the ProcessCube© platform
|
111
|
+
- [Node-RED Integration in ProcessCube©](https://processcube.io/docs/node-red) - Node-RED integration in ProcessCube©
|
110
112
|
</script>
|
@@ -7,7 +7,7 @@ module.exports = function (RED) {
|
|
7
7
|
node.engine = RED.nodes.getNode(config.engine);
|
8
8
|
const client = node.engine ? node.engine.engineClient : null;
|
9
9
|
|
10
|
-
const isUser = !!msg._client?.user
|
10
|
+
const isUser = !!msg._client?.user;
|
11
11
|
const userIdentity = isUser ? { userId: msg._client.user.id, token: msg._client.user.accessToken } : null;
|
12
12
|
|
13
13
|
if (!client || !client.processInstances) {
|
@@ -37,7 +37,7 @@ module.exports = function (RED) {
|
|
37
37
|
const multiplier = timeType === 'hours' ? 1 : 24;
|
38
38
|
node.log(`Time type: ${timeType}`);
|
39
39
|
|
40
|
-
const deletionDate = new Date(Date.now() - timeToUse * multiplier * 60 * 60 * 1000);
|
40
|
+
const deletionDate = new Date(Date.now() - timeToUse * multiplier * 60 * 60 * 1000);
|
41
41
|
|
42
42
|
const modelId = msg.payload.processModelId?.trim() || config.modelid?.trim();
|
43
43
|
if (!modelId) {
|
@@ -67,15 +67,18 @@ module.exports = function (RED) {
|
|
67
67
|
state: ['finished', 'error', 'terminated'],
|
68
68
|
limit: batchSize,
|
69
69
|
},
|
70
|
-
{
|
70
|
+
{
|
71
71
|
includeXml: false,
|
72
|
-
identity: userIdentity
|
73
|
-
}
|
72
|
+
identity: userIdentity,
|
73
|
+
},
|
74
74
|
);
|
75
75
|
|
76
76
|
const processInstances = result.processInstances || [];
|
77
77
|
if (processInstances.length === 0) {
|
78
|
-
node.log(
|
78
|
+
node.log(
|
79
|
+
`No more process instances to delete for Model-ID: ${modelId} with Date: ${deletionDate.toISOString()}`,
|
80
|
+
msg,
|
81
|
+
);
|
79
82
|
hasMoreResults = false;
|
80
83
|
continue;
|
81
84
|
}
|
@@ -85,22 +88,28 @@ module.exports = function (RED) {
|
|
85
88
|
try {
|
86
89
|
await client.processInstances.deleteProcessInstances(ids, true, userIdentity);
|
87
90
|
msg.payload.successfulDeletions.push(...ids);
|
88
|
-
sumSuccessful += ids.length;
|
91
|
+
sumSuccessful += ids.length;
|
89
92
|
} catch (deleteError) {
|
90
93
|
var message = JSON.stringify(deleteError);
|
91
94
|
sumFailed += ids.length;
|
92
95
|
ids.forEach((id) => {
|
93
96
|
msg.payload.failedDeletions.push({ id, error: message });
|
94
97
|
});
|
95
|
-
node.warn(
|
98
|
+
node.warn(
|
99
|
+
`Failed to delete some process instances for Model-ID: ${modelId}. Error: ${message}`,
|
100
|
+
);
|
96
101
|
}
|
97
102
|
}
|
98
|
-
node.log(
|
99
|
-
|
103
|
+
node.log(
|
104
|
+
`Successfully deleted ${sumSuccessful} process instances and ${sumFailed} failed to delete process instances for Model-ID: ${modelId}.`,
|
105
|
+
);
|
100
106
|
|
101
107
|
node.send(msg);
|
102
108
|
} catch (queryError) {
|
103
|
-
node.error(
|
109
|
+
node.error(
|
110
|
+
`Failed to query process instances for Model-ID: ${modelId}. Error: ${queryError.message}`,
|
111
|
+
msg,
|
112
|
+
);
|
104
113
|
}
|
105
114
|
});
|
106
115
|
}
|