@5minds/node-red-contrib-processcube 1.7.3 → 1.7.4-feature-90a7e6-m6jkiazl

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.
@@ -429,7 +429,7 @@
429
429
  },
430
430
  "@5minds/node-red-contrib-processcube": {
431
431
  "name": "@5minds/node-red-contrib-processcube",
432
- "version": "1.7.3",
432
+ "version": "1.7.4",
433
433
  "local": false,
434
434
  "user": false,
435
435
  "nodes": {
@@ -111,6 +111,14 @@
111
111
  "info": "",
112
112
  "env": []
113
113
  },
114
+ {
115
+ "id": "d2d4021c0003f913",
116
+ "type": "tab",
117
+ "label": "TokenTest",
118
+ "disabled": false,
119
+ "info": "",
120
+ "env": []
121
+ },
114
122
  {
115
123
  "id": "4c59118134081e05",
116
124
  "type": "group",
@@ -669,7 +677,12 @@
669
677
  "id": "b78932d162d8d468",
670
678
  "type": "processcube-engine-config",
671
679
  "name": "Engine Auth 8000",
672
- "url": "http://engine:8000"
680
+ "url": "http://engine:8000",
681
+ "urlType": "str",
682
+ "clientId": "nodered",
683
+ "clientIdType": "str",
684
+ "clientSecret": "nodered",
685
+ "clientSecretType": "str"
673
686
  },
674
687
  {
675
688
  "id": "2991a5e6df2b87d2",
@@ -3099,5 +3112,122 @@
3099
3112
  "af52431420fa7e15"
3100
3113
  ]
3101
3114
  ]
3115
+ },
3116
+ {
3117
+ "id": "6498965c90a69b52",
3118
+ "type": "externaltask-input",
3119
+ "z": "d2d4021c0003f913",
3120
+ "name": "",
3121
+ "engine": "b78932d162d8d468",
3122
+ "topic": "TriggerPCNode",
3123
+ "topicType": "str",
3124
+ "workerConfig": "{}",
3125
+ "workerConfigType": "json",
3126
+ "x": 410,
3127
+ "y": 200,
3128
+ "wires": [
3129
+ [
3130
+ "04d89e4c96b9b2a6",
3131
+ "718a8f661fef6590"
3132
+ ]
3133
+ ]
3134
+ },
3135
+ {
3136
+ "id": "718a8f661fef6590",
3137
+ "type": "externaltask-output",
3138
+ "z": "d2d4021c0003f913",
3139
+ "name": "",
3140
+ "x": 910,
3141
+ "y": 200,
3142
+ "wires": []
3143
+ },
3144
+ {
3145
+ "id": "04d89e4c96b9b2a6",
3146
+ "type": "debug",
3147
+ "z": "d2d4021c0003f913",
3148
+ "name": "debug 3",
3149
+ "active": true,
3150
+ "tosidebar": true,
3151
+ "console": false,
3152
+ "tostatus": false,
3153
+ "complete": "true",
3154
+ "targetType": "full",
3155
+ "statusVal": "",
3156
+ "statusType": "auto",
3157
+ "x": 660,
3158
+ "y": 300,
3159
+ "wires": []
3160
+ },
3161
+ {
3162
+ "id": "5b61ceb915a981c1",
3163
+ "type": "inject",
3164
+ "z": "d2d4021c0003f913",
3165
+ "name": "",
3166
+ "props": [],
3167
+ "repeat": "",
3168
+ "crontab": "",
3169
+ "once": false,
3170
+ "onceDelay": 0.1,
3171
+ "topic": "",
3172
+ "x": 270,
3173
+ "y": 420,
3174
+ "wires": [
3175
+ [
3176
+ "b89a529a7e0b5f75"
3177
+ ]
3178
+ ]
3179
+ },
3180
+ {
3181
+ "id": "b89a529a7e0b5f75",
3182
+ "type": "function",
3183
+ "z": "d2d4021c0003f913",
3184
+ "name": "function 1",
3185
+ "func": "msg = { \"_event\": { \"type\": \"click\", \"clientX\": 892, \"clientY\": 123, \"bbox\": { \"x\": 832.5, \"y\": 119, \"width\": 310, \"height\": 38, \"top\": 119, \"right\": 1142.5, \"bottom\": 157, \"left\": 832.5 } }, \"_client\": { \"user\": { \"id\": \"ca4ca3de-3e80-40f9-8233-453cf2233fc2\", \"displayName\": \"admin\", \"username\": \"admin\", \"profileUrl\": \"\", \"emails\": [{ \"value\": \"admin@admin.de\" }], \"claims\": { \"sub\": \"ca4ca3de-3e80-40f9-8233-453cf2233fc2\", \"profile\": \"\", \"email\": \"admin@admin.de\", \"locale\": \"\", \"nickname\": \"\", \"website\": \"\", \"middle_name\": \"\", \"zoneinfo\": \"\", \"given_name\": \"\", \"birthdate\": \"\", \"gender\": \"\", \"company\": \"\", \"family_name\": \"\", \"updated_at\": null, \"email_verified\": true, \"preferred_username\": \"\", \"picture\": \"\", \"name\": \"admin\", \"jti\": \"6CQecbRqFPnsTLKV_cbG9\", \"iat\": 1738242946, \"exp\": 1738246546, \"scope\": \"openid profile email lanes\", \"client_id\": \"PassportTestClient\", \"iss\": \"http://authority:11560/\", \"aud\": \"PassportTestClient\" }, \"accessToken\": \"eyJhbGciOiJSUzI1NiIsInR5cCI6ImF0K2p3dCIsImtpZCI6IlA1RXlTLVFjem80Z2IxQUNiNmxadmhDQTBpdWVNUnpqTlRuNnVpRl94RkkifQ.eyJzdWIiOiJjYTRjYTNkZS0zZTgwLTQwZjktODIzMy00NTNjZjIyMzNmYzIiLCJwcm9maWxlIjoiIiwiZW1haWwiOiJhZG1pbkBhZG1pbi5kZSIsImxvY2FsZSI6IiIsIm5pY2tuYW1lIjoiIiwid2Vic2l0ZSI6IiIsIm1pZGRsZV9uYW1lIjoiIiwiem9uZWluZm8iOiIiLCJnaXZlbl9uYW1lIjoiIiwiYmlydGhkYXRlIjoiIiwiZ2VuZGVyIjoiIiwiY29tcGFueSI6IiIsImZhbWlseV9uYW1lIjoiIiwidXBkYXRlZF9hdCI6bnVsbCwiZW1haWxfdmVyaWZpZWQiOnRydWUsInByZWZlcnJlZF91c2VybmFtZSI6IiIsInBpY3R1cmUiOiIiLCJuYW1lIjoiYWRtaW4iLCJqdGkiOiI2Q1FlY2JScUZQbnNUTEtWX2NiRzkiLCJpYXQiOjE3MzgyNDI5NDYsImV4cCI6MTczODI0NjU0Niwic2NvcGUiOiJvcGVuaWQgcHJvZmlsZSBlbWFpbCBsYW5lcyIsImNsaWVudF9pZCI6IlBhc3Nwb3J0VGVzdENsaWVudCIsImlzcyI6Imh0dHA6Ly9hdXRob3JpdHk6MTE1NjAvIiwiYXVkIjoiUGFzc3BvcnRUZXN0Q2xpZW50In0.sBPvFE38A1RX7bs_tjZf8IjOaMVmKqdCxlZo0r9YJvCRwC_kM6G-n4CQEYJkTkO4ZmNpCPk01vNasCsXPG-bUedHJzIPb1DxuHQX7N51jepjgf6SY_BOKhSftw0jJvnvTUfxzPBE4gb6a5VO02mPfTyt8Vqx54mM3tZgoA_OEg-T0Uv0PTYd4VT671TUwACVhFSN43njJ04jX...\" }, \"socketId\": \"RunwgKI4_c0wEvu3AAAB\", \"socketIp\": \"172.20.0.1\" }, \"topic\": \"\", \"payload\": \"\", \"_msgid\": \"98958041794d2d15\" }\nreturn msg;",
3186
+ "outputs": 1,
3187
+ "timeout": 0,
3188
+ "noerr": 0,
3189
+ "initialize": "",
3190
+ "finalize": "",
3191
+ "libs": [],
3192
+ "x": 440,
3193
+ "y": 420,
3194
+ "wires": [
3195
+ [
3196
+ "4cc598063a38db82"
3197
+ ]
3198
+ ]
3199
+ },
3200
+ {
3201
+ "id": "4cc598063a38db82",
3202
+ "type": "process-start",
3203
+ "z": "d2d4021c0003f913",
3204
+ "name": "",
3205
+ "engine": "b78932d162d8d468",
3206
+ "processmodel": "StartProcessSample_Process",
3207
+ "startevent": "StartEvent_1",
3208
+ "x": 630,
3209
+ "y": 420,
3210
+ "wires": [
3211
+ [
3212
+ "da96fb5b9dfe8b66"
3213
+ ]
3214
+ ]
3215
+ },
3216
+ {
3217
+ "id": "da96fb5b9dfe8b66",
3218
+ "type": "debug",
3219
+ "z": "d2d4021c0003f913",
3220
+ "name": "debug 4",
3221
+ "active": true,
3222
+ "tosidebar": true,
3223
+ "console": false,
3224
+ "tostatus": false,
3225
+ "complete": "true",
3226
+ "targetType": "full",
3227
+ "statusVal": "",
3228
+ "statusType": "auto",
3229
+ "x": 820,
3230
+ "y": 420,
3231
+ "wires": []
3102
3232
  }
3103
3233
  ]
package/README.md CHANGED
@@ -25,13 +25,19 @@ To install and run the Node-RED flows, follow these steps:
25
25
  cd processcube_nodered
26
26
  ```
27
27
 
28
- 3. Build the Docker containers:
28
+ 3. Install the dependencies of the package `@5minds/node-red-contrib-processcube`:
29
+
30
+ ```bash
31
+ npm install
32
+ ```
33
+
34
+ 4. Build the Docker containers:
29
35
 
30
36
  ```bash
31
37
  docker-compose build
32
38
  ```
33
39
 
34
- 4. Start the Docker containers:
40
+ 5. Start the Docker containers:
35
41
 
36
42
  ```bash
37
43
  docker-compose up -d
@@ -3,8 +3,10 @@ const EventEmitter = require('node:events');
3
3
  function showStatus(node, msgCounter) {
4
4
  if (msgCounter >= 1) {
5
5
  node.status({ fill: 'green', shape: 'dot', text: `handling tasks ${msgCounter}.` });
6
+ node.log(`handling tasks ${msgCounter}.`);
6
7
  } else {
7
8
  node.status({ fill: 'blue', shape: 'ring', text: `subcribed.` });
9
+ node.log(`subcribed (heartbeat).`);
8
10
  }
9
11
  }
10
12
 
@@ -155,6 +157,7 @@ module.exports = function (RED) {
155
157
  break;
156
158
  case 'fetchAndLock':
157
159
  node.status({ fill: 'red', shape: 'ring', text: `subscription failed.` });
160
+ node.error('subscription failed.');
158
161
  break;
159
162
  default:
160
163
  // reduce noise error logs
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@5minds/node-red-contrib-processcube",
3
- "version": "1.7.3",
3
+ "version": "1.7.4-feature-90a7e6-m6jkiazl",
4
4
  "license": "MIT",
5
5
  "description": "Node-RED nodes for ProcessCube",
6
6
  "scripts": {
package/process-start.js CHANGED
@@ -1,3 +1,5 @@
1
+ const engine_client = require('@5minds/processcube_engine_client');
2
+
1
3
  module.exports = function (RED) {
2
4
  function ProcessStart(config) {
3
5
  RED.nodes.createNode(this, config);
@@ -33,13 +35,20 @@ module.exports = function (RED) {
33
35
  }
34
36
 
35
37
  node.engine = RED.nodes.getNode(config.engine);
36
- const client = node.engine.engineClient;
38
+ const engineClientExternalSecret = node.engine.engineClient;
39
+
40
+ var client = engineClientExternalSecret;
37
41
 
38
42
  if (!client) {
39
43
  node.error('No engine configured.', msg);
40
44
  return;
41
45
  }
42
46
 
47
+ if (msg._client.user) {
48
+ const identity = { userId: msg._client.user.id, token: msg._client.user.accessToken };
49
+ client = new engine_client.EngineClient(engineClientExternalSecret.url, identity);
50
+ }
51
+
43
52
  client.processDefinitions
44
53
  .startProcessInstance(startParameters)
45
54
  .then((result) => {
@@ -1,6 +1,4 @@
1
1
  const engine_client = require('@5minds/processcube_engine_client');
2
- const jwt = require('jwt-decode');
3
- const oidc = require('openid-client');
4
2
 
5
3
  module.exports = function (RED) {
6
4
  function ProcessCubeEngineNode(n) {
@@ -0,0 +1,58 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="TokenTest_Definition" targetNamespace="http://bpmn.io/schema/bpmn" exporter="5Minds Studio" exporterVersion="1">
3
+ <bpmn:collaboration id="Collaboration_1cidyxu" name="">
4
+ <bpmn:participant id="Participant_0qqs1cu" name="Token-Test" processRef="Token-Test_Process" />
5
+ </bpmn:collaboration>
6
+ <bpmn:process id="Token-Test_Process" name="Token-Test" isExecutable="true">
7
+ <bpmn:laneSet id="LaneSet_1aqtpqs">
8
+ <bpmn:lane id="Lane_1mo8jcc" name="Lane">
9
+ <bpmn:flowNodeRef>Event_1ptmb8y</bpmn:flowNodeRef>
10
+ <bpmn:flowNodeRef>Event_03og9pn</bpmn:flowNodeRef>
11
+ <bpmn:flowNodeRef>Activity_1ce0pce</bpmn:flowNodeRef>
12
+ </bpmn:lane>
13
+ </bpmn:laneSet>
14
+ <bpmn:startEvent id="Event_1ptmb8y" name="Start">
15
+ <bpmn:outgoing>Flow_14x1t60</bpmn:outgoing>
16
+ </bpmn:startEvent>
17
+ <bpmn:endEvent id="Event_03og9pn">
18
+ <bpmn:incoming>Flow_09xp1ep</bpmn:incoming>
19
+ </bpmn:endEvent>
20
+ <bpmn:serviceTask id="Activity_1ce0pce" name="TriggerPCNode" camunda:type="external" camunda:topic="TriggerPCNode">
21
+ <bpmn:incoming>Flow_14x1t60</bpmn:incoming>
22
+ <bpmn:outgoing>Flow_09xp1ep</bpmn:outgoing>
23
+ </bpmn:serviceTask>
24
+ <bpmn:sequenceFlow id="Flow_14x1t60" sourceRef="Event_1ptmb8y" targetRef="Activity_1ce0pce" />
25
+ <bpmn:sequenceFlow id="Flow_09xp1ep" sourceRef="Activity_1ce0pce" targetRef="Event_03og9pn" />
26
+ </bpmn:process>
27
+ <bpmndi:BPMNDiagram id="BPMNDiagram_1">
28
+ <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Collaboration_1cidyxu">
29
+ <bpmndi:BPMNShape id="BPMNShape_0cjotgc" bpmnElement="Participant_0qqs1cu" isHorizontal="true">
30
+ <dc:Bounds x="-80" y="-310" width="885" height="346" />
31
+ </bpmndi:BPMNShape>
32
+ <bpmndi:BPMNShape id="BPMNShape_1ib40km" bpmnElement="Lane_1mo8jcc" isHorizontal="true">
33
+ <dc:Bounds x="-50" y="-310" width="855" height="346" />
34
+ </bpmndi:BPMNShape>
35
+ <bpmndi:BPMNShape id="BPMNShape_139q3mx" bpmnElement="Event_1ptmb8y">
36
+ <dc:Bounds x="7" y="-162" width="36" height="36" />
37
+ <bpmndi:BPMNLabel>
38
+ <dc:Bounds x="13" y="-119" width="25" height="14" />
39
+ </bpmndi:BPMNLabel>
40
+ </bpmndi:BPMNShape>
41
+ <bpmndi:BPMNShape id="Event_03og9pn_di" bpmnElement="Event_03og9pn">
42
+ <dc:Bounds x="247" y="-162" width="36" height="36" />
43
+ </bpmndi:BPMNShape>
44
+ <bpmndi:BPMNShape id="Activity_1rdy3md_di" bpmnElement="Activity_1ce0pce">
45
+ <dc:Bounds x="95" y="-184" width="100" height="80" />
46
+ <bpmndi:BPMNLabel />
47
+ </bpmndi:BPMNShape>
48
+ <bpmndi:BPMNEdge id="Flow_14x1t60_di" bpmnElement="Flow_14x1t60">
49
+ <di:waypoint x="43" y="-144" />
50
+ <di:waypoint x="95" y="-144" />
51
+ </bpmndi:BPMNEdge>
52
+ <bpmndi:BPMNEdge id="Flow_09xp1ep_di" bpmnElement="Flow_09xp1ep">
53
+ <di:waypoint x="195" y="-144" />
54
+ <di:waypoint x="247" y="-144" />
55
+ </bpmndi:BPMNEdge>
56
+ </bpmndi:BPMNPlane>
57
+ </bpmndi:BPMNDiagram>
58
+ </bpmn:definitions>