@5minds/node-red-contrib-processcube 0.6.0-develop-a016f3-lxu6osmc → 0.7.0-develop-8969df-ly2v8202

Sign up to get free protection for your applications and to get access to all the features.
@@ -72,7 +72,12 @@ module.exports = function(RED) {
72
72
  });
73
73
 
74
74
  showStatus(node, msgCounter);
75
- node.send({ topic: externalTask.topic, externalTaskId: externalTask.flowNodeInstanceId, payload: payload});
75
+
76
+ msg.topic = externalTask.topic;
77
+ msg.externalTaskId = externalTask.flowNodeInstanceId;
78
+ msg.payload = payload;
79
+
80
+ node.send(msg);
76
81
  });
77
82
  },
78
83
  ).then(externalTaskWorker => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@5minds/node-red-contrib-processcube",
3
- "version": "0.6.0-develop-a016f3-lxu6osmc",
3
+ "version": "0.7.0-develop-8969df-ly2v8202",
4
4
  "license": "MIT",
5
5
  "description": "Node-RED nodes for ProcessCube",
6
6
  "authors": [
package/usertask-input.js CHANGED
@@ -53,18 +53,25 @@ module.exports = function(RED) {
53
53
  if (!config.force_send_array && matchingFlowNodes && matchingFlowNodes.userTasks && matchingFlowNodes.userTasks.length == 1) {
54
54
  userTask = matchingFlowNodes.userTasks[0];
55
55
 
56
- node.send({ payload: {userTask: userTask } });
56
+ msg.payload = { userTask: userTask };
57
+ node.send(msg);
57
58
  } else {
58
59
  if (!config.force_send_array) {
59
60
  if (config.multisend && matchingFlowNodes.userTasks && matchingFlowNodes.userTasks.length > 1) {
60
61
  matchingFlowNodes.userTasks.forEach((userTask) => {
61
- node.send({ payload: { userTask: userTask } });
62
+
63
+ msg.payload = { userTask: userTask } ;
64
+ node.send(msg);
62
65
  });
63
66
  } else {
64
- node.send({ payload: { userTasks: matchingFlowNodes.userTasks } });
67
+
68
+ msg.payload = { userTasks: matchingFlowNodes.userTasks };
69
+ node.send(msg);
65
70
  }
66
71
  } else {
67
- node.send({ payload: { userTasks: matchingFlowNodes.userTasks || []} });
72
+
73
+ msg.payload = { userTasks: matchingFlowNodes.userTasks || [] };
74
+ node.send(msg);
68
75
  }
69
76
  }
70
77
  });
@@ -5,9 +5,8 @@ const engine_client = require('@5minds/processcube_engine_client');
5
5
 
6
6
  module.exports = function(RED) {
7
7
  function UserTaskNewListener(config) {
8
- RED.nodes.createNode(this,config);
8
+ RED.nodes.createNode(this, config);
9
9
  var node = this;
10
- var msgCounter = 0;
11
10
  var flowContext = node.context().flow;
12
11
  var nodeContext = node.context();
13
12
 
@@ -46,7 +46,7 @@ module.exports = function(RED) {
46
46
  node.error(error);
47
47
  });
48
48
  } else {
49
- console.log(`No UserTask found in message: ${JSON.stringify(msg.payload)}`);
49
+ node.error(`No UserTask found in message: ${JSON.stringify(msg.payload)}`);
50
50
  }
51
51
  });
52
52
  }