@5minds/node-red-contrib-processcube 2.0.0-feature-629c78-m2dq1ygt → 7.6.0-develop-51b534-mjy3s4sm

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 (68) hide show
  1. package/README.md +3 -58
  2. package/check-authorization.html +138 -0
  3. package/check-authorization.js +27 -0
  4. package/dataobject-instance-query.html +141 -0
  5. package/dataobject-instance-query.js +45 -0
  6. package/endevent-finished-listener.js +14 -25
  7. package/examples/Check-Authorization-Sample.json +109 -0
  8. package/examples/Dataobject-Instance-Query-Sample.json +109 -0
  9. package/externaltask-error.html +8 -3
  10. package/externaltask-error.js +43 -29
  11. package/externaltask-event-listener.js +11 -28
  12. package/externaltask-input.html +48 -3
  13. package/externaltask-input.js +581 -114
  14. package/externaltask-output.js +20 -16
  15. package/icons/data-object-query.svg +5 -0
  16. package/message-event-trigger.html +1 -1
  17. package/message-event-trigger.js +8 -7
  18. package/package.json +74 -67
  19. package/process-event-listener.js +166 -225
  20. package/process-start.html +6 -0
  21. package/process-start.js +29 -6
  22. package/process-terminate.html +1 -1
  23. package/process-terminate.js +7 -5
  24. package/processcube-engine-config.html +25 -7
  25. package/processcube-engine-config.js +25 -135
  26. package/processcube-google-docs-mail-template.html +150 -0
  27. package/processcube-google-docs-mail-template.js +158 -0
  28. package/processdefinition-deploy.html +44 -0
  29. package/processdefinition-deploy.js +28 -0
  30. package/processdefinition-query.html +18 -13
  31. package/processdefinition-query.js +33 -31
  32. package/processinstance-delete-advanced.html +82 -0
  33. package/processinstance-delete-advanced.js +33 -0
  34. package/processinstance-delete.html +60 -8
  35. package/processinstance-delete.js +84 -30
  36. package/processinstance-query.html +116 -109
  37. package/processinstance-query.js +28 -5
  38. package/signal-event-trigger.js +8 -6
  39. package/usertask-event-listener.html +123 -1
  40. package/usertask-event-listener.js +30 -45
  41. package/usertask-input.html +119 -0
  42. package/usertask-input.js +7 -9
  43. package/usertask-output.js +15 -8
  44. package/wait-for-usertask.html +122 -6
  45. package/wait-for-usertask.js +44 -47
  46. package/.github/workflows/build-and-publish.yml +0 -72
  47. package/.processcube/authority/config/config.json +0 -36
  48. package/.processcube/authority/config/upeSeedingData.json +0 -12
  49. package/Dockerfile +0 -9
  50. package/doc_generator/_process_instances_query.md +0 -115
  51. package/doc_generator/generator.js +0 -41
  52. package/doc_generator/generator_with_swagger.js +0 -72
  53. package/doc_generator/package-lock.json +0 -176
  54. package/doc_generator/package.json +0 -15
  55. package/doc_generator/query_template.mustache +0 -20
  56. package/doc_generator/swagger.json +0 -4110
  57. package/docker-compose.yml +0 -44
  58. package/nodered/flows.json +0 -2156
  59. package/nodered/flows_cred.json +0 -3
  60. package/nodered/settings.js +0 -562
  61. package/nodered/static/ProcessCube_Logo.svg +0 -53
  62. package/processes/Call-Activity-Sample.bpmn +0 -88
  63. package/processes/External-Task-Auth-Sample.bpmn +0 -82
  64. package/processes/External-Task-Sample.bpmn +0 -94
  65. package/processes/SampleEvent.bpmn +0 -73
  66. package/processes/User-Task-Auth-Sample.bpmn +0 -63
  67. package/processes/User-Task-Sample.bpmn +0 -76
  68. package/processes/Wait-For-Usertask.bpmn +0 -74
@@ -65,6 +65,125 @@ 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
+
68
187
  ### References
69
188
 
70
189
  - [The ProcessCube© Developer Network](https://processcube.io) - All documentation for the ProcessCube© platform
package/usertask-input.js CHANGED
@@ -4,23 +4,21 @@ module.exports = function (RED) {
4
4
  var node = this;
5
5
 
6
6
  node.on('input', function (msg) {
7
- const engine = RED.nodes.getNode(config.engine);
7
+ node.engine = RED.nodes.getNode(config.engine);
8
8
 
9
- const client = engine.engineClient;
9
+ const client = node.engine.engineClient;
10
+ const isUser = !!msg._client?.user && !!msg._client.user.accessToken;
11
+ const userIdentity = isUser ? { userId: msg._client.user.id, token: msg._client.user.accessToken } : null;
10
12
 
11
13
  if (!client) {
12
- node.error('No engine configured.');
14
+ node.error('No engine configured.', msg);
13
15
  return;
14
16
  }
15
17
 
16
18
  let query = RED.util.evaluateNodeProperty(config.query, config.query_type, node, msg);
17
19
 
18
- query = {
19
- ...query,
20
- };
21
-
22
20
  client.userTasks
23
- .query(query, { identity: engine.identity })
21
+ .query(query, {identity: userIdentity})
24
22
  .then((matchingFlowNodes) => {
25
23
  if (config.sendtype === 'array') {
26
24
  msg.payload = { userTasks: matchingFlowNodes.userTasks || [] };
@@ -36,7 +34,7 @@ module.exports = function (RED) {
36
34
  } else node.log(`No user tasks found for query: ${JSON.stringify(query)}`);
37
35
  })
38
36
  .catch((error) => {
39
- node.error(error);
37
+ node.error(error, msg);
40
38
  });
41
39
  });
42
40
  }
@@ -7,27 +7,34 @@ module.exports = function (RED) {
7
7
  if (msg.payload.userTask) {
8
8
  const flowNodeInstanceId = msg.payload.userTask.flowNodeInstanceId;
9
9
 
10
- const userTaskResult = RED.util.evaluateNodeProperty(config.result, config.result_type, node, msg);
10
+ let userTaskResult = RED.util.evaluateNodeProperty(config.result, config.result_type, node, msg);
11
11
 
12
- const engine = RED.nodes.getNode(config.engine);
12
+ // remote msg and format from result
13
+ delete userTaskResult.format;
14
+ delete userTaskResult.msg;
13
15
 
14
- const client = engine.engineClient;
16
+
17
+ node.engine = RED.nodes.getNode(config.engine);
18
+
19
+ const client = node.engine.engineClient;
20
+ const isUser = !!msg._client?.user && !!msg._client.user.accessToken;
21
+ const userIdentity = isUser ? { userId: msg._client.user.id, token: msg._client.user.accessToken } : null;
15
22
 
16
23
  if (!client) {
17
- node.error('No engine configured.');
24
+ node.error('No engine configured.', msg);
18
25
  return;
19
26
  }
20
-
27
+
21
28
  client.userTasks
22
- .finishUserTask(flowNodeInstanceId, userTaskResult, engine.identity)
29
+ .finishUserTask(flowNodeInstanceId, userTaskResult, userIdentity)
23
30
  .then(() => {
24
31
  node.send(msg);
25
32
  })
26
33
  .catch((error) => {
27
- node.error(error);
34
+ node.error(error, msg);
28
35
  });
29
36
  } else {
30
- node.error(`No UserTask found in message: ${JSON.stringify(msg.payload)}`);
37
+ node.error(`No UserTask found in message: ${JSON.stringify(msg.payload)}`, msg);
31
38
  }
32
39
  });
33
40
  }
@@ -45,12 +45,9 @@
45
45
  <label for="node-input-query"><i class="fa fa-tag"></i> Query</label>
46
46
  <input type="text" id="node-input-query">
47
47
  </div>
48
- <div class="form-row" style="display:flex; margin-bottom: 3px;">
49
- <label for="node-input-only_for_new" style="vertical-align:top"><i class="fa fa-list-alt"></i> Only for new</label>
50
- <div>
51
- <input type="checkbox" checked id="node-input-only_for_new" style="display: inline-block; width: auto; margin: 0px 0px 0px 4px;">
52
- <label style="width:auto" for="node-input-multisend">Trigger only for new user task or *checked* also for old ones?</label>
53
- </div>
48
+ <div class="form-row" style="margin-bottom: 3px;">
49
+ <input type="checkbox" checked id="node-input-only_for_new" style="display: inline-block; width: auto; vertical-align: top; margin-left: 30px; margin-right: 5px;">
50
+ <label style="width:auto" for="node-input-multisend">Wait only for for new usertasks</label>
54
51
  </div>
55
52
  </script>
56
53
 
@@ -70,6 +67,125 @@ Waiting for Usertasks of the connected ProcessCube Engine.
70
67
  - `msg.payload` or a constant json to filter the UserTasks for Waiting for
71
68
  - `Only for new` will trigger only for new UserTasks if checked and also for old ones if not checked.
72
69
 
70
+ ### Query fields
71
+
72
+ **Summary**:
73
+
74
+ **Description**: Filter result for &#39;Wait for UserTask&#39;
75
+
76
+ #### Parameters:
77
+ - Name: `offset` Required: `false`
78
+ - Type: number
79
+ - Description: The index of the first ProcessInstance to include in the result set.
80
+ - Name: `limit` Required: `false`
81
+ - Type: number
82
+ - Description: The maximum number of ProcessInstances to return.
83
+ - Name: `correlationId` Required: `false`
84
+ - Type: Array&lt;string&gt; | string | SearchQuery
85
+ - string: myCorrelationId
86
+ - Array&lt;string&gt;: myCorrelationId1,myCorrelationId2
87
+ - object:
88
+ - Description: Filter by the CorrelationId of the ProcessInstances.
89
+ - Name: `processInstanceId` Required: ``
90
+ - Type: Array&lt;string&gt; | string | SearchQuery
91
+ - string: myProcessInstance_12345678
92
+ - Array&lt;string&gt;: myProcessInstance_12345678,myProcessInstance_87654321
93
+ - object:
94
+ - Description: Filter by the ID of the ProcessInstances.
95
+ - Name: `processDefinitionId` Required: ``
96
+ - Type: Array&lt;string&gt; | string | SearchQuery
97
+ - string: myProcess_12345678
98
+ - Array&lt;string&gt;: myProcess_12345678,myProcess_87654321
99
+ - object:
100
+ - Description: Filter by the ID of the ProcessDefinition that the ProcessInstances belong to.
101
+ - Name: `processModelId` Required: ``
102
+ - Type: Array&lt;string&gt; | string | SearchQuery
103
+ - string: myProcessModel_12345678
104
+ - Array&lt;string&gt;: myProcessModel_12345678,myProcessModel_87654321
105
+ - object:
106
+ - Description: Filter by the ID of the ProcessModel that the ProcessInstances belong to.
107
+ - Name: `processModelName` Required: ``
108
+ - Type: Array&lt;string&gt; | string | SearchQuery
109
+ - string: My Process Model
110
+ - Array&lt;string&gt;: My Process Model,My Other Process Model
111
+ - object:
112
+ - Description: Filter by the name of the ProcessModel that the ProcessInstances belong to.
113
+ - Name: `processModelHash` Required: ``
114
+ - Type: Array&lt;string&gt; | string | SearchQuery
115
+ - string: 12345678
116
+ - Array&lt;string&gt;: 12345678,87654321
117
+ - object:
118
+ - Description: Filter by the hash of the ProcessModel that the ProcessInstances belong to.
119
+ - Name: `ownerId` Required: ``
120
+ - Type: Array&lt;string&gt; | string | SearchQuery
121
+ - string: 12345678
122
+ - Array&lt;string&gt;: 12345678,87654321
123
+ - object:
124
+ - Description: Filter by the ID of the User that owns the ProcessInstances.
125
+ - Name: `state` Required: ``
126
+ - Type: Array&lt;string&gt; | string | SearchQuery
127
+ - string: running
128
+ - Array&lt;string&gt;: running,finished
129
+ - object:
130
+ - Description: Filter by the state of the ProcessInstances.
131
+ - Name: `parentProcessInstanceId` Required: ``
132
+ - Type: Array&lt;string&gt; | string | SearchQuery
133
+ - string: myParentProcessInstance_12345678
134
+ - Array&lt;string&gt;: myParentProcessInstance_12345678,myParentProcessInstance_87654321
135
+ - object:
136
+ - Description: Filter by the ID of the parent ProcessInstance.
137
+ - Name: `embeddedProcessModelId` Required: ``
138
+ - Type: Array&lt;string&gt; | string | SearchQuery
139
+ - string: myModel1
140
+ - Array&lt;string&gt;: myModel1,myModel2
141
+ - object:
142
+ - Description: Filter by the ID of the embedded process model.
143
+ - Name: `terminatedByUserId` Required: ``
144
+ - Type: Array&lt;string&gt; | string | SearchQuery
145
+ - string: 12345678
146
+ - Array&lt;string&gt;: 12345678,87654321
147
+ - object:
148
+ - Description: Filter by the ID of the User that terminated the ProcessInstances.
149
+ - Name: `createdBefore` Required: ``
150
+ - Type: string
151
+ - Description: The maximum created date of the ProcessInstances to include in the results.
152
+ - Name: `createdAt` Required: ``
153
+ - Type: Array&lt;string&gt; | string
154
+ - string: 2021-01-01T00:00:00.000Z
155
+ - array: 2021-01-01T00:00:00.000Z,2021-01-02T00:00:00.000Z
156
+ - Description: The minimum created date of the ProcessInstances to include in the results.
157
+ - Name: `createdAfter` Required: ``
158
+ - Type: string
159
+ - Description: The minimum created date of the ProcessInstances to include in the results.
160
+ - Name: `updatedBefore` Required: ``
161
+ - Type: string
162
+ - Description: The maximum updated date of the ProcessInstances to include in the results.
163
+ - Name: `updatedAt` Required: ``
164
+ - Type: Array&lt;string&gt; | string
165
+ - string: 2021-01-01T00:00:00.000Z
166
+ - array: 2021-01-01T00:00:00.000Z,2021-01-02T00:00:00.000Z
167
+ - Description: The exact updated date of the ProcessInstances to include in the results.
168
+ - Name: `updatedAfter` Required: ``
169
+ - Type: string
170
+ - Description: The minimum updated date of the ProcessInstances to include in the results.
171
+ - Name: `finishedBefore` Required: ``
172
+ - Type: string
173
+ - Description: The maximum finished date of the ProcessInstances to include in the results.
174
+ - Name: `finishedAt` Required: ``
175
+ - Type: Array&lt;string&gt; | string
176
+ - string: 2021-01-01T00:00:00.000Z
177
+ - array: 2021-01-01T00:00:00.000Z,2021-01-02T00:00:00.000Z
178
+ - Description: The exact finished date of the ProcessInstances to include in the results.
179
+ - Name: `finishedAfter` Required: ``
180
+ - Type: string
181
+ - Description: The minimum finished date of the ProcessInstances to include in the results.
182
+ - Name: `triggeredByFlowNodeInstance` Required: ``
183
+ - Type: Array&lt;string&gt; | string | SearchQuery
184
+ - string: myFlowNodeInstance_12345678
185
+ - array: myFlowNodeInstance_12345678,myFlowNodeInstance_87654321
186
+ - object:
187
+ - Description: Filter by the ID of the FlowNodeInstance that triggered the ProcessInstance.
188
+
73
189
  ### References
74
190
 
75
191
  - [The ProcessCube&copy; Developer Network](https://processcube.io) - All documentation for the ProcessCube&copy; platform
@@ -5,88 +5,85 @@ module.exports = function (RED) {
5
5
 
6
6
  node.engine = RED.nodes.getNode(config.engine);
7
7
 
8
- const client = node.engine.engineClient;
9
-
10
8
  let subscription = null;
11
- let currentIdentity = node.engine.identity;
12
9
  let subscribe = null;
13
10
 
14
11
  node.on('input', async function (msg) {
12
+ const client = node.engine.engineClient;
13
+ const isUser = !!msg._client?.user && !!msg._client.user.accessToken;
14
+ const userIdentity = isUser ? { userId: msg._client.user.id, token: msg._client.user.accessToken } : null;
15
15
  subscribe = async () => {
16
16
  if (!client) {
17
- node.error('No engine configured.');
17
+ node.error('No engine configured.', msg);
18
18
  return;
19
19
  }
20
20
 
21
21
  const query = RED.util.evaluateNodeProperty(config.query, config.query_type, node, msg);
22
22
 
23
23
  subscription = await client.userTasks.onUserTaskWaiting(async (userTaskWaitingNotification) => {
24
-
25
24
  const newQuery = {
26
- 'flowNodeInstanceId': userTaskWaitingNotification.flowNodeInstanceId,
27
- ...query
25
+ flowNodeInstanceId: userTaskWaitingNotification.flowNodeInstanceId,
26
+ ...query,
28
27
  };
29
28
 
30
- const matchingFlowNodes = await client.userTasks.query(newQuery, { identity: currentIdentity });
29
+ try {
30
+ const matchingFlowNodes = await client.userTasks.query(newQuery, {identity: userIdentity});
31
31
 
32
- if (matchingFlowNodes.userTasks && matchingFlowNodes.userTasks.length == 1) {
33
- // remove subscription
34
- client.userTasks.removeSubscription(subscription, currentIdentity);
35
-
36
- const userTask = matchingFlowNodes.userTasks[0];
32
+ if (matchingFlowNodes.userTasks && matchingFlowNodes.userTasks.length == 1) {
33
+ // remove subscription
34
+ client.userTasks.removeSubscription(subscription, userIdentity);
37
35
 
38
- msg.payload = { userTask: userTask };
39
- node.send(msg);
40
- } else {
41
- // nothing todo - wait for next notification
42
- }
36
+ const userTask = matchingFlowNodes.userTasks[0];
43
37
 
44
- }, { identity: currentIdentity });
38
+ msg.payload = { userTask: userTask };
39
+ node.send(msg);
40
+ } else {
41
+ // nothing todo - wait for next notification
42
+ }
43
+ } catch (error) {
44
+ node.error(error, msg);
45
+ }
46
+ },{
47
+ identity: userIdentity,
48
+ });
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
50
54
  const suspendedQuery = {
51
- 'state': 'suspended',
52
- ...query
55
+ state: 'suspended',
56
+ ...query,
53
57
  };
54
58
 
55
- const matchingFlowNodes = await client.userTasks.query(suspendedQuery, { identity: currentIdentity });
59
+ try {
60
+ const matchingFlowNodes = await client.userTasks.query(suspendedQuery, {identity: userIdentity});
56
61
 
57
- if (matchingFlowNodes.userTasks && matchingFlowNodes.userTasks.length >= 1) {
58
- const userTask = matchingFlowNodes.userTasks[0];
62
+ if (matchingFlowNodes.userTasks && matchingFlowNodes.userTasks.length >= 1) {
63
+ const userTask = matchingFlowNodes.userTasks[0];
59
64
 
60
- msg.payload = { userTask: userTask };
61
- node.send(msg);
65
+ msg.payload = { userTask: userTask };
66
+ node.send(msg);
62
67
 
63
- // remove subscription
64
- client.userTasks.removeSubscription(subscription, currentIdentity);
65
- } else {
66
- // let the *currentIdentity* be active
68
+ // remove subscription
69
+ client.userTasks.removeSubscription(subscription, userIdentity);
70
+ } else {
71
+ // let the *currentIdentity* be active
72
+ }
73
+ } catch (error) {
74
+ node.error(error, msg);
67
75
  }
68
76
  }
69
77
  };
70
78
 
71
- subscribe();
72
- });
73
-
74
- node.engine.registerOnIdentityChanged(async (identity) => {
75
-
76
- if (subscription) {
77
- client.userTasks.removeSubscription(subscription, currentIdentity);
78
- currentIdentity = identity;
79
- subscribe();
80
- } else {
81
- currentIdentity = identity;
82
- }
79
+ await subscribe();
83
80
  });
84
81
 
85
- node.on("close", async () => {
82
+ node.on('close', () => {
86
83
  if (client != null && subscription != null) {
87
- client.userTasks.removeSubscription(subscription, currentIdentity);
84
+ client.userTasks.removeSubscription(subscription);
88
85
  }
89
86
  });
90
87
  }
91
- RED.nodes.registerType("wait-for-usertask", WaitForUsertask);
92
- }
88
+ RED.nodes.registerType('wait-for-usertask', WaitForUsertask);
89
+ };
@@ -1,72 +0,0 @@
1
- name: Build and Publish
2
-
3
- on:
4
- push:
5
- branches:
6
- - '*'
7
- - '*/*'
8
-
9
- env:
10
- CI_TOOLS_VERSION: '^4.2.0'
11
- # NOTE: Um den Releasezyklus von Alpha nach Beta zu ändern, einfach die nachfolgend deklarierten Env Variablen switchen.
12
- CI_TOOLS_ALPHA_BRANCH: next
13
- CI_TOOLS_ALPHA_NPM_TAG: next
14
- CI_TOOLS_STABLE_BRANCH: main
15
- # CI_TOOLS_BETA_BRANCH: next
16
- # CI_TOOLS_BETA_NPM_TAG: next
17
- #BOX_RELEASE_TAG: 2024-1
18
-
19
- jobs:
20
- build_and_publish:
21
- name: 'Build and publish sources'
22
- runs-on: ubuntu-latest
23
- if: "!(contains(github.actor, 'process-engine-ci') || contains(github.actor, 'admin'))"
24
-
25
- steps:
26
- - uses: actions/checkout@v4
27
- with:
28
- fetch-depth: 0
29
- token: ${{ secrets.GH_TOKEN }}
30
-
31
- - name: Use Node.js 20
32
- uses: actions/setup-node@v4
33
- with:
34
- node-version: '20'
35
- registry-url: 'https://registry.npmjs.org'
36
-
37
- - name: Install CI Tools
38
- env:
39
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
40
- run: npm i -g @5minds/product_ci_tools@${{ env.CI_TOOLS_VERSION }}
41
-
42
- - name: 'Install Dependencies'
43
- env:
44
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
45
- run: npm ci
46
-
47
- - name: 'Prepare Version'
48
- if: "!startsWith(github.ref_name, 'renovate')"
49
- run: ci_tools prepare-version --allow-dirty-workdir
50
-
51
- - name: 'Commit & Tag Version'
52
- if: "!startsWith(github.ref_name, 'renovate')"
53
- env:
54
- GH_USER: ${{ secrets.GH_USER }}
55
- GH_TOKEN: ${{ secrets.GH_TOKEN }}
56
- run: |
57
- ci_tools commit-and-tag-version --only-on-primary-branches
58
- ci_tools update-github-release --only-on-primary-branches --use-title-and-text-from-git-tag
59
-
60
- - name: 'Publish Version'
61
- if: "!startsWith(github.ref_name, 'renovate')"
62
- env:
63
- NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
64
- run: ci_tools publish-npm-package --create-tag-from-branch-name
65
-
66
- # - name: Add Box-Release Tag
67
- # if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/next'
68
- # env:
69
- # NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
70
- # run: |
71
- # VERSION="$(ci_tools get-version)"
72
- # npm dist-tag add @5minds/processcube_app_sdk@$VERSION ${{ env.BOX_RELEASE_TAG }}
@@ -1,36 +0,0 @@
1
- {
2
- "issuerUrl": "http://authority:11560",
3
- "applicationPort": 11560,
4
- "development": {
5
- "builtInReactDevServer": false,
6
- "detailedErrors": true,
7
- "disableHttpsEnforcement": true,
8
- "enableLocalhostImplicit": true,
9
- "fixWrongHostnames": true
10
- },
11
- "studio": true,
12
- "engines": [
13
- {
14
- "clientId": "5minds_engine",
15
- "clientSecret": "5minds_engine"
16
- }
17
- ],
18
- "database": {
19
- "dialect": "sqlite",
20
- "storage": "storage/database.sqlite",
21
- "logging": false
22
- },
23
- "extensions": {
24
- "path": "/app/extensions",
25
- "configs": {
26
- "username_password": {}
27
- }
28
- },
29
- "externalTaskWorkers": [
30
- {
31
- "clientId": "nodered",
32
- "clientSecret": "nodered",
33
- "scope": "engine_etw engine_read engine_write"
34
- }
35
- ]
36
- }
@@ -1,12 +0,0 @@
1
- {
2
- "users": [
3
- {
4
- "username": "admin",
5
- "password": "admin",
6
- "scopes": ["openid", "profile", "email", "engine_read", "engine_write", "upe_admin"],
7
- "claims": {
8
- "email": "admin@admin.de"
9
- }
10
- }
11
- ]
12
- }
package/Dockerfile DELETED
@@ -1,9 +0,0 @@
1
- FROM nodered/node-red:4.0.2
2
-
3
- RUN npm install node-red-debugger@^1.1.1
4
-
5
- COPY ./ /src/node-red-contrib-processcube/
6
-
7
- RUN npm install /src/node-red-contrib-processcube/
8
-
9
- ENTRYPOINT ["./entrypoint.sh"]