@5minds/node-red-contrib-processcube 0.5.7 → 0.6.0-develop-3a2e82-lxu52q0o

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,7 +7,7 @@
7
7
  error: {value:""}
8
8
  },
9
9
  inputs: 1,
10
- outputs: 0,
10
+ outputs: 1,
11
11
  icon: "font-awesome/fa-exclamation-triangle",
12
12
  label: function() {
13
13
  return this.name || "externaltask-error";
@@ -26,6 +26,8 @@ module.exports = function(RED) {
26
26
  };
27
27
 
28
28
  eventEmitter.emit(`error-${externalTaskId}`, msg.payload);
29
+
30
+ node.send(msg);
29
31
  });
30
32
  }
31
33
  RED.nodes.registerType("externaltask-error", ExternalTaskError);
@@ -11,6 +11,16 @@ function showStatus(node, msgCounter) {
11
11
  }
12
12
  }
13
13
 
14
+ function decrCounter(msgCounter) {
15
+ msgCounter--;
16
+
17
+ if (msgCounter < 0) {
18
+ msgCounter = 0;
19
+ }
20
+
21
+ return msgCounter;
22
+ }
23
+
14
24
  module.exports = function(RED) {
15
25
  function ExternalTaskInput(config) {
16
26
  RED.nodes.createNode(this,config);
@@ -46,13 +56,14 @@ module.exports = function(RED) {
46
56
 
47
57
  // TODO: once ist 2x gebunden
48
58
  eventEmitter.once(`finish-${externalTask.flowNodeInstanceId}`, (result) => {
49
- msgCounter--;
59
+ msgCounter = decrCounter(msgCounter);
60
+
50
61
  showStatus(node, msgCounter);
51
62
  resolve(result);
52
63
  });
53
64
 
54
65
  eventEmitter.once(`error-${externalTask.flowNodeInstanceId}`, (msg) => {
55
- msgCounter--;
66
+ msgCounter = decrCounter(msgCounter);
56
67
  showStatus(node, msgCounter);
57
68
 
58
69
  var result = msg.payload ? msg.payload : msg;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@5minds/node-red-contrib-processcube",
3
- "version": "0.5.7",
3
+ "version": "0.6.0-develop-3a2e82-lxu52q0o",
4
4
  "license": "MIT",
5
5
  "description": "Node-RED nodes for ProcessCube",
6
6
  "authors": [