@5minds/node-red-contrib-processcube 0.14.0-feature-ef048b-lyy1ngi6 → 0.14.0-feature-7cec87-lyytfjz9
Sign up to get free protection for your applications and to get access to all the features.
- package/docker-compose.yml +1 -0
- package/externaltask-error.html +16 -2
- package/externaltask-error.js +4 -7
- package/externaltask-input.html +19 -2
- package/externaltask-input.js +2 -4
- package/externaltask-output.html +12 -2
- package/nodered/node-red-contrib-processcube-flows.json +111 -2
- package/nodered/package.json +1 -0
- package/package.json +2 -2
- package/processes/External-Task-Sample.bpmn +5 -5
package/docker-compose.yml
CHANGED
package/externaltask-error.html
CHANGED
@@ -26,6 +26,20 @@
|
|
26
26
|
</div>
|
27
27
|
</script>
|
28
28
|
|
29
|
-
<script type="text/
|
30
|
-
|
29
|
+
<script type="text/markdown" data-help-name="externaltask-error">
|
30
|
+
Used for reporting errors in the processing of external tasks. The error
|
31
|
+
code `Error` in the configuration is forwarded to the ProcessCube engine for
|
32
|
+
handling within *Error-Boundary-Events*.
|
33
|
+
|
34
|
+
## Inputs
|
35
|
+
|
36
|
+
: msg (Object) : Passed as `ErrorDetails` to the engine
|
37
|
+
: Error (string) : From the configuration
|
38
|
+
: Message (string) : The caught exception message
|
39
|
+
: StackTrace (string) : The stack trace of the exception
|
40
|
+
|
41
|
+
### References
|
42
|
+
|
43
|
+
- [The ProcessCube Developer Network](https://processcube.io) - All documentation for the ProcessCube© platform
|
44
|
+
- [Node-RED Integration in ProcessCube©](https://processcube.io/docs/node-red) - Node-RED integration in ProcessCube©
|
31
45
|
</script>
|
package/externaltask-error.js
CHANGED
@@ -16,15 +16,12 @@ module.exports = function(RED) {
|
|
16
16
|
msgError.message = "An error occurred";
|
17
17
|
}
|
18
18
|
|
19
|
+
const error = new Error(msgError.message);
|
20
|
+
error.errorCode = config.error;
|
21
|
+
error.errorDetails = RED.util.encodeObject(msg);
|
22
|
+
|
19
23
|
msg.errorCode = config.error;
|
20
24
|
msg.errorMessage = msgError.message;
|
21
|
-
//msg.errorDetails = RED.util.encodeObject(msg); // circular structure
|
22
|
-
|
23
|
-
const error = new Error(msg.errorMessage);
|
24
|
-
error.errorCode = config.error;
|
25
|
-
|
26
|
-
// TODO: hack cause https://github.com/5minds/ProcessCube.Engine.Client.ts/blob/develop/src/ExternalTaskWorker.ts#L180
|
27
|
-
error.stack = RED.util.encodeObject(msg);
|
28
25
|
|
29
26
|
eventEmitter.emit(`handle-${flowNodeInstanceId}`, error, true);
|
30
27
|
|
package/externaltask-input.html
CHANGED
@@ -31,6 +31,23 @@
|
|
31
31
|
</div>
|
32
32
|
</script>
|
33
33
|
|
34
|
-
<script type="text/
|
35
|
-
|
34
|
+
<script type="text/markdown" data-help-name="externaltask-input">
|
35
|
+
Waiting for external tasks that correspond to the `Topic` configured in
|
36
|
+
the connected ProcessCube Engine for processing.
|
37
|
+
|
38
|
+
## Outputs
|
39
|
+
|
40
|
+
: payload (string) : Defines the input of the external task token
|
41
|
+
: task (object) : The external task object
|
42
|
+
: flowNodeInstanceId : The Id of the external task, which is needed to complete the task
|
43
|
+
|
44
|
+
### Details
|
45
|
+
|
46
|
+
- To finish the external task the `externaltask-output` node is required.
|
47
|
+
- For handling a error while executing a flow as external task the `externaltask-error` node is required.
|
48
|
+
|
49
|
+
### References
|
50
|
+
|
51
|
+
- [The ProcessCube Developer Network](https://processcube.io) - All documentation for the ProcessCube© Plattform
|
52
|
+
- [Node-RED Integration in ProcessCube©](https://processcube.io/docs/node-red) - Node-RED Integration in ProcessCube©
|
36
53
|
</script>
|
package/externaltask-input.js
CHANGED
@@ -117,8 +117,6 @@ module.exports = function(RED) {
|
|
117
117
|
case 'processExternalTask':
|
118
118
|
node.error(`Worker error ${errorType} for *external task flowNodeInstanceId* '${externalTask.flowNodeInstanceId}' and *processInstanceId* '${externalTask.processInstanceId}': ${error.message}`);
|
119
119
|
|
120
|
-
externalTaskWorker.stop();
|
121
|
-
|
122
120
|
if (externalTask) {
|
123
121
|
delete started_external_tasks[externalTask.flowNodeInstanceId];
|
124
122
|
}
|
@@ -141,11 +139,11 @@ module.exports = function(RED) {
|
|
141
139
|
try {
|
142
140
|
externalTaskWorker.stop();
|
143
141
|
} catch {
|
144
|
-
|
142
|
+
node.error('Client close failed');
|
145
143
|
}
|
146
144
|
});
|
147
145
|
}
|
148
|
-
).
|
146
|
+
).catch((error) => {
|
149
147
|
node.error(`Error in subscribeToExternalTaskTopic: ${error.message}`);
|
150
148
|
});
|
151
149
|
}
|
package/externaltask-output.html
CHANGED
@@ -21,6 +21,16 @@
|
|
21
21
|
</div>
|
22
22
|
</script>
|
23
23
|
|
24
|
-
<script type="text/
|
25
|
-
|
24
|
+
<script type="text/markdown" data-help-name="externaltask-output">
|
25
|
+
Used to complete the external task. The `msg.payload` is returned to the ProcessCube
|
26
|
+
engine as the result of the external task.
|
27
|
+
|
28
|
+
## Inputs
|
29
|
+
|
30
|
+
: payload (Object) : Returned to the ProcessCube engine as the result of the external task
|
31
|
+
|
32
|
+
### References
|
33
|
+
|
34
|
+
- [The ProcessCube Developer Network](https://processcube.io) - All documentation for the ProcessCube© platform
|
35
|
+
- [Node-RED Integration in ProcessCube©](https://processcube.io/docs/node-red) - Node-RED integration in ProcessCube©
|
26
36
|
</script>
|
@@ -1,4 +1,12 @@
|
|
1
1
|
[
|
2
|
+
{
|
3
|
+
"id": "3f916448523ed12b",
|
4
|
+
"type": "tab",
|
5
|
+
"label": "Node-Inspector",
|
6
|
+
"disabled": false,
|
7
|
+
"info": "",
|
8
|
+
"env": []
|
9
|
+
},
|
2
10
|
{
|
3
11
|
"id": "a23d2e782beb66f4",
|
4
12
|
"type": "tab",
|
@@ -130,11 +138,112 @@
|
|
130
138
|
"w": 812,
|
131
139
|
"h": 202
|
132
140
|
},
|
141
|
+
{
|
142
|
+
"id": "dd43902998ad7630",
|
143
|
+
"type": "group",
|
144
|
+
"z": "3f916448523ed12b",
|
145
|
+
"style": {
|
146
|
+
"stroke": "#999999",
|
147
|
+
"stroke-opacity": "1",
|
148
|
+
"fill": "none",
|
149
|
+
"fill-opacity": "1",
|
150
|
+
"label": true,
|
151
|
+
"label-position": "nw",
|
152
|
+
"color": "#a4a4a4"
|
153
|
+
},
|
154
|
+
"nodes": [
|
155
|
+
"3add02d7.7df60e",
|
156
|
+
"8cf9f9cd.1a6a88",
|
157
|
+
"4b2a8ca1.de70e4",
|
158
|
+
"97dbbfedba44a728"
|
159
|
+
],
|
160
|
+
"x": 34,
|
161
|
+
"y": 59,
|
162
|
+
"w": 712,
|
163
|
+
"h": 202
|
164
|
+
},
|
133
165
|
{
|
134
166
|
"id": "42e6796dddd9d4db",
|
135
167
|
"type": "processcube-engine-config",
|
136
168
|
"url": "http://engine:8000"
|
137
169
|
},
|
170
|
+
{
|
171
|
+
"id": "3add02d7.7df60e",
|
172
|
+
"type": "node-inspector",
|
173
|
+
"z": "3f916448523ed12b",
|
174
|
+
"g": "dd43902998ad7630",
|
175
|
+
"inputField": "payload",
|
176
|
+
"host": "0.0.0.0",
|
177
|
+
"portNumber": 9229,
|
178
|
+
"autoStart": false,
|
179
|
+
"name": "",
|
180
|
+
"x": 400,
|
181
|
+
"y": 160,
|
182
|
+
"wires": []
|
183
|
+
},
|
184
|
+
{
|
185
|
+
"id": "8cf9f9cd.1a6a88",
|
186
|
+
"type": "inject",
|
187
|
+
"z": "3f916448523ed12b",
|
188
|
+
"g": "dd43902998ad7630",
|
189
|
+
"name": "",
|
190
|
+
"props": [
|
191
|
+
{
|
192
|
+
"p": "payload"
|
193
|
+
}
|
194
|
+
],
|
195
|
+
"repeat": "",
|
196
|
+
"crontab": "",
|
197
|
+
"once": false,
|
198
|
+
"onceDelay": 0.1,
|
199
|
+
"topic": "",
|
200
|
+
"payload": "open_inspector",
|
201
|
+
"payloadType": "str",
|
202
|
+
"x": 160,
|
203
|
+
"y": 160,
|
204
|
+
"wires": [
|
205
|
+
[
|
206
|
+
"3add02d7.7df60e"
|
207
|
+
]
|
208
|
+
]
|
209
|
+
},
|
210
|
+
{
|
211
|
+
"id": "4b2a8ca1.de70e4",
|
212
|
+
"type": "inject",
|
213
|
+
"z": "3f916448523ed12b",
|
214
|
+
"g": "dd43902998ad7630",
|
215
|
+
"name": "",
|
216
|
+
"props": [
|
217
|
+
{
|
218
|
+
"p": "payload"
|
219
|
+
}
|
220
|
+
],
|
221
|
+
"repeat": "",
|
222
|
+
"crontab": "",
|
223
|
+
"once": false,
|
224
|
+
"onceDelay": 0.1,
|
225
|
+
"topic": "",
|
226
|
+
"payload": "close_inspector",
|
227
|
+
"payloadType": "str",
|
228
|
+
"x": 160,
|
229
|
+
"y": 220,
|
230
|
+
"wires": [
|
231
|
+
[
|
232
|
+
"3add02d7.7df60e"
|
233
|
+
]
|
234
|
+
]
|
235
|
+
},
|
236
|
+
{
|
237
|
+
"id": "97dbbfedba44a728",
|
238
|
+
"type": "comment",
|
239
|
+
"z": "3f916448523ed12b",
|
240
|
+
"g": "dd43902998ad7630",
|
241
|
+
"name": "Start Node-Inspector on Port 9229 - be sure, that you expose the port from the docker-container",
|
242
|
+
"info": "",
|
243
|
+
"x": 390,
|
244
|
+
"y": 100,
|
245
|
+
"wires": []
|
246
|
+
},
|
138
247
|
{
|
139
248
|
"id": "2991a5e6df2b87d2",
|
140
249
|
"type": "externaltask-input",
|
@@ -210,7 +319,7 @@
|
|
210
319
|
"g": "31cb6729aac0ba46",
|
211
320
|
"name": "",
|
212
321
|
"pauseType": "delay",
|
213
|
-
"timeout": "
|
322
|
+
"timeout": "5",
|
214
323
|
"timeoutUnits": "seconds",
|
215
324
|
"rate": "1",
|
216
325
|
"nbRateUnits": "1",
|
@@ -221,7 +330,7 @@
|
|
221
330
|
"drop": false,
|
222
331
|
"allowrate": false,
|
223
332
|
"outputs": 1,
|
224
|
-
"x":
|
333
|
+
"x": 320,
|
225
334
|
"y": 360,
|
226
335
|
"wires": [
|
227
336
|
[
|
package/nodered/package.json
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@5minds/node-red-contrib-processcube",
|
3
|
-
"version": "0.14.0-feature-
|
3
|
+
"version": "0.14.0-feature-7cec87-lyytfjz9",
|
4
4
|
"license": "MIT",
|
5
5
|
"description": "Node-RED nodes for ProcessCube",
|
6
6
|
"authors": [
|
@@ -48,7 +48,7 @@
|
|
48
48
|
}
|
49
49
|
},
|
50
50
|
"dependencies": {
|
51
|
-
"@5minds/processcube_engine_client": "
|
51
|
+
"@5minds/processcube_engine_client": "5.0.0-hotfix-d834af-lyymqumd",
|
52
52
|
"jwt-decode": "^4.0.0",
|
53
53
|
"openid-client": "^5.5.0"
|
54
54
|
},
|
@@ -35,7 +35,7 @@
|
|
35
35
|
<bpmn:errorEventDefinition id="ErrorEventDefinition_1lr8fha" errorRef="Error_3O8wBFQi" />
|
36
36
|
</bpmn:boundaryEvent>
|
37
37
|
</bpmn:process>
|
38
|
-
<bpmn:error id="Error_3O8wBFQi" errorCode="
|
38
|
+
<bpmn:error id="Error_3O8wBFQi" errorCode="MyErrorCode" />
|
39
39
|
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
|
40
40
|
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Collaboration_1cidyxu">
|
41
41
|
<bpmndi:BPMNShape id="Participant_0px403d_di" bpmnElement="Participant_0px403d" isHorizontal="true">
|
@@ -81,14 +81,14 @@
|
|
81
81
|
<di:waypoint x="410" y="290" />
|
82
82
|
<di:waypoint x="482" y="290" />
|
83
83
|
</bpmndi:BPMNEdge>
|
84
|
-
<bpmndi:BPMNEdge id="Association_0ivfgz1_di" bpmnElement="Association_0ivfgz1">
|
85
|
-
<di:waypoint x="401" y="130" />
|
86
|
-
<di:waypoint x="413" y="90" />
|
87
|
-
</bpmndi:BPMNEdge>
|
88
84
|
<bpmndi:BPMNShape id="TextAnnotation_0lbjt7p_di" bpmnElement="TextAnnotation_0lbjt7p">
|
89
85
|
<dc:Bounds x="370" y="50" width="169.99387960829492" height="39.99855990783411" />
|
90
86
|
<bpmndi:BPMNLabel />
|
91
87
|
</bpmndi:BPMNShape>
|
88
|
+
<bpmndi:BPMNEdge id="Association_0ivfgz1_di" bpmnElement="Association_0ivfgz1">
|
89
|
+
<di:waypoint x="401" y="130" />
|
90
|
+
<di:waypoint x="413" y="90" />
|
91
|
+
</bpmndi:BPMNEdge>
|
92
92
|
</bpmndi:BPMNPlane>
|
93
93
|
</bpmndi:BPMNDiagram>
|
94
94
|
</bpmn:definitions>
|