@5minds/node-red-contrib-processcube 1.9.0 → 1.9.2-develop-932951-m8ir4yoy

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.
@@ -0,0 +1,17 @@
1
+ {
2
+ "logging": {
3
+ "outputPath": "logs",
4
+ "minLogLevel": "info"
5
+ },
6
+ "database": {
7
+ "username": "engine_user",
8
+ "password": "enigne_password",
9
+ "database": "engine_db",
10
+ "host": "postgres",
11
+ "port": 5432,
12
+ "dialect": "postgres",
13
+ "supportBigNumbers": true,
14
+ "resetPasswordRequestTimeToLive": 12,
15
+ "logging": false
16
+ }
17
+ }
@@ -429,7 +429,7 @@
429
429
  },
430
430
  "@5minds/node-red-contrib-processcube": {
431
431
  "name": "@5minds/node-red-contrib-processcube",
432
- "version": "1.9.0",
432
+ "version": "1.9.1",
433
433
  "local": false,
434
434
  "user": false,
435
435
  "nodes": {
@@ -675,15 +675,17 @@
675
675
  "911fde53bcbb7e3f",
676
676
  "15a5f64b9e2e05fc",
677
677
  "c937c772bb4b6a9d",
678
- "1b54da9f999c39fd",
679
- "a54dbeccaa680ea5",
680
678
  "664cb218bba78642",
681
679
  "17c7bb9f5f18dca0",
682
- "d56bb7cd73fd220c"
680
+ "f503048db777642f",
681
+ "7b7e536ce13ff02e",
682
+ "ee77f6e85bd2d76f",
683
+ "d289b450aca4064e",
684
+ "9a3c7f3da50bdb42"
683
685
  ],
684
- "x": 34,
686
+ "x": 14,
685
687
  "y": 79,
686
- "w": 912,
688
+ "w": 1172,
687
689
  "h": 262
688
690
  },
689
691
  {
@@ -719,14 +721,14 @@
719
721
  "engine": "42e6796dddd9d4db",
720
722
  "topic": "Test",
721
723
  "topicType": "str",
722
- "workerConfig": "{}",
724
+ "workerConfig": "{\"maxTasks\":1}",
723
725
  "workerConfigType": "json",
724
726
  "x": 110,
725
727
  "y": 180,
726
728
  "wires": [
727
729
  [
728
730
  "c937c772bb4b6a9d",
729
- "d56bb7cd73fd220c"
731
+ "d289b450aca4064e"
730
732
  ]
731
733
  ]
732
734
  },
@@ -736,7 +738,7 @@
736
738
  "z": "a23d2e782beb66f4",
737
739
  "g": "70d7a70e375b162a",
738
740
  "name": "Test Ende",
739
- "x": 620,
741
+ "x": 1100,
740
742
  "y": 180,
741
743
  "wires": []
742
744
  },
@@ -1169,93 +1171,193 @@
1169
1171
  "statusVal": "",
1170
1172
  "statusType": "auto",
1171
1173
  "x": 280,
1172
- "y": 240,
1174
+ "y": 280,
1173
1175
  "wires": []
1174
1176
  },
1175
1177
  {
1176
- "id": "1b54da9f999c39fd",
1177
- "type": "switch",
1178
+ "id": "664cb218bba78642",
1179
+ "type": "catch",
1178
1180
  "z": "a23d2e782beb66f4",
1179
1181
  "g": "70d7a70e375b162a",
1180
1182
  "name": "",
1183
+ "scope": "group",
1184
+ "uncaught": false,
1185
+ "x": 850,
1186
+ "y": 300,
1187
+ "wires": [
1188
+ [
1189
+ "17c7bb9f5f18dca0"
1190
+ ]
1191
+ ]
1192
+ },
1193
+ {
1194
+ "id": "17c7bb9f5f18dca0",
1195
+ "type": "subflow:8eb64bb58f95989d",
1196
+ "z": "a23d2e782beb66f4",
1197
+ "g": "70d7a70e375b162a",
1198
+ "name": "",
1199
+ "x": 1070,
1200
+ "y": 300,
1201
+ "wires": []
1202
+ },
1203
+ {
1204
+ "id": "d37ef0e9d22656fa",
1205
+ "type": "join",
1206
+ "z": "a23d2e782beb66f4",
1207
+ "name": "",
1208
+ "mode": "auto",
1209
+ "build": "array",
1181
1210
  "property": "payload",
1182
1211
  "propertyType": "msg",
1183
- "rules": [
1184
- {
1185
- "t": "empty"
1186
- },
1187
- {
1188
- "t": "else"
1189
- }
1190
- ],
1191
- "checkall": "true",
1192
- "repair": false,
1193
- "outputs": 2,
1194
- "x": 470,
1212
+ "key": "payload",
1213
+ "joiner": "\\n",
1214
+ "joinerType": "str",
1215
+ "useparts": false,
1216
+ "accumulate": false,
1217
+ "timeout": "",
1218
+ "count": "2",
1219
+ "reduceRight": false,
1220
+ "reduceExp": "",
1221
+ "reduceInit": "",
1222
+ "reduceInitType": "",
1223
+ "reduceFixup": "",
1224
+ "x": 750,
1195
1225
  "y": 180,
1196
1226
  "wires": [
1197
1227
  [
1198
- "911fde53bcbb7e3f"
1199
- ],
1228
+ "9a3c7f3da50bdb42"
1229
+ ]
1230
+ ]
1231
+ },
1232
+ {
1233
+ "id": "77854a01cb815c27",
1234
+ "type": "split",
1235
+ "z": "a23d2e782beb66f4",
1236
+ "name": "",
1237
+ "splt": "\\n",
1238
+ "spltType": "str",
1239
+ "arraySplt": "2",
1240
+ "arraySpltType": "len",
1241
+ "stream": false,
1242
+ "addname": "",
1243
+ "property": "payload",
1244
+ "x": 410,
1245
+ "y": 180,
1246
+ "wires": [
1200
1247
  [
1201
- "a54dbeccaa680ea5"
1248
+ "7b7e536ce13ff02e",
1249
+ "ee77f6e85bd2d76f"
1202
1250
  ]
1203
1251
  ]
1204
1252
  },
1205
1253
  {
1206
- "id": "a54dbeccaa680ea5",
1207
- "type": "function",
1254
+ "id": "7b7e536ce13ff02e",
1255
+ "type": "delay",
1208
1256
  "z": "a23d2e782beb66f4",
1209
1257
  "g": "70d7a70e375b162a",
1210
- "name": "raise Error()",
1211
- "func": "throw Error(\"hello error\");\n\nreturn msg;",
1258
+ "name": "",
1259
+ "pauseType": "delay",
1260
+ "timeout": "2",
1261
+ "timeoutUnits": "seconds",
1262
+ "rate": "1",
1263
+ "nbRateUnits": "1",
1264
+ "rateUnits": "second",
1265
+ "randomFirst": "1",
1266
+ "randomLast": "5",
1267
+ "randomUnits": "seconds",
1268
+ "drop": false,
1269
+ "allowrate": false,
1212
1270
  "outputs": 1,
1213
- "timeout": 0,
1214
- "noerr": 0,
1215
- "initialize": "",
1216
- "finalize": "",
1217
- "libs": [],
1218
- "x": 630,
1219
- "y": 240,
1271
+ "x": 580,
1272
+ "y": 160,
1220
1273
  "wires": [
1221
- []
1274
+ [
1275
+ "d37ef0e9d22656fa"
1276
+ ]
1222
1277
  ]
1223
1278
  },
1224
1279
  {
1225
- "id": "664cb218bba78642",
1226
- "type": "catch",
1280
+ "id": "ee77f6e85bd2d76f",
1281
+ "type": "delay",
1227
1282
  "z": "a23d2e782beb66f4",
1228
1283
  "g": "70d7a70e375b162a",
1229
1284
  "name": "",
1230
- "scope": "group",
1231
- "uncaught": false,
1232
- "x": 630,
1233
- "y": 300,
1285
+ "pauseType": "delay",
1286
+ "timeout": "3",
1287
+ "timeoutUnits": "seconds",
1288
+ "rate": "1",
1289
+ "nbRateUnits": "1",
1290
+ "rateUnits": "second",
1291
+ "randomFirst": "1",
1292
+ "randomLast": "5",
1293
+ "randomUnits": "seconds",
1294
+ "drop": false,
1295
+ "allowrate": false,
1296
+ "outputs": 1,
1297
+ "x": 580,
1298
+ "y": 220,
1234
1299
  "wires": [
1235
1300
  [
1236
- "17c7bb9f5f18dca0"
1301
+ "d37ef0e9d22656fa"
1237
1302
  ]
1238
1303
  ]
1239
1304
  },
1240
1305
  {
1241
- "id": "17c7bb9f5f18dca0",
1242
- "type": "subflow:8eb64bb58f95989d",
1306
+ "id": "f503048db777642f",
1307
+ "type": "inject",
1243
1308
  "z": "a23d2e782beb66f4",
1244
1309
  "g": "70d7a70e375b162a",
1245
1310
  "name": "",
1246
- "x": 830,
1247
- "y": 300,
1248
- "wires": []
1311
+ "props": [
1312
+ {
1313
+ "p": "payload"
1314
+ }
1315
+ ],
1316
+ "repeat": "",
1317
+ "crontab": "",
1318
+ "once": false,
1319
+ "onceDelay": 0.1,
1320
+ "topic": "",
1321
+ "payload": "[{\"test\":\"value\"},{\"test\":\"value\"}]",
1322
+ "payloadType": "json",
1323
+ "x": 110,
1324
+ "y": 280,
1325
+ "wires": [
1326
+ [
1327
+ "d289b450aca4064e"
1328
+ ]
1329
+ ]
1330
+ },
1331
+ {
1332
+ "id": "d289b450aca4064e",
1333
+ "type": "function",
1334
+ "z": "a23d2e782beb66f4",
1335
+ "g": "70d7a70e375b162a",
1336
+ "name": "function 1",
1337
+ "func": "msg.payload = [\n {\n \"test\": \"value\"\n },\n {\n \"test\": \"value\"\n }\n];\n\n\nreturn msg;",
1338
+ "outputs": 1,
1339
+ "timeout": 0,
1340
+ "noerr": 0,
1341
+ "initialize": "",
1342
+ "finalize": "",
1343
+ "libs": [],
1344
+ "x": 260,
1345
+ "y": 180,
1346
+ "wires": [
1347
+ [
1348
+ "77854a01cb815c27"
1349
+ ]
1350
+ ]
1249
1351
  },
1250
1352
  {
1251
- "id": "d56bb7cd73fd220c",
1353
+ "id": "9a3c7f3da50bdb42",
1252
1354
  "type": "delay",
1253
1355
  "z": "a23d2e782beb66f4",
1254
1356
  "g": "70d7a70e375b162a",
1255
1357
  "name": "",
1256
1358
  "pauseType": "delay",
1257
- "timeout": "2",
1258
- "timeoutUnits": "minutes",
1359
+ "timeout": "5",
1360
+ "timeoutUnits": "seconds",
1259
1361
  "rate": "1",
1260
1362
  "nbRateUnits": "1",
1261
1363
  "rateUnits": "second",
@@ -1265,11 +1367,11 @@
1265
1367
  "drop": false,
1266
1368
  "allowrate": false,
1267
1369
  "outputs": 1,
1268
- "x": 300,
1370
+ "x": 920,
1269
1371
  "y": 180,
1270
1372
  "wires": [
1271
1373
  [
1272
- "1b54da9f999c39fd"
1374
+ "911fde53bcbb7e3f"
1273
1375
  ]
1274
1376
  ]
1275
1377
  },
@@ -1739,7 +1841,7 @@
1739
1841
  "g": "3f3c01daebb2d215",
1740
1842
  "name": "",
1741
1843
  "engine": "42e6796dddd9d4db",
1742
- "query": "{\"flowNodeId\":\"gibt_es_nicht\"}",
1844
+ "query": "{\"state\":\"suspended\"}",
1743
1845
  "query_type": "json",
1744
1846
  "sendtype": "array",
1745
1847
  "x": 300,
@@ -2586,6 +2688,7 @@
2586
2688
  "id": "930624edc6169c55",
2587
2689
  "type": "process-event-listener",
2588
2690
  "z": "76c047e0d8770a20",
2691
+ "d": true,
2589
2692
  "name": "",
2590
2693
  "engine": "42e6796dddd9d4db",
2591
2694
  "processmodel": "External-Task-Sample_Process",
@@ -2630,6 +2733,7 @@
2630
2733
  "id": "798de686e9cec9e3",
2631
2734
  "type": "process-event-listener",
2632
2735
  "z": "76c047e0d8770a20",
2736
+ "d": true,
2633
2737
  "name": "deployed",
2634
2738
  "engine": "42e6796dddd9d4db",
2635
2739
  "processmodel": "",
@@ -2664,6 +2768,7 @@
2664
2768
  "id": "78dd82dbc5fe824e",
2665
2769
  "type": "process-event-listener",
2666
2770
  "z": "76c047e0d8770a20",
2771
+ "d": true,
2667
2772
  "name": "undeployed",
2668
2773
  "engine": "42e6796dddd9d4db",
2669
2774
  "processmodel": "",
@@ -2698,6 +2803,7 @@
2698
2803
  "id": "6b1eeb91a71c7bcb",
2699
2804
  "type": "process-event-listener",
2700
2805
  "z": "76c047e0d8770a20",
2806
+ "d": true,
2701
2807
  "name": "is-exeutable-changed",
2702
2808
  "engine": "42e6796dddd9d4db",
2703
2809
  "processmodel": "",
package/Dockerfile CHANGED
@@ -5,12 +5,15 @@ FROM nodered/node-red:4.0.8-22
5
5
  # package
6
6
  USER root
7
7
 
8
+ RUN npm i node-red-debugger
9
+
8
10
  COPY ./ /package_src/
9
11
  RUN cd /package_src/ && npm install
10
12
 
11
13
 
12
14
  RUN npm install /package_src/
13
15
 
16
+
14
17
  # defaults
15
18
  USER node-red
16
19
 
@@ -32,8 +32,10 @@ services:
32
32
  ports:
33
33
  - 8000:8000
34
34
  volumes:
35
+ - ./.processcube/engine/config/config.json:/etc/engine/config/config.json:ro
35
36
  - ./processes:/processes:ro
36
37
  environment:
38
+ CONFIG_PATH: /etc/engine/config/config.json
37
39
  application__name: Engine for Node-RED contrib
38
40
  iam__baseUrl: http://authority:11560
39
41
  iam__allowAnonymousRootAccess: true
@@ -45,6 +47,26 @@ services:
45
47
  timeout: 1s
46
48
  retries: 20
47
49
 
50
+ postgres:
51
+ image: postgres
52
+ environment:
53
+ POSTGRES_USER: ${POSTGRES_USER:-postgres}
54
+ POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
55
+ POSTGRES_DB: enginedb
56
+ PGDATA: /data/postgres/db
57
+ volumes:
58
+ - ./postgres/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
59
+ - ./postgres/db.instance:/data/postgres
60
+ ports:
61
+ - 5432:5432
62
+ healthcheck:
63
+ test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres}"]
64
+ interval: 5s
65
+ retries: 10
66
+ timeout: 10s
67
+ restart: unless-stopped
68
+
69
+
48
70
  authority:
49
71
  image: 5minds/processcube_authority:3.0.4
50
72
  ports:
@@ -19,6 +19,7 @@ module.exports = function (RED) {
19
19
  node._trace = '';
20
20
  node._step = '';
21
21
  node._tracking_nodes = {};
22
+ node._join_inputs = {};
22
23
  node._tracking_for_etw = {};
23
24
 
24
25
  node.isHandling = () => {
@@ -50,6 +51,20 @@ module.exports = function (RED) {
50
51
  } else {
51
52
  node._tracking_nodes[theNode.id].count++;
52
53
  }
54
+
55
+ // bei nodes vom type 'join' müssen die eingänge gezählt werden,
56
+ // dass diese dann wieder beim verlassen am ausgang gesamt entfernt werden müssem
57
+ if (theNode.type === 'join') {
58
+ if (!node._join_inputs[theNode.id]) {
59
+ node._join_inputs[theNode.id] = {};
60
+ }
61
+
62
+ if (!node._join_inputs[theNode.id][msg.flowNodeInstanceId]) {
63
+ node._join_inputs[theNode.id][msg.flowNodeInstanceId] = 1;
64
+ } else {
65
+ node._join_inputs[theNode.id][msg.flowNodeInstanceId]++;
66
+ }
67
+ }
53
68
 
54
69
  if (!node._tracking_for_etw[msg.flowNodeInstanceId]) {
55
70
  node._tracking_for_etw[msg.flowNodeInstanceId] = [];
@@ -58,7 +73,9 @@ module.exports = function (RED) {
58
73
  node._tracking_for_etw[msg.flowNodeInstanceId].push(theNode);
59
74
  }
60
75
 
61
- theNode.status({ fill: 'blue', shape: 'dot', text: `tasks(${node._tracking_nodes[theNode.id].count})` });
76
+ if (!theNode.type === 'delay') {
77
+ theNode.status({ fill: 'blue', shape: 'dot', text: `tasks(${node._tracking_nodes[theNode.id].count})` });
78
+ }
62
79
  };
63
80
 
64
81
  node.decrMsgOnNode = (theNode, msg) => {
@@ -66,13 +83,29 @@ module.exports = function (RED) {
66
83
  return;
67
84
  }
68
85
 
86
+ // bei nodes vom type 'join' müssen die eingänge gezählt werden,
87
+ // dass diese dann wieder beim verlassen am ausgang gesamt entfernt werden müssen
88
+ let dec_count = 1;
89
+
90
+ if (theNode.type === 'join') {
91
+ if (!node._join_inputs[theNode.id]) {
92
+ node._join_inputs[theNode.id] = {};
93
+ }
94
+
95
+ if (node._join_inputs[theNode.id][msg.flowNodeInstanceId]) {
96
+ dec_count = node._join_inputs[theNode.id][msg.flowNodeInstanceId];
97
+ delete node._join_inputs[theNode.id][msg.flowNodeInstanceId];
98
+ }
99
+ }
100
+
69
101
  if (!node._tracking_nodes[theNode.id]) {
70
102
  node._tracking_nodes[theNode.id] = {
71
103
  node: theNode,
72
104
  count: 0,
73
105
  };
74
106
  } else {
75
- node._tracking_nodes[theNode.id].count--;
107
+ //node._tracking_nodes[theNode.id].count--;
108
+ node._tracking_nodes[theNode.id].count =- dec_count;
76
109
 
77
110
  if (node._tracking_nodes[theNode.id].count <= 0) {
78
111
  node._tracking_nodes[theNode.id].count = 0;
@@ -80,14 +113,16 @@ module.exports = function (RED) {
80
113
  }
81
114
 
82
115
  if (node._tracking_for_etw[msg.flowNodeInstanceId]) {
83
- node._tracking_for_etw[msg.flowNodeInstanceId] = node._tracking_for_etw[msg.flowNodeInstanceId].filter(item => item !== theNode)
116
+ const count_nodes = node._tracking_for_etw[msg.flowNodeInstanceId].filter(item => item !== theNode)
84
117
 
85
- if (node._tracking_for_etw[msg.flowNodeInstanceId].count <= 0) {
118
+ if (count_nodes <= 0) {
86
119
  delete node._tracking_for_etw[msg.flowNodeInstanceId];
87
120
  }
88
121
  }
89
122
 
90
- theNode.status({ fill: 'blue', shape: 'dot', text: `tasks(${node._tracking_nodes[theNode.id].count})` });
123
+ if (!theNode.type === 'delay') {
124
+ theNode.status({ fill: 'blue', shape: 'dot', text: `tasks(${node._tracking_nodes[theNode.id].count})` });
125
+ }
91
126
  };
92
127
 
93
128
  RED.hooks.add('preDeliver', (sendEvent) => {
@@ -131,9 +166,11 @@ module.exports = function (RED) {
131
166
  node.setUnsubscribedStatus = (error) => {
132
167
  this._subscribed = false;
133
168
  this._subscribed_error = error;
169
+
170
+ const info = `subscription failed (topic: ${node.topic}) [error: ${error?.message}].`;
134
171
 
135
- this.error(`subscription failed (topic: ${node.topic}).`);
136
- RED.log.error(`topic: ${node.topic} (${error?.message}).`);
172
+ this.error(info);
173
+ RED.log.error(info);
137
174
 
138
175
  this.showStatus();
139
176
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@5minds/node-red-contrib-processcube",
3
- "version": "1.9.0",
3
+ "version": "1.9.2-develop-932951-m8ir4yoy",
4
4
  "license": "MIT",
5
5
  "description": "Node-RED nodes for ProcessCube",
6
6
  "scripts": {
@@ -0,0 +1,13 @@
1
+ CREATE USER engine_user with password 'enigne_password';
2
+ CREATE DATABASE engine_db;
3
+ GRANT ALL PRIVILEGES ON DATABASE engine_db TO engine_user;
4
+
5
+ \connect engine_db;
6
+
7
+ -- Berechtigungen erteilen
8
+ GRANT CREATE ON SCHEMA public TO engine_user;
9
+
10
+ -- Eigentümer des Schemas ändern
11
+ ALTER SCHEMA public OWNER TO engine_user;
12
+
13
+