@5minds/node-red-contrib-processcube 1.5.5-feature-4b765c-m3eudoth → 1.5.5
Sign up to get free protection for your applications and to get access to all the features.
- package/endevent-finished-listener.js +23 -15
- package/externaltask-input.html +1 -16
- package/externaltask-input.js +2 -9
- package/nodered/flows.json +85 -143
- package/package.json +1 -1
- package/process-event-listener.js +182 -148
- package/process-terminate.html +2 -3
- package/processdefinition-query.html +0 -121
- package/processdefinition-query.js +4 -0
- package/processinstance-delete.html +9 -9
- package/processinstance-query.html +1 -115
- package/usertask-event-listener.html +0 -121
- package/usertask-event-listener.js +20 -15
- package/usertask-input.html +0 -119
- package/wait-for-usertask.html +0 -119
- package/wait-for-usertask.js +31 -23
- package/doc_generator/_process_instances_query.md +0 -121
- package/doc_generator/generator.js +0 -41
- package/doc_generator/generator_with_swagger.js +0 -89
- package/doc_generator/outputs/.gitkeep +0 -0
- package/doc_generator/package-lock.json +0 -176
- package/doc_generator/package.json +0 -15
- package/doc_generator/query_template.mustache +0 -20
- package/doc_generator/swagger.json +0 -4110
@@ -50,127 +50,13 @@ A node to query process instances on the ProcessCube Engine.
|
|
50
50
|
|
51
51
|
## Inputs
|
52
52
|
|
53
|
-
:
|
54
|
-
: query (Object) : The query that was used.
|
53
|
+
: payload (Object | JSON) : Will be used as the input for the query or can be directly set as JSON.
|
55
54
|
|
56
55
|
## Outputs
|
57
56
|
|
58
57
|
: processInstances (Array) : The process instances that matched the query.
|
59
58
|
: totalCount (number) : The number of matches.
|
60
59
|
|
61
|
-
### Query fields
|
62
|
-
|
63
|
-
**Summary**:
|
64
|
-
|
65
|
-
**Description**: Gets all ProcessInstances that match the given query.
|
66
|
-
|
67
|
-
#### Parameters:
|
68
|
-
- Name: `offset` Required: `false`
|
69
|
-
- Type: number
|
70
|
-
- Description: The index of the first ProcessInstance to include in the result set.
|
71
|
-
- Name: `limit` Required: `false`
|
72
|
-
- Type: number
|
73
|
-
- Description: The maximum number of ProcessInstances to return.
|
74
|
-
- Name: `correlationId` Required: `false`
|
75
|
-
- Type: Array<string> | string | SearchQuery
|
76
|
-
- string: myCorrelationId
|
77
|
-
- Array<string>: myCorrelationId1,myCorrelationId2
|
78
|
-
- object:
|
79
|
-
- Description: Filter by the CorrelationId of the ProcessInstances.
|
80
|
-
- Name: `processInstanceId` Required: ``
|
81
|
-
- Type: Array<string> | string | SearchQuery
|
82
|
-
- string: myProcessInstance_12345678
|
83
|
-
- Array<string>: myProcessInstance_12345678,myProcessInstance_87654321
|
84
|
-
- object:
|
85
|
-
- Description: Filter by the ID of the ProcessInstances.
|
86
|
-
- Name: `processDefinitionId` Required: ``
|
87
|
-
- Type: Array<string> | string | SearchQuery
|
88
|
-
- string: myProcess_12345678
|
89
|
-
- Array<string>: myProcess_12345678,myProcess_87654321
|
90
|
-
- object:
|
91
|
-
- Description: Filter by the ID of the ProcessDefinition that the ProcessInstances belong to.
|
92
|
-
- Name: `processModelId` Required: ``
|
93
|
-
- Type: Array<string> | string | SearchQuery
|
94
|
-
- string: myProcessModel_12345678
|
95
|
-
- Array<string>: myProcessModel_12345678,myProcessModel_87654321
|
96
|
-
- object:
|
97
|
-
- Description: Filter by the ID of the ProcessModel that the ProcessInstances belong to.
|
98
|
-
- Name: `processModelName` Required: ``
|
99
|
-
- Type: Array<string> | string | SearchQuery
|
100
|
-
- string: My Process Model
|
101
|
-
- Array<string>: My Process Model,My Other Process Model
|
102
|
-
- object:
|
103
|
-
- Description: Filter by the name of the ProcessModel that the ProcessInstances belong to.
|
104
|
-
- Name: `processModelHash` Required: ``
|
105
|
-
- Type: Array<string> | string | SearchQuery
|
106
|
-
- string: 12345678
|
107
|
-
- Array<string>: 12345678,87654321
|
108
|
-
- object:
|
109
|
-
- Description: Filter by the hash of the ProcessModel that the ProcessInstances belong to.
|
110
|
-
- Name: `ownerId` Required: ``
|
111
|
-
- Type: Array<string> | string | SearchQuery
|
112
|
-
- string: 12345678
|
113
|
-
- Array<string>: 12345678,87654321
|
114
|
-
- object:
|
115
|
-
- Description: Filter by the ID of the User that owns the ProcessInstances.
|
116
|
-
- Name: `state` Required: ``
|
117
|
-
- Type: Array<string> | string | SearchQuery
|
118
|
-
- string: running
|
119
|
-
- Array<string>: running,finished
|
120
|
-
- object:
|
121
|
-
- Description: Filter by the state of the ProcessInstances.
|
122
|
-
- Name: `parentProcessInstanceId` Required: ``
|
123
|
-
- Type: Array<string> | string | SearchQuery
|
124
|
-
- string: myParentProcessInstance_12345678
|
125
|
-
- Array<string>: myParentProcessInstance_12345678,myParentProcessInstance_87654321
|
126
|
-
- object:
|
127
|
-
- Description: Filter by the ID of the parent ProcessInstance.
|
128
|
-
- Name: `terminatedByUserId` Required: ``
|
129
|
-
- Type: Array<string> | string | SearchQuery
|
130
|
-
- string: 12345678
|
131
|
-
- Array<string>: 12345678,87654321
|
132
|
-
- object:
|
133
|
-
- Description: Filter by the ID of the User that terminated the ProcessInstances.
|
134
|
-
- Name: `createdBefore` Required: ``
|
135
|
-
- Type: string
|
136
|
-
- Description: The maximum created date of the ProcessInstances to include in the results.
|
137
|
-
- Name: `createdAt` Required: ``
|
138
|
-
- Type: Array<string> | string
|
139
|
-
- string: 2021-01-01T00:00:00.000Z
|
140
|
-
- array: 2021-01-01T00:00:00.000Z,2021-01-02T00:00:00.000Z
|
141
|
-
- Description: The minimum created date of the ProcessInstances to include in the results.
|
142
|
-
- Name: `createdAfter` Required: ``
|
143
|
-
- Type: string
|
144
|
-
- Description: The minimum created date of the ProcessInstances to include in the results.
|
145
|
-
- Name: `updatedBefore` Required: ``
|
146
|
-
- Type: string
|
147
|
-
- Description: The maximum updated date of the ProcessInstances to include in the results.
|
148
|
-
- Name: `updatedAt` Required: ``
|
149
|
-
- Type: Array<string> | string
|
150
|
-
- string: 2021-01-01T00:00:00.000Z
|
151
|
-
- array: 2021-01-01T00:00:00.000Z,2021-01-02T00:00:00.000Z
|
152
|
-
- Description: The exact updated date of the ProcessInstances to include in the results.
|
153
|
-
- Name: `updatedAfter` Required: ``
|
154
|
-
- Type: string
|
155
|
-
- Description: The minimum updated date of the ProcessInstances to include in the results.
|
156
|
-
- Name: `finishedBefore` Required: ``
|
157
|
-
- Type: string
|
158
|
-
- Description: The maximum finished date of the ProcessInstances to include in the results.
|
159
|
-
- Name: `finishedAt` Required: ``
|
160
|
-
- Type: Array<string> | string
|
161
|
-
- string: 2021-01-01T00:00:00.000Z
|
162
|
-
- array: 2021-01-01T00:00:00.000Z,2021-01-02T00:00:00.000Z
|
163
|
-
- Description: The exact finished date of the ProcessInstances to include in the results.
|
164
|
-
- Name: `finishedAfter` Required: ``
|
165
|
-
- Type: string
|
166
|
-
- Description: The minimum finished date of the ProcessInstances to include in the results.
|
167
|
-
- Name: `triggeredByFlowNodeInstance` Required: ``
|
168
|
-
- Type: Array<string> | string | SearchQuery
|
169
|
-
- string: myFlowNodeInstance_12345678
|
170
|
-
- array: myFlowNodeInstance_12345678,myFlowNodeInstance_87654321
|
171
|
-
- object:
|
172
|
-
- Description: Filter by the ID of the FlowNodeInstance that triggered the ProcessInstance.
|
173
|
-
|
174
60
|
### References
|
175
61
|
|
176
62
|
- [The ProcessCube© Developer Network](https://processcube.io) - All documentation for the ProcessCube© platform
|
@@ -74,127 +74,6 @@ A node which listens for events triggered by usertasks
|
|
74
74
|
: action (string): The event that occured.
|
75
75
|
: type (string): The target of the event.
|
76
76
|
|
77
|
-
|
78
|
-
### Query fields
|
79
|
-
|
80
|
-
**Summary**:
|
81
|
-
|
82
|
-
**Description**: Filter result for 'UserTask Event Listener'
|
83
|
-
|
84
|
-
#### Parameters:
|
85
|
-
- Name: `offset` Required: `false`
|
86
|
-
- Type: number
|
87
|
-
- Description: The index of the first ProcessInstance to include in the result set.
|
88
|
-
- Name: `limit` Required: `false`
|
89
|
-
- Type: number
|
90
|
-
- Description: The maximum number of ProcessInstances to return.
|
91
|
-
- Name: `correlationId` Required: `false`
|
92
|
-
- Type: Array<string> | string | SearchQuery
|
93
|
-
- string: myCorrelationId
|
94
|
-
- Array<string>: myCorrelationId1,myCorrelationId2
|
95
|
-
- object:
|
96
|
-
- Description: Filter by the CorrelationId of the ProcessInstances.
|
97
|
-
- Name: `processInstanceId` Required: ``
|
98
|
-
- Type: Array<string> | string | SearchQuery
|
99
|
-
- string: myProcessInstance_12345678
|
100
|
-
- Array<string>: myProcessInstance_12345678,myProcessInstance_87654321
|
101
|
-
- object:
|
102
|
-
- Description: Filter by the ID of the ProcessInstances.
|
103
|
-
- Name: `processDefinitionId` Required: ``
|
104
|
-
- Type: Array<string> | string | SearchQuery
|
105
|
-
- string: myProcess_12345678
|
106
|
-
- Array<string>: myProcess_12345678,myProcess_87654321
|
107
|
-
- object:
|
108
|
-
- Description: Filter by the ID of the ProcessDefinition that the ProcessInstances belong to.
|
109
|
-
- Name: `processModelId` Required: ``
|
110
|
-
- Type: Array<string> | string | SearchQuery
|
111
|
-
- string: myProcessModel_12345678
|
112
|
-
- Array<string>: myProcessModel_12345678,myProcessModel_87654321
|
113
|
-
- object:
|
114
|
-
- Description: Filter by the ID of the ProcessModel that the ProcessInstances belong to.
|
115
|
-
- Name: `processModelName` Required: ``
|
116
|
-
- Type: Array<string> | string | SearchQuery
|
117
|
-
- string: My Process Model
|
118
|
-
- Array<string>: My Process Model,My Other Process Model
|
119
|
-
- object:
|
120
|
-
- Description: Filter by the name of the ProcessModel that the ProcessInstances belong to.
|
121
|
-
- Name: `processModelHash` Required: ``
|
122
|
-
- Type: Array<string> | string | SearchQuery
|
123
|
-
- string: 12345678
|
124
|
-
- Array<string>: 12345678,87654321
|
125
|
-
- object:
|
126
|
-
- Description: Filter by the hash of the ProcessModel that the ProcessInstances belong to.
|
127
|
-
- Name: `ownerId` Required: ``
|
128
|
-
- Type: Array<string> | string | SearchQuery
|
129
|
-
- string: 12345678
|
130
|
-
- Array<string>: 12345678,87654321
|
131
|
-
- object:
|
132
|
-
- Description: Filter by the ID of the User that owns the ProcessInstances.
|
133
|
-
- Name: `state` Required: ``
|
134
|
-
- Type: Array<string> | string | SearchQuery
|
135
|
-
- string: running
|
136
|
-
- Array<string>: running,finished
|
137
|
-
- object:
|
138
|
-
- Description: Filter by the state of the ProcessInstances.
|
139
|
-
- Name: `parentProcessInstanceId` Required: ``
|
140
|
-
- Type: Array<string> | string | SearchQuery
|
141
|
-
- string: myParentProcessInstance_12345678
|
142
|
-
- Array<string>: myParentProcessInstance_12345678,myParentProcessInstance_87654321
|
143
|
-
- object:
|
144
|
-
- Description: Filter by the ID of the parent ProcessInstance.
|
145
|
-
- Name: `embeddedProcessModelId` Required: ``
|
146
|
-
- Type: Array<string> | string | SearchQuery
|
147
|
-
- string: myModel1
|
148
|
-
- Array<string>: myModel1,myModel2
|
149
|
-
- object:
|
150
|
-
- Description: Filter by the ID of the embedded process model.
|
151
|
-
- Name: `terminatedByUserId` Required: ``
|
152
|
-
- Type: Array<string> | string | SearchQuery
|
153
|
-
- string: 12345678
|
154
|
-
- Array<string>: 12345678,87654321
|
155
|
-
- object:
|
156
|
-
- Description: Filter by the ID of the User that terminated the ProcessInstances.
|
157
|
-
- Name: `createdBefore` Required: ``
|
158
|
-
- Type: string
|
159
|
-
- Description: The maximum created date of the ProcessInstances to include in the results.
|
160
|
-
- Name: `createdAt` Required: ``
|
161
|
-
- Type: Array<string> | string
|
162
|
-
- string: 2021-01-01T00:00:00.000Z
|
163
|
-
- array: 2021-01-01T00:00:00.000Z,2021-01-02T00:00:00.000Z
|
164
|
-
- Description: The minimum created date of the ProcessInstances to include in the results.
|
165
|
-
- Name: `createdAfter` Required: ``
|
166
|
-
- Type: string
|
167
|
-
- Description: The minimum created date of the ProcessInstances to include in the results.
|
168
|
-
- Name: `updatedBefore` Required: ``
|
169
|
-
- Type: string
|
170
|
-
- Description: The maximum updated date of the ProcessInstances to include in the results.
|
171
|
-
- Name: `updatedAt` Required: ``
|
172
|
-
- Type: Array<string> | string
|
173
|
-
- string: 2021-01-01T00:00:00.000Z
|
174
|
-
- array: 2021-01-01T00:00:00.000Z,2021-01-02T00:00:00.000Z
|
175
|
-
- Description: The exact updated date of the ProcessInstances to include in the results.
|
176
|
-
- Name: `updatedAfter` Required: ``
|
177
|
-
- Type: string
|
178
|
-
- Description: The minimum updated date of the ProcessInstances to include in the results.
|
179
|
-
- Name: `finishedBefore` Required: ``
|
180
|
-
- Type: string
|
181
|
-
- Description: The maximum finished date of the ProcessInstances to include in the results.
|
182
|
-
- Name: `finishedAt` Required: ``
|
183
|
-
- Type: Array<string> | string
|
184
|
-
- string: 2021-01-01T00:00:00.000Z
|
185
|
-
- array: 2021-01-01T00:00:00.000Z,2021-01-02T00:00:00.000Z
|
186
|
-
- Description: The exact finished date of the ProcessInstances to include in the results.
|
187
|
-
- Name: `finishedAfter` Required: ``
|
188
|
-
- Type: string
|
189
|
-
- Description: The minimum finished date of the ProcessInstances to include in the results.
|
190
|
-
- Name: `triggeredByFlowNodeInstance` Required: ``
|
191
|
-
- Type: Array<string> | string | SearchQuery
|
192
|
-
- string: myFlowNodeInstance_12345678
|
193
|
-
- array: myFlowNodeInstance_12345678,myFlowNodeInstance_87654321
|
194
|
-
- object:
|
195
|
-
- Description: Filter by the ID of the FlowNodeInstance that triggered the ProcessInstance.
|
196
|
-
|
197
|
-
|
198
77
|
### References
|
199
78
|
|
200
79
|
- [The ProcessCube© Developer Network](https://processcube.io) - All documentation for the ProcessCube© platform
|
@@ -20,27 +20,32 @@ module.exports = function (RED) {
|
|
20
20
|
function userTaskCallback() {
|
21
21
|
return async (userTaskNotification) => {
|
22
22
|
if (config.usertask != '' && config.usertask != userTaskNotification.flowNodeId) return;
|
23
|
+
|
23
24
|
const newQuery = {
|
24
25
|
flowNodeInstanceId: userTaskNotification.flowNodeInstanceId,
|
25
26
|
...query,
|
26
27
|
};
|
27
28
|
|
28
|
-
|
29
|
-
|
30
|
-
|
29
|
+
try {
|
30
|
+
const matchingFlowNodes = await client.userTasks.query(newQuery, {
|
31
|
+
identity: currentIdentity,
|
32
|
+
});
|
31
33
|
|
32
|
-
|
33
|
-
|
34
|
+
if (matchingFlowNodes.userTasks && matchingFlowNodes.userTasks.length == 1) {
|
35
|
+
const userTask = matchingFlowNodes.userTasks[0];
|
34
36
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
37
|
+
node.send({
|
38
|
+
payload: {
|
39
|
+
flowNodeInstanceId: userTaskNotification.flowNodeInstanceId,
|
40
|
+
userTaskEvent: userTaskNotification,
|
41
|
+
userTask: userTask,
|
42
|
+
action: config.eventtype,
|
43
|
+
type: 'usertask',
|
44
|
+
},
|
45
|
+
});
|
46
|
+
}
|
47
|
+
} catch (error) {
|
48
|
+
node.error(error);
|
44
49
|
}
|
45
50
|
};
|
46
51
|
}
|
@@ -79,7 +84,7 @@ module.exports = function (RED) {
|
|
79
84
|
currentIdentity = identity;
|
80
85
|
|
81
86
|
subscription = subscribe();
|
82
|
-
})
|
87
|
+
})
|
83
88
|
|
84
89
|
node.on('close', async () => {
|
85
90
|
if (node.engine && node.engine.engineClient && client) {
|
package/usertask-input.html
CHANGED
@@ -65,125 +65,6 @@ A node which sends a payload to a usertask in the ProcessCube.
|
|
65
65
|
: force_send_array (Boolean) : Will be used to force the payload to be sent as an array.
|
66
66
|
: multisend (Boolean) : Will be used to send one output of each usertask input.
|
67
67
|
|
68
|
-
### Query fields
|
69
|
-
|
70
|
-
**Summary**:
|
71
|
-
|
72
|
-
**Description**: Filter result for 'UserTasks Input'
|
73
|
-
|
74
|
-
#### Parameters:
|
75
|
-
- Name: `offset` Required: `false`
|
76
|
-
- Type: number
|
77
|
-
- Description: The index of the first ProcessInstance to include in the result set.
|
78
|
-
- Name: `limit` Required: `false`
|
79
|
-
- Type: number
|
80
|
-
- Description: The maximum number of ProcessInstances to return.
|
81
|
-
- Name: `correlationId` Required: `false`
|
82
|
-
- Type: Array<string> | string | SearchQuery
|
83
|
-
- string: myCorrelationId
|
84
|
-
- Array<string>: myCorrelationId1,myCorrelationId2
|
85
|
-
- object:
|
86
|
-
- Description: Filter by the CorrelationId of the ProcessInstances.
|
87
|
-
- Name: `processInstanceId` Required: ``
|
88
|
-
- Type: Array<string> | string | SearchQuery
|
89
|
-
- string: myProcessInstance_12345678
|
90
|
-
- Array<string>: myProcessInstance_12345678,myProcessInstance_87654321
|
91
|
-
- object:
|
92
|
-
- Description: Filter by the ID of the ProcessInstances.
|
93
|
-
- Name: `processDefinitionId` Required: ``
|
94
|
-
- Type: Array<string> | string | SearchQuery
|
95
|
-
- string: myProcess_12345678
|
96
|
-
- Array<string>: myProcess_12345678,myProcess_87654321
|
97
|
-
- object:
|
98
|
-
- Description: Filter by the ID of the ProcessDefinition that the ProcessInstances belong to.
|
99
|
-
- Name: `processModelId` Required: ``
|
100
|
-
- Type: Array<string> | string | SearchQuery
|
101
|
-
- string: myProcessModel_12345678
|
102
|
-
- Array<string>: myProcessModel_12345678,myProcessModel_87654321
|
103
|
-
- object:
|
104
|
-
- Description: Filter by the ID of the ProcessModel that the ProcessInstances belong to.
|
105
|
-
- Name: `processModelName` Required: ``
|
106
|
-
- Type: Array<string> | string | SearchQuery
|
107
|
-
- string: My Process Model
|
108
|
-
- Array<string>: My Process Model,My Other Process Model
|
109
|
-
- object:
|
110
|
-
- Description: Filter by the name of the ProcessModel that the ProcessInstances belong to.
|
111
|
-
- Name: `processModelHash` Required: ``
|
112
|
-
- Type: Array<string> | string | SearchQuery
|
113
|
-
- string: 12345678
|
114
|
-
- Array<string>: 12345678,87654321
|
115
|
-
- object:
|
116
|
-
- Description: Filter by the hash of the ProcessModel that the ProcessInstances belong to.
|
117
|
-
- Name: `ownerId` Required: ``
|
118
|
-
- Type: Array<string> | string | SearchQuery
|
119
|
-
- string: 12345678
|
120
|
-
- Array<string>: 12345678,87654321
|
121
|
-
- object:
|
122
|
-
- Description: Filter by the ID of the User that owns the ProcessInstances.
|
123
|
-
- Name: `state` Required: ``
|
124
|
-
- Type: Array<string> | string | SearchQuery
|
125
|
-
- string: running
|
126
|
-
- Array<string>: running,finished
|
127
|
-
- object:
|
128
|
-
- Description: Filter by the state of the ProcessInstances.
|
129
|
-
- Name: `parentProcessInstanceId` Required: ``
|
130
|
-
- Type: Array<string> | string | SearchQuery
|
131
|
-
- string: myParentProcessInstance_12345678
|
132
|
-
- Array<string>: myParentProcessInstance_12345678,myParentProcessInstance_87654321
|
133
|
-
- object:
|
134
|
-
- Description: Filter by the ID of the parent ProcessInstance.
|
135
|
-
- Name: `embeddedProcessModelId` Required: ``
|
136
|
-
- Type: Array<string> | string | SearchQuery
|
137
|
-
- string: myModel1
|
138
|
-
- Array<string>: myModel1,myModel2
|
139
|
-
- object:
|
140
|
-
- Description: Filter by the ID of the embedded process model.
|
141
|
-
- Name: `terminatedByUserId` Required: ``
|
142
|
-
- Type: Array<string> | string | SearchQuery
|
143
|
-
- string: 12345678
|
144
|
-
- Array<string>: 12345678,87654321
|
145
|
-
- object:
|
146
|
-
- Description: Filter by the ID of the User that terminated the ProcessInstances.
|
147
|
-
- Name: `createdBefore` Required: ``
|
148
|
-
- Type: string
|
149
|
-
- Description: The maximum created date of the ProcessInstances to include in the results.
|
150
|
-
- Name: `createdAt` Required: ``
|
151
|
-
- Type: Array<string> | string
|
152
|
-
- string: 2021-01-01T00:00:00.000Z
|
153
|
-
- array: 2021-01-01T00:00:00.000Z,2021-01-02T00:00:00.000Z
|
154
|
-
- Description: The minimum created date of the ProcessInstances to include in the results.
|
155
|
-
- Name: `createdAfter` Required: ``
|
156
|
-
- Type: string
|
157
|
-
- Description: The minimum created date of the ProcessInstances to include in the results.
|
158
|
-
- Name: `updatedBefore` Required: ``
|
159
|
-
- Type: string
|
160
|
-
- Description: The maximum updated date of the ProcessInstances to include in the results.
|
161
|
-
- Name: `updatedAt` Required: ``
|
162
|
-
- Type: Array<string> | string
|
163
|
-
- string: 2021-01-01T00:00:00.000Z
|
164
|
-
- array: 2021-01-01T00:00:00.000Z,2021-01-02T00:00:00.000Z
|
165
|
-
- Description: The exact updated date of the ProcessInstances to include in the results.
|
166
|
-
- Name: `updatedAfter` Required: ``
|
167
|
-
- Type: string
|
168
|
-
- Description: The minimum updated date of the ProcessInstances to include in the results.
|
169
|
-
- Name: `finishedBefore` Required: ``
|
170
|
-
- Type: string
|
171
|
-
- Description: The maximum finished date of the ProcessInstances to include in the results.
|
172
|
-
- Name: `finishedAt` Required: ``
|
173
|
-
- Type: Array<string> | string
|
174
|
-
- string: 2021-01-01T00:00:00.000Z
|
175
|
-
- array: 2021-01-01T00:00:00.000Z,2021-01-02T00:00:00.000Z
|
176
|
-
- Description: The exact finished date of the ProcessInstances to include in the results.
|
177
|
-
- Name: `finishedAfter` Required: ``
|
178
|
-
- Type: string
|
179
|
-
- Description: The minimum finished date of the ProcessInstances to include in the results.
|
180
|
-
- Name: `triggeredByFlowNodeInstance` Required: ``
|
181
|
-
- Type: Array<string> | string | SearchQuery
|
182
|
-
- string: myFlowNodeInstance_12345678
|
183
|
-
- array: myFlowNodeInstance_12345678,myFlowNodeInstance_87654321
|
184
|
-
- object:
|
185
|
-
- Description: Filter by the ID of the FlowNodeInstance that triggered the ProcessInstance.
|
186
|
-
|
187
68
|
### References
|
188
69
|
|
189
70
|
- [The ProcessCube© Developer Network](https://processcube.io) - All documentation for the ProcessCube© platform
|
package/wait-for-usertask.html
CHANGED
@@ -70,125 +70,6 @@ Waiting for Usertasks of the connected ProcessCube Engine.
|
|
70
70
|
- `msg.payload` or a constant json to filter the UserTasks for Waiting for
|
71
71
|
- `Only for new` will trigger only for new UserTasks if checked and also for old ones if not checked.
|
72
72
|
|
73
|
-
### Query fields
|
74
|
-
|
75
|
-
**Summary**:
|
76
|
-
|
77
|
-
**Description**: Filter result for 'Wait for UserTask'
|
78
|
-
|
79
|
-
#### Parameters:
|
80
|
-
- Name: `offset` Required: `false`
|
81
|
-
- Type: number
|
82
|
-
- Description: The index of the first ProcessInstance to include in the result set.
|
83
|
-
- Name: `limit` Required: `false`
|
84
|
-
- Type: number
|
85
|
-
- Description: The maximum number of ProcessInstances to return.
|
86
|
-
- Name: `correlationId` Required: `false`
|
87
|
-
- Type: Array<string> | string | SearchQuery
|
88
|
-
- string: myCorrelationId
|
89
|
-
- Array<string>: myCorrelationId1,myCorrelationId2
|
90
|
-
- object:
|
91
|
-
- Description: Filter by the CorrelationId of the ProcessInstances.
|
92
|
-
- Name: `processInstanceId` Required: ``
|
93
|
-
- Type: Array<string> | string | SearchQuery
|
94
|
-
- string: myProcessInstance_12345678
|
95
|
-
- Array<string>: myProcessInstance_12345678,myProcessInstance_87654321
|
96
|
-
- object:
|
97
|
-
- Description: Filter by the ID of the ProcessInstances.
|
98
|
-
- Name: `processDefinitionId` Required: ``
|
99
|
-
- Type: Array<string> | string | SearchQuery
|
100
|
-
- string: myProcess_12345678
|
101
|
-
- Array<string>: myProcess_12345678,myProcess_87654321
|
102
|
-
- object:
|
103
|
-
- Description: Filter by the ID of the ProcessDefinition that the ProcessInstances belong to.
|
104
|
-
- Name: `processModelId` Required: ``
|
105
|
-
- Type: Array<string> | string | SearchQuery
|
106
|
-
- string: myProcessModel_12345678
|
107
|
-
- Array<string>: myProcessModel_12345678,myProcessModel_87654321
|
108
|
-
- object:
|
109
|
-
- Description: Filter by the ID of the ProcessModel that the ProcessInstances belong to.
|
110
|
-
- Name: `processModelName` Required: ``
|
111
|
-
- Type: Array<string> | string | SearchQuery
|
112
|
-
- string: My Process Model
|
113
|
-
- Array<string>: My Process Model,My Other Process Model
|
114
|
-
- object:
|
115
|
-
- Description: Filter by the name of the ProcessModel that the ProcessInstances belong to.
|
116
|
-
- Name: `processModelHash` Required: ``
|
117
|
-
- Type: Array<string> | string | SearchQuery
|
118
|
-
- string: 12345678
|
119
|
-
- Array<string>: 12345678,87654321
|
120
|
-
- object:
|
121
|
-
- Description: Filter by the hash of the ProcessModel that the ProcessInstances belong to.
|
122
|
-
- Name: `ownerId` Required: ``
|
123
|
-
- Type: Array<string> | string | SearchQuery
|
124
|
-
- string: 12345678
|
125
|
-
- Array<string>: 12345678,87654321
|
126
|
-
- object:
|
127
|
-
- Description: Filter by the ID of the User that owns the ProcessInstances.
|
128
|
-
- Name: `state` Required: ``
|
129
|
-
- Type: Array<string> | string | SearchQuery
|
130
|
-
- string: running
|
131
|
-
- Array<string>: running,finished
|
132
|
-
- object:
|
133
|
-
- Description: Filter by the state of the ProcessInstances.
|
134
|
-
- Name: `parentProcessInstanceId` Required: ``
|
135
|
-
- Type: Array<string> | string | SearchQuery
|
136
|
-
- string: myParentProcessInstance_12345678
|
137
|
-
- Array<string>: myParentProcessInstance_12345678,myParentProcessInstance_87654321
|
138
|
-
- object:
|
139
|
-
- Description: Filter by the ID of the parent ProcessInstance.
|
140
|
-
- Name: `embeddedProcessModelId` Required: ``
|
141
|
-
- Type: Array<string> | string | SearchQuery
|
142
|
-
- string: myModel1
|
143
|
-
- Array<string>: myModel1,myModel2
|
144
|
-
- object:
|
145
|
-
- Description: Filter by the ID of the embedded process model.
|
146
|
-
- Name: `terminatedByUserId` Required: ``
|
147
|
-
- Type: Array<string> | string | SearchQuery
|
148
|
-
- string: 12345678
|
149
|
-
- Array<string>: 12345678,87654321
|
150
|
-
- object:
|
151
|
-
- Description: Filter by the ID of the User that terminated the ProcessInstances.
|
152
|
-
- Name: `createdBefore` Required: ``
|
153
|
-
- Type: string
|
154
|
-
- Description: The maximum created date of the ProcessInstances to include in the results.
|
155
|
-
- Name: `createdAt` Required: ``
|
156
|
-
- Type: Array<string> | string
|
157
|
-
- string: 2021-01-01T00:00:00.000Z
|
158
|
-
- array: 2021-01-01T00:00:00.000Z,2021-01-02T00:00:00.000Z
|
159
|
-
- Description: The minimum created date of the ProcessInstances to include in the results.
|
160
|
-
- Name: `createdAfter` Required: ``
|
161
|
-
- Type: string
|
162
|
-
- Description: The minimum created date of the ProcessInstances to include in the results.
|
163
|
-
- Name: `updatedBefore` Required: ``
|
164
|
-
- Type: string
|
165
|
-
- Description: The maximum updated date of the ProcessInstances to include in the results.
|
166
|
-
- Name: `updatedAt` Required: ``
|
167
|
-
- Type: Array<string> | string
|
168
|
-
- string: 2021-01-01T00:00:00.000Z
|
169
|
-
- array: 2021-01-01T00:00:00.000Z,2021-01-02T00:00:00.000Z
|
170
|
-
- Description: The exact updated date of the ProcessInstances to include in the results.
|
171
|
-
- Name: `updatedAfter` Required: ``
|
172
|
-
- Type: string
|
173
|
-
- Description: The minimum updated date of the ProcessInstances to include in the results.
|
174
|
-
- Name: `finishedBefore` Required: ``
|
175
|
-
- Type: string
|
176
|
-
- Description: The maximum finished date of the ProcessInstances to include in the results.
|
177
|
-
- Name: `finishedAt` Required: ``
|
178
|
-
- Type: Array<string> | string
|
179
|
-
- string: 2021-01-01T00:00:00.000Z
|
180
|
-
- array: 2021-01-01T00:00:00.000Z,2021-01-02T00:00:00.000Z
|
181
|
-
- Description: The exact finished date of the ProcessInstances to include in the results.
|
182
|
-
- Name: `finishedAfter` Required: ``
|
183
|
-
- Type: string
|
184
|
-
- Description: The minimum finished date of the ProcessInstances to include in the results.
|
185
|
-
- Name: `triggeredByFlowNodeInstance` Required: ``
|
186
|
-
- Type: Array<string> | string | SearchQuery
|
187
|
-
- string: myFlowNodeInstance_12345678
|
188
|
-
- array: myFlowNodeInstance_12345678,myFlowNodeInstance_87654321
|
189
|
-
- object:
|
190
|
-
- Description: Filter by the ID of the FlowNodeInstance that triggered the ProcessInstance.
|
191
|
-
|
192
73
|
### References
|
193
74
|
|
194
75
|
- [The ProcessCube© Developer Network](https://processcube.io) - All documentation for the ProcessCube© platform
|
package/wait-for-usertask.js
CHANGED
@@ -27,23 +27,27 @@ module.exports = function (RED) {
|
|
27
27
|
...query
|
28
28
|
};
|
29
29
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
30
|
+
try {
|
31
|
+
const matchingFlowNodes = await client.userTasks.query(newQuery, { identity: currentIdentity });
|
32
|
+
|
33
|
+
if (matchingFlowNodes.userTasks && matchingFlowNodes.userTasks.length == 1) {
|
34
|
+
// remove subscription
|
35
|
+
client.userTasks.removeSubscription(subscription, currentIdentity);
|
36
|
+
|
37
|
+
const userTask = matchingFlowNodes.userTasks[0];
|
38
|
+
|
39
|
+
msg.payload = { userTask: userTask };
|
40
|
+
node.send(msg);
|
41
|
+
} else {
|
42
|
+
// nothing todo - wait for next notification
|
43
|
+
}
|
44
|
+
} catch (error) {
|
45
|
+
node.error(error);
|
42
46
|
}
|
43
47
|
|
44
48
|
}, { identity: currentIdentity });
|
45
49
|
|
46
|
-
node.log({"Handling old userTasks config.only_for_new": config.only_for_new});
|
50
|
+
node.log({ "Handling old userTasks config.only_for_new": config.only_for_new });
|
47
51
|
|
48
52
|
if (config.only_for_new === false) {
|
49
53
|
// only check suspended user tasks
|
@@ -52,18 +56,22 @@ module.exports = function (RED) {
|
|
52
56
|
...query
|
53
57
|
};
|
54
58
|
|
55
|
-
|
59
|
+
try {
|
60
|
+
const matchingFlowNodes = await client.userTasks.query(suspendedQuery, { identity: currentIdentity });
|
56
61
|
|
57
|
-
|
58
|
-
|
62
|
+
if (matchingFlowNodes.userTasks && matchingFlowNodes.userTasks.length >= 1) {
|
63
|
+
const userTask = matchingFlowNodes.userTasks[0];
|
59
64
|
|
60
|
-
|
61
|
-
|
65
|
+
msg.payload = { userTask: userTask };
|
66
|
+
node.send(msg);
|
62
67
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
68
|
+
// remove subscription
|
69
|
+
client.userTasks.removeSubscription(subscription, currentIdentity);
|
70
|
+
} else {
|
71
|
+
// let the *currentIdentity* be active
|
72
|
+
}
|
73
|
+
} catch (error) {
|
74
|
+
node.error(error);
|
67
75
|
}
|
68
76
|
}
|
69
77
|
};
|
@@ -84,7 +92,7 @@ module.exports = function (RED) {
|
|
84
92
|
|
85
93
|
node.on("close", async () => {
|
86
94
|
if (client != null && subscription != null) {
|
87
|
-
client.userTasks.removeSubscription(subscription, currentIdentity);
|
95
|
+
client.userTasks.removeSubscription(subscription, currentIdentity);
|
88
96
|
}
|
89
97
|
});
|
90
98
|
}
|