@5minds/node-red-contrib-processcube 1.7.5-develop-106e2c-m6jdhezm → 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.
Files changed (41) hide show
  1. package/.processcube/nodered/.config.nodes.json +1 -1
  2. package/.processcube/nodered/config.js +2 -3
  3. package/.processcube/nodered/settings.js +1 -1
  4. package/README.md +8 -2
  5. package/doc_generator/generator.js +5 -5
  6. package/doc_generator/generator_with_swagger.js +80 -78
  7. package/endevent-finished-listener.html +16 -16
  8. package/externaltask-error.html +11 -11
  9. package/externaltask-error.js +3 -1
  10. package/externaltask-event-listener.html +9 -9
  11. package/externaltask-input.html +26 -26
  12. package/externaltask-input.js +6 -7
  13. package/externaltask-output.html +7 -7
  14. package/message-event-trigger.html +8 -8
  15. package/message-event-trigger.js +3 -0
  16. package/package.json +5 -2
  17. package/process-event-listener.html +74 -74
  18. package/process-event-listener.js +1 -2
  19. package/process-start.html +12 -12
  20. package/process-start.js +6 -3
  21. package/process-terminate.html +9 -9
  22. package/process-terminate.js +3 -1
  23. package/processcube-engine-config.html +8 -8
  24. package/processcube-engine-config.js +0 -2
  25. package/processdefinition-deploy.html +9 -9
  26. package/processdefinition-deploy.js +4 -2
  27. package/processdefinition-query.html +139 -140
  28. package/processdefinition-query.js +4 -0
  29. package/processinstance-delete.html +48 -46
  30. package/processinstance-delete.js +24 -9
  31. package/processinstance-query.html +120 -119
  32. package/processinstance-query.js +3 -1
  33. package/signal-event-trigger.html +8 -9
  34. package/signal-event-trigger.js +3 -0
  35. package/usertask-event-listener.html +126 -127
  36. package/usertask-input.html +126 -125
  37. package/usertask-input.js +3 -1
  38. package/usertask-output.html +7 -7
  39. package/usertask-output.js +5 -2
  40. package/wait-for-usertask.html +173 -164
  41. package/wait-for-usertask.js +36 -25
@@ -55,137 +55,138 @@
55
55
  </script>
56
56
 
57
57
  <script type="text/markdown" data-help-name="usertask-input">
58
- A node which sends a payload to a usertask in the ProcessCube.
58
+ A node which sends a payload to a usertask in the ProcessCube.
59
59
 
60
- ## Inputs
60
+ ## Inputs
61
61
 
62
- : payload (Object) : Will be used as the input for the usertask.
63
- : query (String) : Will be used as the query for the usertask.
64
- : query_type (String) : Will be used as the type of the query for the usertask.
65
- : force_send_array (Boolean) : Will be used to force the payload to be sent as an array.
66
- : multisend (Boolean) : Will be used to send one output of each usertask input.
62
+ : payload (Object) : Will be used as the input for the usertask.
63
+ : query (String) : Will be used as the query for the usertask.
64
+ : query_type (String) : Will be used as the type of the query for the usertask.
65
+ : force_send_array (Boolean) : Will be used to force the payload to be sent as an array.
66
+ : multisend (Boolean) : Will be used to send one output of each usertask input.
67
67
 
68
- ### Query fields
68
+ ### Query fields
69
69
 
70
- **Summary**:
70
+ **Summary**:
71
71
 
72
- **Description**: Filter result for &#39;UserTasks Input&#39;
72
+ **Description**: Filter result for &#39;UserTasks Input&#39;
73
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&lt;string&gt; | string | SearchQuery
83
- - string: myCorrelationId
84
- - Array&lt;string&gt;: myCorrelationId1,myCorrelationId2
85
- - object:
86
- - Description: Filter by the CorrelationId of the ProcessInstances.
87
- - Name: `processInstanceId` Required: ``
88
- - Type: Array&lt;string&gt; | string | SearchQuery
89
- - string: myProcessInstance_12345678
90
- - Array&lt;string&gt;: myProcessInstance_12345678,myProcessInstance_87654321
91
- - object:
92
- - Description: Filter by the ID of the ProcessInstances.
93
- - Name: `processDefinitionId` Required: ``
94
- - Type: Array&lt;string&gt; | string | SearchQuery
95
- - string: myProcess_12345678
96
- - Array&lt;string&gt;: 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&lt;string&gt; | string | SearchQuery
101
- - string: myProcessModel_12345678
102
- - Array&lt;string&gt;: 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&lt;string&gt; | string | SearchQuery
107
- - string: My Process Model
108
- - Array&lt;string&gt;: 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&lt;string&gt; | string | SearchQuery
113
- - string: 12345678
114
- - Array&lt;string&gt;: 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&lt;string&gt; | string | SearchQuery
119
- - string: 12345678
120
- - Array&lt;string&gt;: 12345678,87654321
121
- - object:
122
- - Description: Filter by the ID of the User that owns the ProcessInstances.
123
- - Name: `state` Required: ``
124
- - Type: Array&lt;string&gt; | string | SearchQuery
125
- - string: running
126
- - Array&lt;string&gt;: running,finished
127
- - object:
128
- - Description: Filter by the state of the ProcessInstances.
129
- - Name: `parentProcessInstanceId` Required: ``
130
- - Type: Array&lt;string&gt; | string | SearchQuery
131
- - string: myParentProcessInstance_12345678
132
- - Array&lt;string&gt;: myParentProcessInstance_12345678,myParentProcessInstance_87654321
133
- - object:
134
- - Description: Filter by the ID of the parent ProcessInstance.
135
- - Name: `embeddedProcessModelId` Required: ``
136
- - Type: Array&lt;string&gt; | string | SearchQuery
137
- - string: myModel1
138
- - Array&lt;string&gt;: myModel1,myModel2
139
- - object:
140
- - Description: Filter by the ID of the embedded process model.
141
- - Name: `terminatedByUserId` Required: ``
142
- - Type: Array&lt;string&gt; | string | SearchQuery
143
- - string: 12345678
144
- - Array&lt;string&gt;: 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&lt;string&gt; | 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&lt;string&gt; | 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&lt;string&gt; | 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&lt;string&gt; | 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.
74
+ #### Parameters:
186
75
 
187
- ### References
76
+ - Name: `offset` Required: `false`
77
+ - Type: number
78
+ - Description: The index of the first ProcessInstance to include in the result set.
79
+ - Name: `limit` Required: `false`
80
+ - Type: number
81
+ - Description: The maximum number of ProcessInstances to return.
82
+ - Name: `correlationId` Required: `false`
83
+ - Type: Array&lt;string&gt; | string | SearchQuery
84
+ - string: myCorrelationId
85
+ - Array&lt;string&gt;: myCorrelationId1,myCorrelationId2
86
+ - object:
87
+ - Description: Filter by the CorrelationId of the ProcessInstances.
88
+ - Name: `processInstanceId` Required: ``
89
+ - Type: Array&lt;string&gt; | string | SearchQuery
90
+ - string: myProcessInstance_12345678
91
+ - Array&lt;string&gt;: myProcessInstance_12345678,myProcessInstance_87654321
92
+ - object:
93
+ - Description: Filter by the ID of the ProcessInstances.
94
+ - Name: `processDefinitionId` Required: ``
95
+ - Type: Array&lt;string&gt; | string | SearchQuery
96
+ - string: myProcess_12345678
97
+ - Array&lt;string&gt;: myProcess_12345678,myProcess_87654321
98
+ - object:
99
+ - Description: Filter by the ID of the ProcessDefinition that the ProcessInstances belong to.
100
+ - Name: `processModelId` Required: ``
101
+ - Type: Array&lt;string&gt; | string | SearchQuery
102
+ - string: myProcessModel_12345678
103
+ - Array&lt;string&gt;: myProcessModel_12345678,myProcessModel_87654321
104
+ - object:
105
+ - Description: Filter by the ID of the ProcessModel that the ProcessInstances belong to.
106
+ - Name: `processModelName` Required: ``
107
+ - Type: Array&lt;string&gt; | string | SearchQuery
108
+ - string: My Process Model
109
+ - Array&lt;string&gt;: My Process Model,My Other Process Model
110
+ - object:
111
+ - Description: Filter by the name of the ProcessModel that the ProcessInstances belong to.
112
+ - Name: `processModelHash` Required: ``
113
+ - Type: Array&lt;string&gt; | string | SearchQuery
114
+ - string: 12345678
115
+ - Array&lt;string&gt;: 12345678,87654321
116
+ - object:
117
+ - Description: Filter by the hash of the ProcessModel that the ProcessInstances belong to.
118
+ - Name: `ownerId` Required: ``
119
+ - Type: Array&lt;string&gt; | string | SearchQuery
120
+ - string: 12345678
121
+ - Array&lt;string&gt;: 12345678,87654321
122
+ - object:
123
+ - Description: Filter by the ID of the User that owns the ProcessInstances.
124
+ - Name: `state` Required: ``
125
+ - Type: Array&lt;string&gt; | string | SearchQuery
126
+ - string: running
127
+ - Array&lt;string&gt;: running,finished
128
+ - object:
129
+ - Description: Filter by the state of the ProcessInstances.
130
+ - Name: `parentProcessInstanceId` Required: ``
131
+ - Type: Array&lt;string&gt; | string | SearchQuery
132
+ - string: myParentProcessInstance_12345678
133
+ - Array&lt;string&gt;: myParentProcessInstance_12345678,myParentProcessInstance_87654321
134
+ - object:
135
+ - Description: Filter by the ID of the parent ProcessInstance.
136
+ - Name: `embeddedProcessModelId` Required: ``
137
+ - Type: Array&lt;string&gt; | string | SearchQuery
138
+ - string: myModel1
139
+ - Array&lt;string&gt;: myModel1,myModel2
140
+ - object:
141
+ - Description: Filter by the ID of the embedded process model.
142
+ - Name: `terminatedByUserId` Required: ``
143
+ - Type: Array&lt;string&gt; | string | SearchQuery
144
+ - string: 12345678
145
+ - Array&lt;string&gt;: 12345678,87654321
146
+ - object:
147
+ - Description: Filter by the ID of the User that terminated the ProcessInstances.
148
+ - Name: `createdBefore` Required: ``
149
+ - Type: string
150
+ - Description: The maximum created date of the ProcessInstances to include in the results.
151
+ - Name: `createdAt` Required: ``
152
+ - Type: Array&lt;string&gt; | string
153
+ - string: 2021-01-01T00:00:00.000Z
154
+ - array: 2021-01-01T00:00:00.000Z,2021-01-02T00:00:00.000Z
155
+ - Description: The minimum created date of the ProcessInstances to include in the results.
156
+ - Name: `createdAfter` Required: ``
157
+ - Type: string
158
+ - Description: The minimum created date of the ProcessInstances to include in the results.
159
+ - Name: `updatedBefore` Required: ``
160
+ - Type: string
161
+ - Description: The maximum updated date of the ProcessInstances to include in the results.
162
+ - Name: `updatedAt` Required: ``
163
+ - Type: Array&lt;string&gt; | 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 exact updated date of the ProcessInstances to include in the results.
167
+ - Name: `updatedAfter` Required: ``
168
+ - Type: string
169
+ - Description: The minimum updated date of the ProcessInstances to include in the results.
170
+ - Name: `finishedBefore` Required: ``
171
+ - Type: string
172
+ - Description: The maximum finished date of the ProcessInstances to include in the results.
173
+ - Name: `finishedAt` Required: ``
174
+ - Type: Array&lt;string&gt; | 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 finished date of the ProcessInstances to include in the results.
178
+ - Name: `finishedAfter` Required: ``
179
+ - Type: string
180
+ - Description: The minimum finished date of the ProcessInstances to include in the results.
181
+ - Name: `triggeredByFlowNodeInstance` Required: ``
182
+ - Type: Array&lt;string&gt; | string | SearchQuery
183
+ - string: myFlowNodeInstance_12345678
184
+ - array: myFlowNodeInstance_12345678,myFlowNodeInstance_87654321
185
+ - object:
186
+ - Description: Filter by the ID of the FlowNodeInstance that triggered the ProcessInstance.
188
187
 
189
- - [The ProcessCube&copy; Developer Network](https://processcube.io) - All documentation for the ProcessCube&copy; platform
190
- - [ProcessCube&copy; LowCode Integration](https://processcube.io/docs/node-red) - LowCode integration in ProcessCube&copy;
188
+ ### References
189
+
190
+ - [The ProcessCube&copy; Developer Network](https://processcube.io) - All documentation for the ProcessCube&copy; platform
191
+ - [ProcessCube&copy; LowCode Integration](https://processcube.io/docs/node-red) - LowCode integration in ProcessCube&copy;
191
192
  </script>
package/usertask-input.js CHANGED
@@ -7,6 +7,8 @@ module.exports = function (RED) {
7
7
  node.engine = RED.nodes.getNode(config.engine);
8
8
 
9
9
  const client = node.engine.engineClient;
10
+ const isUser = !!msg._client?.user;
11
+ const userIdentity = isUser ? { userId: msg._client.user.id, token: msg._client.user.accessToken } : null;
10
12
 
11
13
  if (!client) {
12
14
  node.error('No engine configured.', msg);
@@ -16,7 +18,7 @@ module.exports = function (RED) {
16
18
  let query = RED.util.evaluateNodeProperty(config.query, config.query_type, node, msg);
17
19
 
18
20
  client.userTasks
19
- .query(query)
21
+ .query(query, { identity: userIdentity })
20
22
  .then((matchingFlowNodes) => {
21
23
  if (config.sendtype === 'array') {
22
24
  msg.payload = { userTasks: matchingFlowNodes.userTasks || [] };
@@ -47,15 +47,15 @@
47
47
  </script>
48
48
 
49
49
  <script type="text/markdown" data-help-name="usertask-output">
50
- A node which sends the result of a usertask to the ProcessCube.
50
+ A node which sends the result of a usertask to the ProcessCube.
51
51
 
52
- ## Inputs
52
+ ## Inputs
53
53
 
54
- : payload (Object | JSON) : Will be used as the result for the usertask or can be directly set as JSON.
55
- : payload.usertask.flowNodeInstanceId (String) : The flowNodeInstanceId of the usertask that will be finished.
54
+ : payload (Object | JSON) : Will be used as the result for the usertask or can be directly set as JSON.
55
+ : payload.usertask.flowNodeInstanceId (String) : The flowNodeInstanceId of the usertask that will be finished.
56
56
 
57
- ### References
57
+ ### References
58
58
 
59
- - [The ProcessCube&copy; Developer Network](https://processcube.io) - All documentation for the ProcessCube&copy; platform
60
- - [ProcessCube&copy; LowCode Integration](https://processcube.io/docs/node-red) - LowCode integration in ProcessCube&copy;
59
+ - [The ProcessCube&copy; Developer Network](https://processcube.io) - All documentation for the ProcessCube&copy; platform
60
+ - [ProcessCube&copy; LowCode Integration](https://processcube.io/docs/node-red) - LowCode integration in ProcessCube&copy;
61
61
  </script>
@@ -13,10 +13,13 @@ module.exports = function (RED) {
13
13
  delete userTaskResult.format;
14
14
  delete userTaskResult.msg;
15
15
 
16
-
17
16
  node.engine = RED.nodes.getNode(config.engine);
18
17
 
19
18
  const client = node.engine.engineClient;
19
+ const isUser = !!msg._client?.user;
20
+ const userIdentity = isUser
21
+ ? { userId: msg._client.user.id, token: msg._client.user.accessToken }
22
+ : null;
20
23
 
21
24
  if (!client) {
22
25
  node.error('No engine configured.', msg);
@@ -24,7 +27,7 @@ module.exports = function (RED) {
24
27
  }
25
28
 
26
29
  client.userTasks
27
- .finishUserTask(flowNodeInstanceId, userTaskResult)
30
+ .finishUserTask(flowNodeInstanceId, userTaskResult, userIdentity)
28
31
  .then(() => {
29
32
  node.send(msg);
30
33
  })