@5minds/node-red-contrib-processcube 1.2.0-develop-268bee-m1xd03z9 → 1.2.2-develop-40a813-m1xxcgt0

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,10 +3,17 @@ module.exports = function (RED) {
3
3
  RED.nodes.createNode(this, config);
4
4
  var node = this;
5
5
 
6
- var flowContext = node.context().flow;
7
- var eventEmitter = flowContext.get('emitter');
6
+ const flowContext = node.context().flow;
7
+ let eventEmitter = null;
8
8
 
9
9
  node.on('input', function (msg) {
10
+ eventEmitter = flowContext.get('emitter');
11
+
12
+ if (!eventEmitter) {
13
+ flowContext.set('emitter', new EventEmitter());
14
+ eventEmitter = flowContext.get('emitter');
15
+ }
16
+
10
17
  const flowNodeInstanceId = msg.flowNodeInstanceId;
11
18
 
12
19
  let msgError = msg.error;
@@ -1,17 +1,19 @@
1
1
  module.exports = function (RED) {
2
2
  function ExternalTaskOutput(config) {
3
3
  RED.nodes.createNode(this, config);
4
- var node = this;
4
+ const node = this;
5
5
 
6
- var flowContext = node.context().flow;
7
- var eventEmitter = flowContext.get('emitter');
6
+ const flowContext = node.context().flow;
7
+ let eventEmitter = null;
8
8
 
9
- if (!eventEmitter) {
10
- flowContext.set('emitter', new EventEmitter());
9
+ node.on('input', function (msg) {
11
10
  eventEmitter = flowContext.get('emitter');
12
- }
13
11
 
14
- node.on('input', function (msg) {
12
+ if (!eventEmitter) {
13
+ flowContext.set('emitter', new EventEmitter());
14
+ eventEmitter = flowContext.get('emitter');
15
+ }
16
+
15
17
  const flowNodeInstanceId = msg.flowNodeInstanceId;
16
18
  const processInstanceId = msg.processInstanceId;
17
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@5minds/node-red-contrib-processcube",
3
- "version": "1.2.0-develop-268bee-m1xd03z9",
3
+ "version": "1.2.2-develop-40a813-m1xxcgt0",
4
4
  "license": "MIT",
5
5
  "description": "Node-RED nodes for ProcessCube",
6
6
  "scripts": {