@5minds/node-red-contrib-processcube 0.14.0-feature-c8461c-lyxixqqm → 0.14.0-feature-e0a989-lyy06ngq
Sign up to get free protection for your applications and to get access to all the features.
- package/externaltask-error.js +2 -2
- package/externaltask-input.js +7 -7
- package/externaltask-output.js +3 -3
- package/package.json +1 -1
package/externaltask-error.js
CHANGED
@@ -8,7 +8,7 @@ module.exports = function(RED) {
|
|
8
8
|
|
9
9
|
node.on('input', function(msg) {
|
10
10
|
|
11
|
-
const
|
11
|
+
const flowNodeInstanceId = msg.flowNodeInstanceId;
|
12
12
|
|
13
13
|
let msgError = msg.error;
|
14
14
|
|
@@ -26,7 +26,7 @@ module.exports = function(RED) {
|
|
26
26
|
// TODO: hack cause https://github.com/5minds/ProcessCube.Engine.Client.ts/blob/develop/src/ExternalTaskWorker.ts#L180
|
27
27
|
error.stack = RED.util.encodeObject(msg);
|
28
28
|
|
29
|
-
eventEmitter.emit(`handle-${
|
29
|
+
eventEmitter.emit(`handle-${flowNodeInstanceId}`, error, true);
|
30
30
|
|
31
31
|
node.send(msg);
|
32
32
|
});
|
package/externaltask-input.js
CHANGED
@@ -36,7 +36,7 @@ module.exports = function(RED) {
|
|
36
36
|
const handleFinishTask = (msg) => {
|
37
37
|
let result = RED.util.encodeObject(msg.payload);
|
38
38
|
|
39
|
-
node.log(`handle event for external task ${externalTask.flowNodeInstanceId} and
|
39
|
+
node.log(`handle event for *external task flowNodeInstanceId* '${externalTask.flowNodeInstanceId}' and *processInstanceId* ${externalTask.processInstanceId} with result ${result} on msg._msgid ${msg._msgid}.`);
|
40
40
|
|
41
41
|
if (externalTask.flowNodeInstanceId) {
|
42
42
|
delete started_external_tasks[externalTask.flowNodeInstanceId];
|
@@ -50,7 +50,7 @@ module.exports = function(RED) {
|
|
50
50
|
|
51
51
|
const handleErrorTask = (msg) => {
|
52
52
|
|
53
|
-
node.log(`handle error event for external task ${externalTask.flowNodeInstanceId}
|
53
|
+
node.log(`handle error event for *external task flowNodeInstanceId* '${externalTask.flowNodeInstanceId}' and *processInstanceId* '${externalTask.processInstanceId}' on *msg._msgid* '${msg._msgid}'.`);
|
54
54
|
|
55
55
|
if (externalTask.flowNodeInstanceId) {
|
56
56
|
delete started_external_tasks[externalTask.flowNodeInstanceId];
|
@@ -66,7 +66,7 @@ module.exports = function(RED) {
|
|
66
66
|
};
|
67
67
|
|
68
68
|
eventEmitter.once(`handle-${externalTask.flowNodeInstanceId}`, (msg, isError = false) => {
|
69
|
-
node.log(`handle event for external task ${externalTask.flowNodeInstanceId} and
|
69
|
+
node.log(`handle event for *external task flowNodeInstanceId* '${externalTask.flowNodeInstanceId}' and *processInstanceId* '${externalTask.processInstanceId}' with *msg._msgid* '${msg._msgid}' and *isError* '${isError}'`);
|
70
70
|
|
71
71
|
if (isError) {
|
72
72
|
handleErrorTask(msg);
|
@@ -81,12 +81,12 @@ module.exports = function(RED) {
|
|
81
81
|
|
82
82
|
let msg = {
|
83
83
|
_msgid: RED.util.generateId(),
|
84
|
-
|
84
|
+
task: RED.util.encodeObject(externalTask),
|
85
85
|
payload: payload,
|
86
|
-
|
86
|
+
flowNodeInstanceId: externalTask.flowNodeInstanceId
|
87
87
|
};
|
88
88
|
|
89
|
-
node.log(`Received external task ${externalTask.flowNodeInstanceId} and
|
89
|
+
node.log(`Received *external task flowNodeInstanceId* '${externalTask.flowNodeInstanceId}' and *processInstanceId* '${externalTask.processInstanceId}' with *msg._msgid* '${msg._msgid}'`);
|
90
90
|
|
91
91
|
node.send(msg);
|
92
92
|
});
|
@@ -105,7 +105,7 @@ module.exports = function(RED) {
|
|
105
105
|
case 'extendLock':
|
106
106
|
case 'finishExternalTask':
|
107
107
|
case 'processExternalTask':
|
108
|
-
node.error(`Worker error ${errorType} for external task ${externalTask.flowNodeInstanceId}: ${error.message}`);
|
108
|
+
node.error(`Worker error ${errorType} for *external task flowNodeInstanceId* '${externalTask.flowNodeInstanceId}' and *processInstanceId* '${externalTask.processInstanceId}': ${error.message}`);
|
109
109
|
|
110
110
|
externalTaskWorker.stop();
|
111
111
|
|
package/externaltask-output.js
CHANGED
@@ -8,13 +8,13 @@ module.exports = function(RED) {
|
|
8
8
|
|
9
9
|
node.on('input', function(msg) {
|
10
10
|
|
11
|
-
const
|
11
|
+
const flowNodeInstanceId = msg.flowNodeInstanceId;
|
12
12
|
|
13
|
-
if (!
|
13
|
+
if (!flowNodeInstanceId) {
|
14
14
|
node.error('Error: The message did not contain the required external task id.', msg);
|
15
15
|
}
|
16
16
|
|
17
|
-
eventEmitter.emit(`handle-${
|
17
|
+
eventEmitter.emit(`handle-${flowNodeInstanceId}`, msg, false);
|
18
18
|
});
|
19
19
|
}
|
20
20
|
RED.nodes.registerType("externaltask-output", ExternalTaskOutput);
|