@5minds/node-red-contrib-processcube 0.15.0 → 1.0.0-feature-b9c700-lz1po3cl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. package/Dockerfile +2 -0
  2. package/endevent-finished-listener.html +50 -0
  3. package/endevent-finished-listener.js +52 -0
  4. package/examples/Definition-Query-Sample.json +215 -0
  5. package/examples/External-Task-Sample.json +142 -1
  6. package/examples/Instance-Query-Sample.json +110 -0
  7. package/examples/User-Task-Sample.json +231 -0
  8. package/externaltask-error.html +11 -11
  9. package/externaltask-input.html +12 -12
  10. package/externaltask-input.js +10 -5
  11. package/externaltask-output.html +7 -7
  12. package/message-event-trigger.html +14 -2
  13. package/message-event-trigger.js +10 -9
  14. package/nodered/node-red-contrib-processcube-flows.json +364 -20
  15. package/nodered/settings.js +2 -1
  16. package/nodered/static/ProcessCube_Logo.svg +53 -0
  17. package/package.json +2 -1
  18. package/process-start.html +16 -13
  19. package/process-start.js +13 -8
  20. package/processcube-engine-config.html +16 -0
  21. package/processcube-engine-config.js +9 -13
  22. package/processdefinition-query.html +16 -2
  23. package/processdefinition-query.js +10 -21
  24. package/processes/User-Task-Sample.bpmn +57 -0
  25. package/processinstance-query.html +13 -2
  26. package/processinstance-query.js +9 -23
  27. package/signal-event-trigger.html +14 -2
  28. package/signal-event-trigger.js +9 -8
  29. package/usertask-finished-listener.html +15 -14
  30. package/usertask-finished-listener.js +16 -22
  31. package/usertask-input.html +15 -2
  32. package/usertask-input.js +18 -41
  33. package/usertask-new-listener.html +15 -14
  34. package/usertask-new-listener.js +18 -24
  35. package/usertask-output.html +13 -2
  36. package/usertask-output.js +10 -19
  37. package/processes/GetProcessModels.bpmn +0 -58
  38. package/processes/HelloWorld.bpmn +0 -124
package/Dockerfile CHANGED
@@ -12,6 +12,8 @@ WORKDIR /data
12
12
 
13
13
  COPY --from=builder /src/node-red-contrib-processcube /src/node-red-contrib-processcube
14
14
 
15
+ COPY nodered/static/ProcessCube_Logo.svg /data/static/ProcessCube_Logo.svg
16
+
15
17
  COPY nodered/package.json package.json
16
18
  RUN npm install
17
19
 
@@ -0,0 +1,50 @@
1
+ <script type="text/javascript">
2
+ RED.nodes.registerType('endevent-finished-listener', {
3
+ category: 'ProcessCube Events',
4
+ color: '#02AFD6',
5
+ defaults: {
6
+ name: { value: '' },
7
+ engine: { value: '', type: 'processcube-engine-config' }
8
+ },
9
+ inputs: 0,
10
+ outputs: 1,
11
+ icon: 'font-awesome/fa-envelope',
12
+ label: function () {
13
+ return this.name || 'endevent-finished-listener';
14
+ },
15
+ });
16
+ </script>
17
+
18
+ <script type="text/html" data-template-name="endevent-finished-listener">
19
+ <div class="form-row">
20
+ <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
21
+ <input type="text" id="node-input-name" placeholder="Name" />
22
+ </div>
23
+ <div class="form-row">
24
+ <label for="node-input-engine"><i class="fa fa-tag"></i> Engine-URL</label>
25
+ <input type="text" id="node-input-engine" placeholder="http://engine:8000" />
26
+ </div>
27
+ </script>
28
+
29
+ <script type="text/markdown" data-help-name="endevent-finished-listener">
30
+ Waiting for end events that are finished.
31
+
32
+ ## Outputs
33
+
34
+ : correlationId (string): The unique identifier for the correlation.
35
+ : processDefinitionId (string): The identifier for the process definition.
36
+ : processModelId (string): The identifier for the process model.
37
+ : processModelName (string): The name of the process model.
38
+ : processInstanceId (string): The unique identifier for the process instance.
39
+ : flowNodeId (string): The identifier for the flow node.
40
+ : flowNodeName (string): The name of the flow node.
41
+ : flowNodeInstanceId (string): The unique identifier for the flow node instance.
42
+ : previousFlowNodeInstanceId (string): The unique identifier for the previous flow node instance.
43
+ : ownerId (string): The identifier of the owner.
44
+ : currentToken (Object): An object representing the current token.
45
+
46
+ ### References
47
+
48
+ - [The ProcessCube Developer Network](https://processcube.io) - All documentation for the ProcessCube&copy; Plattform
49
+ - [Node-RED Integration in ProcessCube&copy;](https://processcube.io/docs/node-red) - Node-RED Integration in ProcessCube&copy;
50
+ </script>
@@ -0,0 +1,52 @@
1
+ module.exports = function (RED) {
2
+ function EndEventFinishedListener(config) {
3
+ RED.nodes.createNode(this, config);
4
+ var node = this;
5
+ node.engine = RED.nodes.getNode(config.engine);
6
+
7
+ const register = async () => {
8
+ const client = node.engine.engineClient;
9
+
10
+ if (!client) {
11
+ node.error('No engine configured.');
12
+ return;
13
+ }
14
+
15
+ let currentIdentity = node.engine.identity;
16
+ let subscription = await client.events.onEndEventFinished(
17
+ (endEventFinished) => {
18
+ node.send({
19
+ payload: endEventFinished,
20
+ });
21
+ },
22
+ { identity: currentIdentity },
23
+ );
24
+
25
+ node.engine.registerOnIdentityChanged(async (identity) => {
26
+ client.events.removeSubscription(subscription, currentIdentity);
27
+
28
+ currentIdentity = identity;
29
+
30
+ subscription = await client.events.onEndEventFinished(
31
+ (endEventFinished) => {
32
+ node.send({
33
+ payload: endEventFinished
34
+ });
35
+ },
36
+ { identity: currentIdentity },
37
+ );
38
+ });
39
+
40
+ node.on('close', async () => {
41
+ if (node.engine && node.engine.engineClient && client) {
42
+ client.events.removeSubscription(subscription, currentIdentity);
43
+ }
44
+ });
45
+ };
46
+
47
+ if (node.engine) {
48
+ register();
49
+ }
50
+ }
51
+ RED.nodes.registerType('endevent-finished-listener', EndEventFinishedListener);
52
+ };
@@ -0,0 +1,215 @@
1
+ [
2
+ {
3
+ "id": "f28ae6aa3a05069e",
4
+ "type": "tab",
5
+ "label": "Definition Query Sample",
6
+ "disabled": false,
7
+ "info": "",
8
+ "env": []
9
+ },
10
+ {
11
+ "id": "4c59118134081e05",
12
+ "type": "group",
13
+ "z": "f28ae6aa3a05069e",
14
+ "style": {
15
+ "stroke": "#999999",
16
+ "stroke-opacity": "1",
17
+ "fill": "none",
18
+ "fill-opacity": "1",
19
+ "label": true,
20
+ "label-position": "nw",
21
+ "color": "#a4a4a4"
22
+ },
23
+ "nodes": [
24
+ "d97caca0ec54a633",
25
+ "f74139117c9dab27",
26
+ "5539a5c4c0f9cbe2",
27
+ "a8e2b5a6ca25c924"
28
+ ],
29
+ "x": 14,
30
+ "y": 39,
31
+ "w": 592,
32
+ "h": 142
33
+ },
34
+ {
35
+ "id": "f1d4eaed7570324e",
36
+ "type": "group",
37
+ "z": "f28ae6aa3a05069e",
38
+ "style": {
39
+ "stroke": "#999999",
40
+ "stroke-opacity": "1",
41
+ "fill": "none",
42
+ "fill-opacity": "1",
43
+ "label": true,
44
+ "label-position": "nw",
45
+ "color": "#a4a4a4"
46
+ },
47
+ "nodes": [
48
+ "bcc97a73cff5a086",
49
+ "b418463be836efbb",
50
+ "0633b709dd9c166f",
51
+ "fbb37831549d41ff"
52
+ ],
53
+ "x": 14,
54
+ "y": 219,
55
+ "w": 572,
56
+ "h": 142
57
+ },
58
+ {
59
+ "id": "d97caca0ec54a633",
60
+ "type": "processdefinition-query",
61
+ "z": "f28ae6aa3a05069e",
62
+ "g": "4c59118134081e05",
63
+ "name": "Query definitions",
64
+ "engine": "42e6796dddd9d4db",
65
+ "query": "{\"includeXml\":false}",
66
+ "query_type": "json",
67
+ "models_only": false,
68
+ "x": 310,
69
+ "y": 140,
70
+ "wires": [
71
+ [
72
+ "5539a5c4c0f9cbe2"
73
+ ]
74
+ ]
75
+ },
76
+ {
77
+ "id": "f74139117c9dab27",
78
+ "type": "inject",
79
+ "z": "f28ae6aa3a05069e",
80
+ "g": "4c59118134081e05",
81
+ "name": "",
82
+ "props": [
83
+ {
84
+ "p": "payload"
85
+ },
86
+ {
87
+ "p": "topic",
88
+ "vt": "str"
89
+ }
90
+ ],
91
+ "repeat": "",
92
+ "crontab": "",
93
+ "once": false,
94
+ "onceDelay": 0.1,
95
+ "topic": "",
96
+ "payload": "",
97
+ "payloadType": "date",
98
+ "x": 120,
99
+ "y": 140,
100
+ "wires": [
101
+ [
102
+ "d97caca0ec54a633"
103
+ ]
104
+ ]
105
+ },
106
+ {
107
+ "id": "5539a5c4c0f9cbe2",
108
+ "type": "debug",
109
+ "z": "f28ae6aa3a05069e",
110
+ "g": "4c59118134081e05",
111
+ "name": "debug 26",
112
+ "active": true,
113
+ "tosidebar": true,
114
+ "console": false,
115
+ "tostatus": false,
116
+ "complete": "false",
117
+ "statusVal": "",
118
+ "statusType": "auto",
119
+ "x": 500,
120
+ "y": 140,
121
+ "wires": []
122
+ },
123
+ {
124
+ "id": "bcc97a73cff5a086",
125
+ "type": "processdefinition-query",
126
+ "z": "f28ae6aa3a05069e",
127
+ "g": "f1d4eaed7570324e",
128
+ "name": "Query models",
129
+ "engine": "42e6796dddd9d4db",
130
+ "query": "{\"includeXml\":false}",
131
+ "query_type": "json",
132
+ "models_only": true,
133
+ "x": 300,
134
+ "y": 320,
135
+ "wires": [
136
+ [
137
+ "0633b709dd9c166f"
138
+ ]
139
+ ]
140
+ },
141
+ {
142
+ "id": "b418463be836efbb",
143
+ "type": "inject",
144
+ "z": "f28ae6aa3a05069e",
145
+ "g": "f1d4eaed7570324e",
146
+ "name": "",
147
+ "props": [
148
+ {
149
+ "p": "payload"
150
+ },
151
+ {
152
+ "p": "topic",
153
+ "vt": "str"
154
+ }
155
+ ],
156
+ "repeat": "",
157
+ "crontab": "",
158
+ "once": false,
159
+ "onceDelay": 0.1,
160
+ "topic": "",
161
+ "payload": "",
162
+ "payloadType": "date",
163
+ "x": 120,
164
+ "y": 320,
165
+ "wires": [
166
+ [
167
+ "bcc97a73cff5a086"
168
+ ]
169
+ ]
170
+ },
171
+ {
172
+ "id": "0633b709dd9c166f",
173
+ "type": "debug",
174
+ "z": "f28ae6aa3a05069e",
175
+ "g": "f1d4eaed7570324e",
176
+ "name": "debug 27",
177
+ "active": true,
178
+ "tosidebar": true,
179
+ "console": false,
180
+ "tostatus": false,
181
+ "complete": "false",
182
+ "statusVal": "",
183
+ "statusType": "auto",
184
+ "x": 480,
185
+ "y": 320,
186
+ "wires": []
187
+ },
188
+ {
189
+ "id": "a8e2b5a6ca25c924",
190
+ "type": "comment",
191
+ "z": "f28ae6aa3a05069e",
192
+ "g": "4c59118134081e05",
193
+ "name": "Definitions",
194
+ "info": "",
195
+ "x": 100,
196
+ "y": 80,
197
+ "wires": []
198
+ },
199
+ {
200
+ "id": "fbb37831549d41ff",
201
+ "type": "comment",
202
+ "z": "f28ae6aa3a05069e",
203
+ "g": "f1d4eaed7570324e",
204
+ "name": "Models",
205
+ "info": "",
206
+ "x": 90,
207
+ "y": 260,
208
+ "wires": []
209
+ },
210
+ {
211
+ "id": "42e6796dddd9d4db",
212
+ "type": "processcube-engine-config",
213
+ "url": "http://engine:8000"
214
+ }
215
+ ]
@@ -58,6 +58,32 @@
58
58
  "w": 812,
59
59
  "h": 202
60
60
  },
61
+ {
62
+ "id": "390ad4a596a3c002",
63
+ "type": "group",
64
+ "z": "a23d2e782beb66f4",
65
+ "style": {
66
+ "stroke": "#999999",
67
+ "stroke-opacity": "1",
68
+ "fill": "none",
69
+ "fill-opacity": "1",
70
+ "label": true,
71
+ "label-position": "nw",
72
+ "color": "#a4a4a4"
73
+ },
74
+ "nodes": [
75
+ "529b24c862f7039d",
76
+ "f4011d6a57c6e13f",
77
+ "fba605329413c78d",
78
+ "5e5394e458d1de7c",
79
+ "18e9e15ef645a908",
80
+ "eb96f3128ece1be8"
81
+ ],
82
+ "x": 34,
83
+ "y": 499,
84
+ "w": 832,
85
+ "h": 202
86
+ },
61
87
  {
62
88
  "id": "2991a5e6df2b87d2",
63
89
  "type": "externaltask-input",
@@ -174,7 +200,7 @@
174
200
  "z": "a23d2e782beb66f4",
175
201
  "g": "31cb6729aac0ba46",
176
202
  "name": "raise Error",
177
- "func": "throw Error(\"hello error\");\n\nreturn msg;",
203
+ "func": "//throw Error(\"hello error\");\n\nreturn msg;",
178
204
  "outputs": 1,
179
205
  "timeout": 0,
180
206
  "noerr": 0,
@@ -244,6 +270,121 @@
244
270
  "y": 40,
245
271
  "wires": []
246
272
  },
273
+ {
274
+ "id": "529b24c862f7039d",
275
+ "type": "endevent-finished-listener",
276
+ "z": "a23d2e782beb66f4",
277
+ "d": true,
278
+ "g": "390ad4a596a3c002",
279
+ "name": "",
280
+ "engine": "42e6796dddd9d4db",
281
+ "x": 170,
282
+ "y": 600,
283
+ "wires": [
284
+ [
285
+ "f4011d6a57c6e13f"
286
+ ]
287
+ ]
288
+ },
289
+ {
290
+ "id": "f4011d6a57c6e13f",
291
+ "type": "delay",
292
+ "z": "a23d2e782beb66f4",
293
+ "g": "390ad4a596a3c002",
294
+ "name": "",
295
+ "pauseType": "delay",
296
+ "timeout": "5",
297
+ "timeoutUnits": "seconds",
298
+ "rate": "1",
299
+ "nbRateUnits": "1",
300
+ "rateUnits": "second",
301
+ "randomFirst": "1",
302
+ "randomLast": "5",
303
+ "randomUnits": "seconds",
304
+ "drop": false,
305
+ "allowrate": false,
306
+ "outputs": 1,
307
+ "x": 400,
308
+ "y": 600,
309
+ "wires": [
310
+ [
311
+ "18e9e15ef645a908"
312
+ ]
313
+ ]
314
+ },
315
+ {
316
+ "id": "fba605329413c78d",
317
+ "type": "process-start",
318
+ "z": "a23d2e782beb66f4",
319
+ "g": "390ad4a596a3c002",
320
+ "name": "",
321
+ "engine": "42e6796dddd9d4db",
322
+ "processmodel": "External-Task-Sample_Process",
323
+ "startevent": "StartEvent_1",
324
+ "x": 770,
325
+ "y": 600,
326
+ "wires": [
327
+ []
328
+ ]
329
+ },
330
+ {
331
+ "id": "5e5394e458d1de7c",
332
+ "type": "inject",
333
+ "z": "a23d2e782beb66f4",
334
+ "g": "390ad4a596a3c002",
335
+ "name": "",
336
+ "props": [
337
+ {
338
+ "p": "payload"
339
+ }
340
+ ],
341
+ "repeat": "",
342
+ "crontab": "",
343
+ "once": false,
344
+ "onceDelay": 0.1,
345
+ "topic": "",
346
+ "payload": "start",
347
+ "payloadType": "str",
348
+ "x": 430,
349
+ "y": 660,
350
+ "wires": [
351
+ [
352
+ "18e9e15ef645a908"
353
+ ]
354
+ ]
355
+ },
356
+ {
357
+ "id": "18e9e15ef645a908",
358
+ "type": "function",
359
+ "z": "a23d2e782beb66f4",
360
+ "g": "390ad4a596a3c002",
361
+ "name": "pre payload",
362
+ "func": "msg.payload = {\n \"hello\": \"world\"\n};\n\nreturn msg;",
363
+ "outputs": 1,
364
+ "timeout": 0,
365
+ "noerr": 0,
366
+ "initialize": "",
367
+ "finalize": "",
368
+ "libs": [],
369
+ "x": 590,
370
+ "y": 600,
371
+ "wires": [
372
+ [
373
+ "fba605329413c78d"
374
+ ]
375
+ ]
376
+ },
377
+ {
378
+ "id": "eb96f3128ece1be8",
379
+ "type": "comment",
380
+ "z": "a23d2e782beb66f4",
381
+ "g": "390ad4a596a3c002",
382
+ "name": "Start of Process and restart if it is finished",
383
+ "info": "",
384
+ "x": 220,
385
+ "y": 540,
386
+ "wires": []
387
+ },
247
388
  {
248
389
  "id": "42e6796dddd9d4db",
249
390
  "type": "processcube-engine-config",
@@ -0,0 +1,110 @@
1
+ [
2
+ {
3
+ "id": "5d27ab4d14b947e9",
4
+ "type": "tab",
5
+ "label": "Instances Query Sample",
6
+ "disabled": false,
7
+ "info": "",
8
+ "env": []
9
+ },
10
+ {
11
+ "id": "a71a168415778e2c",
12
+ "type": "group",
13
+ "z": "5d27ab4d14b947e9",
14
+ "style": {
15
+ "stroke": "#999999",
16
+ "stroke-opacity": "1",
17
+ "fill": "none",
18
+ "fill-opacity": "1",
19
+ "label": true,
20
+ "label-position": "nw",
21
+ "color": "#a4a4a4"
22
+ },
23
+ "nodes": [
24
+ "baa5d814f2e1f1d8",
25
+ "2af2c5031c617e3d",
26
+ "81af643792f131f0",
27
+ "2166b0f822b3e71d"
28
+ ],
29
+ "x": 34,
30
+ "y": 39,
31
+ "w": 652,
32
+ "h": 142
33
+ },
34
+ {
35
+ "id": "baa5d814f2e1f1d8",
36
+ "type": "processinstance-query",
37
+ "z": "5d27ab4d14b947e9",
38
+ "g": "a71a168415778e2c",
39
+ "name": "",
40
+ "engine": "42e6796dddd9d4db",
41
+ "query": "{\"includeXml\":false}",
42
+ "query_type": "json",
43
+ "x": 320,
44
+ "y": 140,
45
+ "wires": [
46
+ [
47
+ "2af2c5031c617e3d"
48
+ ]
49
+ ]
50
+ },
51
+ {
52
+ "id": "2af2c5031c617e3d",
53
+ "type": "debug",
54
+ "z": "5d27ab4d14b947e9",
55
+ "g": "a71a168415778e2c",
56
+ "name": "debug 25",
57
+ "active": true,
58
+ "tosidebar": true,
59
+ "console": false,
60
+ "tostatus": false,
61
+ "complete": "false",
62
+ "statusVal": "",
63
+ "statusType": "auto",
64
+ "x": 520,
65
+ "y": 140,
66
+ "wires": []
67
+ },
68
+ {
69
+ "id": "81af643792f131f0",
70
+ "type": "inject",
71
+ "z": "5d27ab4d14b947e9",
72
+ "g": "a71a168415778e2c",
73
+ "name": "",
74
+ "props": [
75
+ {
76
+ "p": "payload"
77
+ }
78
+ ],
79
+ "repeat": "",
80
+ "crontab": "",
81
+ "once": false,
82
+ "onceDelay": 0.1,
83
+ "topic": "",
84
+ "payload": "go",
85
+ "payloadType": "str",
86
+ "x": 130,
87
+ "y": 140,
88
+ "wires": [
89
+ [
90
+ "baa5d814f2e1f1d8"
91
+ ]
92
+ ]
93
+ },
94
+ {
95
+ "id": "2166b0f822b3e71d",
96
+ "type": "comment",
97
+ "z": "5d27ab4d14b947e9",
98
+ "g": "a71a168415778e2c",
99
+ "name": "Query all processinstances from the engine, see the config of `processinstance-query`",
100
+ "info": "",
101
+ "x": 360,
102
+ "y": 80,
103
+ "wires": []
104
+ },
105
+ {
106
+ "id": "42e6796dddd9d4db",
107
+ "type": "processcube-engine-config",
108
+ "url": "http://engine:8000"
109
+ }
110
+ ]