@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.
@@ -8,7 +8,7 @@ module.exports = function(RED) {
8
8
 
9
9
  node.on('input', function(msg) {
10
10
 
11
- const externalTaskId = msg.externalTaskId;
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-${externalTaskId}`, error, true);
29
+ eventEmitter.emit(`handle-${flowNodeInstanceId}`, error, true);
30
30
 
31
31
  node.send(msg);
32
32
  });
@@ -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 process it with result ${result} on msg._msgid ${msg._msgid}.`);
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} with result ${msg} on msg._msgid ${msg._msgid}.`);
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 process it with msg._msgid ${msg._msgid} and isError ${isError}`);
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
- topic: externalTask.topic,
84
+ task: RED.util.encodeObject(externalTask),
85
85
  payload: payload,
86
- externalTaskId: externalTask.flowNodeInstanceId
86
+ flowNodeInstanceId: externalTask.flowNodeInstanceId
87
87
  };
88
88
 
89
- node.log(`Received external task ${externalTask.flowNodeInstanceId} and process it with msg._msgid ${msg._msgid}`);
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
 
@@ -8,13 +8,13 @@ module.exports = function(RED) {
8
8
 
9
9
  node.on('input', function(msg) {
10
10
 
11
- const externalTaskId = msg.externalTaskId;
11
+ const flowNodeInstanceId = msg.flowNodeInstanceId;
12
12
 
13
- if (!externalTaskId) {
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-${externalTaskId}`, msg, false);
17
+ eventEmitter.emit(`handle-${flowNodeInstanceId}`, msg, false);
18
18
  });
19
19
  }
20
20
  RED.nodes.registerType("externaltask-output", ExternalTaskOutput);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@5minds/node-red-contrib-processcube",
3
- "version": "0.14.0-feature-c8461c-lyxixqqm",
3
+ "version": "0.14.0-feature-e0a989-lyy06ngq",
4
4
  "license": "MIT",
5
5
  "description": "Node-RED nodes for ProcessCube",
6
6
  "authors": [