@5minds/node-red-contrib-processcube 1.5.3 → 1.5.5-develop-08b6df-m3hqaxvp

Sign up to get free protection for your applications and to get access to all the features.
@@ -20,7 +20,9 @@ module.exports = function (RED) {
20
20
  });
21
21
  },
22
22
  { identity: currentIdentity },
23
- );
23
+ ).catch((error) => {
24
+ node.error(error);
25
+ });
24
26
 
25
27
  node.engine.registerOnIdentityChanged(async (identity) => {
26
28
  client.events.removeSubscription(subscription, currentIdentity);
@@ -34,7 +36,12 @@ module.exports = function (RED) {
34
36
  });
35
37
  },
36
38
  { identity: currentIdentity },
37
- );
39
+ ).catch((error) => {
40
+ node.error(error);
41
+ });
42
+
43
+ }).catch((error) => {
44
+ node.error(error);
38
45
  });
39
46
 
40
47
  node.on('close', async () => {
@@ -479,6 +479,17 @@
479
479
  "name": "Engine Auth 8000",
480
480
  "url": "http://engine:8000"
481
481
  },
482
+ {
483
+ "id": "392373f3e1403770",
484
+ "type": "processcube-engine-config",
485
+ "name": "",
486
+ "url": "http://host.docker.internal:56000",
487
+ "urlType": "str",
488
+ "clientId": "",
489
+ "clientIdType": "str",
490
+ "clientSecret": "",
491
+ "clientSecretType": "str"
492
+ },
482
493
  {
483
494
  "id": "2991a5e6df2b87d2",
484
495
  "type": "externaltask-input",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@5minds/node-red-contrib-processcube",
3
- "version": "1.5.3",
3
+ "version": "1.5.5-develop-08b6df-m3hqaxvp",
4
4
  "license": "MIT",
5
5
  "description": "Node-RED nodes for ProcessCube",
6
6
  "scripts": {
@@ -54,7 +54,9 @@ module.exports = function (RED) {
54
54
  }
55
55
  },
56
56
  { identity: currentIdentity }
57
- );
57
+ ).catch((error) => {
58
+ node.error(error);
59
+ });
58
60
  case 'started':
59
61
  return await client.notification.onProcessStarted(
60
62
  async (processNotification) => {
@@ -70,6 +72,8 @@ module.exports = function (RED) {
70
72
 
71
73
  const matchingInstances = await client.processInstances.query(newQuery, {
72
74
  identity: currentIdentity,
75
+ }).catch((error) => {
76
+ node.error(error);
73
77
  });
74
78
 
75
79
  if (
@@ -91,7 +95,9 @@ module.exports = function (RED) {
91
95
  }
92
96
  },
93
97
  { identity: currentIdentity }
94
- );
98
+ ).catch((error) => {
99
+ node.error(error);
100
+ });
95
101
  case 'resumed':
96
102
  return await client.notification.onProcessResumed(
97
103
  async (processNotification) => {
@@ -108,6 +114,8 @@ module.exports = function (RED) {
108
114
 
109
115
  const matchingInstances = await client.processInstances.query(newQuery, {
110
116
  identity: currentIdentity,
117
+ }).catch((error) => {
118
+ node.error(error);
111
119
  });
112
120
 
113
121
  if (
@@ -128,7 +136,9 @@ module.exports = function (RED) {
128
136
  }
129
137
  },
130
138
  { identity: currentIdentity }
131
- );
139
+ ).catch((error) => {
140
+ node.error(error);
141
+ });
132
142
  case 'finished':
133
143
  return await client.notification.onProcessEnded(
134
144
  async (processNotification) => {
@@ -145,6 +155,8 @@ module.exports = function (RED) {
145
155
 
146
156
  const matchingInstances = await client.processInstances.query(newQuery, {
147
157
  identity: currentIdentity,
158
+ }).catch((error) => {
159
+ node.error(error);
148
160
  });
149
161
 
150
162
  if (
@@ -166,7 +178,9 @@ module.exports = function (RED) {
166
178
  }
167
179
  },
168
180
  { identity: currentIdentity }
169
- );
181
+ ).catch((error) => {
182
+ node.error(error);
183
+ });
170
184
  case 'terminated':
171
185
  return await client.notification.onProcessTerminated(
172
186
  async (processNotification) => {
@@ -183,6 +197,8 @@ module.exports = function (RED) {
183
197
 
184
198
  const matchingInstances = await client.processInstances.query(newQuery, {
185
199
  identity: currentIdentity,
200
+ }).catch((error) => {
201
+ node.error(error);
186
202
  });
187
203
 
188
204
  if (
@@ -203,7 +219,9 @@ module.exports = function (RED) {
203
219
  }
204
220
  },
205
221
  { identity: currentIdentity }
206
- );
222
+ ).catch((error) => {
223
+ node.error(error);
224
+ });
207
225
  case 'error':
208
226
  return await client.notification.onProcessError(
209
227
  async (processNotification) => {
@@ -220,6 +238,8 @@ module.exports = function (RED) {
220
238
 
221
239
  const matchingInstances = await client.processInstances.query(newQuery, {
222
240
  identity: currentIdentity,
241
+ }).catch((error) => {
242
+ node.error(error);
223
243
  });
224
244
 
225
245
  if (
@@ -240,7 +260,9 @@ module.exports = function (RED) {
240
260
  }
241
261
  },
242
262
  { identity: currentIdentity }
243
- );
263
+ ).catch((error) => {
264
+ node.error(error);
265
+ });
244
266
  case 'owner-changed':
245
267
  return await client.notification.onProcessOwnerChanged(
246
268
  async (processNotification) => {
@@ -257,6 +279,8 @@ module.exports = function (RED) {
257
279
 
258
280
  const matchingInstances = await client.processInstances.query(newQuery, {
259
281
  identity: currentIdentity,
282
+ }).catch((error) => {
283
+ node.error(error);
260
284
  });
261
285
 
262
286
  if (
@@ -276,7 +300,9 @@ module.exports = function (RED) {
276
300
  }
277
301
  },
278
302
  { identity: currentIdentity }
279
- );
303
+ ).catch((error) => {
304
+ node.error(error);
305
+ });
280
306
  case 'instances-deleted':
281
307
  return await client.notification.onProcessInstancesDeleted(
282
308
  async (processNotification) => {
@@ -293,6 +319,8 @@ module.exports = function (RED) {
293
319
 
294
320
  const matchingInstances = await client.processInstances.query(newQuery, {
295
321
  identity: currentIdentity,
322
+ }).catch((error) => {
323
+ node.error(error);
296
324
  });
297
325
 
298
326
  if (
@@ -312,7 +340,9 @@ module.exports = function (RED) {
312
340
  }
313
341
  },
314
342
  { identity: currentIdentity }
315
- );
343
+ ).catch((error) => {
344
+ node.error(error);
345
+ });
316
346
  case 'is-executable-changed':
317
347
  return await client.notification.onProcessIsExecutableChanged(
318
348
  (processNotification) => {
@@ -330,7 +360,9 @@ module.exports = function (RED) {
330
360
  });
331
361
  },
332
362
  { identity: currentIdentity }
333
- );
363
+ ).catch((error) => {
364
+ node.error(error);
365
+ });
334
366
  case 'deployed':
335
367
  return await client.notification.onProcessDeployed(
336
368
  (processNotification) => {
@@ -348,7 +380,9 @@ module.exports = function (RED) {
348
380
  });
349
381
  },
350
382
  { identity: currentIdentity }
351
- );
383
+ ).catch((error) => {
384
+ node.error(error);
385
+ });
352
386
  case 'undeployed':
353
387
  return await client.notification.onProcessUndeployed(
354
388
  (processNotification) => {
@@ -366,7 +400,9 @@ module.exports = function (RED) {
366
400
  });
367
401
  },
368
402
  { identity: currentIdentity }
369
- );
403
+ ).catch((error) => {
404
+ node.error(error);
405
+ });
370
406
  default:
371
407
  console.error('no such event: ' + eventType);
372
408
  break;
@@ -399,7 +435,10 @@ module.exports = function (RED) {
399
435
  });
400
436
  },
401
437
  { identity: currentIdentity }
402
- );
438
+ ).catch((error) => {
439
+ node.error(error);
440
+ });
441
+
403
442
  });
404
443
 
405
444
  node.on('close', () => {
@@ -17,9 +17,10 @@ module.exports = function (RED) {
17
17
 
18
18
  query = {
19
19
  ...query,
20
- identity: engine.identity,
20
+ identity: undefined,
21
21
  };
22
22
 
23
+ node.log(`Querying process definitions with query: ${JSON.stringify(query)}`);
23
24
  client.processDefinitions.getAll(query).then((matchingProcessDefinitions) => {
24
25
 
25
26
  if (config.models_only && matchingProcessDefinitions.totalCount > 0) {
@@ -40,6 +41,8 @@ module.exports = function (RED) {
40
41
  }
41
42
 
42
43
  node.send(msg);
44
+ }).catch((error) => {
45
+ node.error(error);
43
46
  });
44
47
  });
45
48
  }
@@ -50,18 +50,26 @@ module.exports = function (RED) {
50
50
  case 'new':
51
51
  return await client.userTasks.onUserTaskWaiting(userTaskCallback(), {
52
52
  identity: currentIdentity,
53
+ }).catch((error) => {
54
+ node.error(error);
53
55
  });
54
56
  case 'finished':
55
57
  return await client.userTasks.onUserTaskFinished(userTaskCallback(), {
56
58
  identity: currentIdentity,
59
+ }).catch((error) => {
60
+ node.error(error);
57
61
  });
58
62
  case 'reserved':
59
63
  return await client.userTasks.onUserTaskReserved(userTaskCallback(), {
60
64
  identity: currentIdentity,
65
+ }).catch((error) => {
66
+ node.error(error);
61
67
  });
62
68
  case 'reservation-canceled':
63
69
  return await client.userTasks.onUserTaskReservationCanceled(userTaskCallback(), {
64
70
  identity: currentIdentity,
71
+ }).catch((error) => {
72
+ node.error(error);
65
73
  });
66
74
  default:
67
75
  console.error('no such event: ' + config.eventtype);
@@ -79,7 +87,7 @@ module.exports = function (RED) {
79
87
  currentIdentity = identity;
80
88
 
81
89
  subscription = subscribe();
82
- });
90
+ })
83
91
 
84
92
  node.on('close', async () => {
85
93
  if (node.engine && node.engine.engineClient && client) {