@5minds/node-red-contrib-processcube 0.14.0-feature-084b12-lyxa7tam → 0.14.0-feature-255a65-lyxb1jwc
Sign up to get free protection for your applications and to get access to all the features.
package/Dockerfile
CHANGED
package/externaltask-error.js
CHANGED
@@ -14,16 +14,18 @@ module.exports = function(RED) {
|
|
14
14
|
|
15
15
|
if (msgError === undefined) {
|
16
16
|
msgError.message = "An error occurred";
|
17
|
-
msgError.source = msg.payload;
|
18
17
|
}
|
19
18
|
|
20
19
|
msg.errorCode = config.error;
|
21
20
|
msg.errorMessage = msgError.message;
|
22
|
-
msg.errorDetails =
|
21
|
+
//msg.errorDetails = RED.util.encodeObject(msg); // circular structure
|
23
22
|
|
24
23
|
const error = new Error(msg.errorMessage);
|
25
24
|
error.errorCode = msg.errorCode;
|
26
|
-
error.errorDetails = msg
|
25
|
+
error.errorDetails = RED.util.encodeObject(msg);
|
26
|
+
|
27
|
+
// TODO: hack cause https://github.com/5minds/ProcessCube.Engine.Client.ts/blob/develop/src/ExternalTaskWorker.ts#L180
|
28
|
+
error.stack = error.errorDetails;
|
27
29
|
error.externalTaskId = externalTaskId;
|
28
30
|
error._msgid = msg._msgid;
|
29
31
|
|
package/externaltask-input.js
CHANGED
@@ -20,7 +20,6 @@ module.exports = function(RED) {
|
|
20
20
|
var flowContext = node.context().flow;
|
21
21
|
var nodeContext = node.context();
|
22
22
|
|
23
|
-
|
24
23
|
this.engine = this.server = RED.nodes.getNode(config.engine);
|
25
24
|
|
26
25
|
const engineUrl = this.engine?.url || process.env.ENGINE_URL || 'http://engine:8000';
|
package/package.json
CHANGED
@@ -13,14 +13,29 @@ module.exports = function(RED) {
|
|
13
13
|
this.identity = null;
|
14
14
|
this.registerOnIdentityChanged = function (callback) {
|
15
15
|
identityChangedCallbacks.push(callback);
|
16
|
-
}
|
16
|
+
};
|
17
|
+
|
17
18
|
this.setIdentity = (identity) => {
|
18
19
|
this.identity = identity;
|
19
20
|
|
20
21
|
for (const callback of identityChangedCallbacks) {
|
21
22
|
callback(identity);
|
22
23
|
}
|
23
|
-
}
|
24
|
+
};
|
25
|
+
|
26
|
+
var nodeContext = node.context();
|
27
|
+
|
28
|
+
this.getEngineClient = () => {
|
29
|
+
const engineUrl = this.url || process.env.ENGINE_URL || 'http://engine:8000';
|
30
|
+
let client = nodeContext.get('client');
|
31
|
+
|
32
|
+
if (!client) {
|
33
|
+
nodeContext.set('client', new engine_client.EngineClient(engineUrl));
|
34
|
+
client = nodeContext.get('client');
|
35
|
+
}
|
36
|
+
|
37
|
+
return client;
|
38
|
+
};
|
24
39
|
|
25
40
|
if (this.credentials.clientId && this.credentials.clientSecret) {
|
26
41
|
const engineClient = new engine_client.EngineClient(this.url);
|
@@ -10,6 +10,8 @@
|
|
10
10
|
<bpmn:flowNodeRef>Activity_1h843f0</bpmn:flowNodeRef>
|
11
11
|
<bpmn:flowNodeRef>Activity_1duxvq1</bpmn:flowNodeRef>
|
12
12
|
<bpmn:flowNodeRef>Event_0z1wtnd</bpmn:flowNodeRef>
|
13
|
+
<bpmn:flowNodeRef>Event_0k29zgm</bpmn:flowNodeRef>
|
14
|
+
<bpmn:flowNodeRef>Event_1fs4jyo</bpmn:flowNodeRef>
|
13
15
|
</bpmn:lane>
|
14
16
|
</bpmn:laneSet>
|
15
17
|
<bpmn:startEvent id="StartEvent_1" name="Start">
|
@@ -34,7 +36,16 @@
|
|
34
36
|
<bpmn:endEvent id="Event_0z1wtnd">
|
35
37
|
<bpmn:incoming>Flow_1u1afua</bpmn:incoming>
|
36
38
|
</bpmn:endEvent>
|
39
|
+
<bpmn:sequenceFlow id="Flow_0yjhpg7" sourceRef="Event_0k29zgm" targetRef="Event_1fs4jyo" />
|
40
|
+
<bpmn:boundaryEvent id="Event_0k29zgm" attachedToRef="Activity_1duxvq1">
|
41
|
+
<bpmn:outgoing>Flow_0yjhpg7</bpmn:outgoing>
|
42
|
+
<bpmn:errorEventDefinition id="ErrorEventDefinition_0wn3imr" errorRef="Error_lR3DfG7B" />
|
43
|
+
</bpmn:boundaryEvent>
|
44
|
+
<bpmn:endEvent id="Event_1fs4jyo">
|
45
|
+
<bpmn:incoming>Flow_0yjhpg7</bpmn:incoming>
|
46
|
+
</bpmn:endEvent>
|
37
47
|
</bpmn:process>
|
48
|
+
<bpmn:error id="Error_lR3DfG7B" errorCode="ExternalTaskWorkerError" />
|
38
49
|
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
|
39
50
|
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Collaboration_1cidyxu">
|
40
51
|
<bpmndi:BPMNShape id="Participant_0px403d_di" bpmnElement="Participant_0px403d" isHorizontal="true">
|
@@ -60,6 +71,12 @@
|
|
60
71
|
<bpmndi:BPMNShape id="Event_0z1wtnd_di" bpmnElement="Event_0z1wtnd">
|
61
72
|
<dc:Bounds x="562" y="152" width="36" height="36" />
|
62
73
|
</bpmndi:BPMNShape>
|
74
|
+
<bpmndi:BPMNShape id="Event_1fs4jyo_di" bpmnElement="Event_1fs4jyo">
|
75
|
+
<dc:Bounds x="562" y="242" width="36" height="36" />
|
76
|
+
</bpmndi:BPMNShape>
|
77
|
+
<bpmndi:BPMNShape id="Event_15lb2jr_di" bpmnElement="Event_0k29zgm">
|
78
|
+
<dc:Bounds x="402" y="192" width="36" height="36" />
|
79
|
+
</bpmndi:BPMNShape>
|
63
80
|
<bpmndi:BPMNEdge id="Flow_1xfzejj_di" bpmnElement="Flow_1xfzejj">
|
64
81
|
<di:waypoint x="128" y="170" />
|
65
82
|
<di:waypoint x="180" y="170" />
|
@@ -72,6 +89,11 @@
|
|
72
89
|
<di:waypoint x="470" y="170" />
|
73
90
|
<di:waypoint x="562" y="170" />
|
74
91
|
</bpmndi:BPMNEdge>
|
92
|
+
<bpmndi:BPMNEdge id="Flow_0yjhpg7_di" bpmnElement="Flow_0yjhpg7">
|
93
|
+
<di:waypoint x="420" y="228" />
|
94
|
+
<di:waypoint x="420" y="260" />
|
95
|
+
<di:waypoint x="562" y="260" />
|
96
|
+
</bpmndi:BPMNEdge>
|
75
97
|
</bpmndi:BPMNPlane>
|
76
98
|
</bpmndi:BPMNDiagram>
|
77
99
|
</bpmn:definitions>
|