@5minds/node-red-contrib-processcube 1.2.0-develop-268bee-m1xd03z9 → 1.2.1-develop-3f34f2-m1xw7p4r
Sign up to get free protection for your applications and to get access to all the features.
- package/externaltask-output.js +9 -7
- package/package.json +1 -1
package/externaltask-output.js
CHANGED
@@ -1,17 +1,19 @@
|
|
1
1
|
module.exports = function (RED) {
|
2
2
|
function ExternalTaskOutput(config) {
|
3
3
|
RED.nodes.createNode(this, config);
|
4
|
-
|
4
|
+
const node = this;
|
5
5
|
|
6
|
-
|
7
|
-
|
6
|
+
const flowContext = node.context().flow;
|
7
|
+
let eventEmitter = null;
|
8
8
|
|
9
|
-
|
10
|
-
flowContext.set('emitter', new EventEmitter());
|
9
|
+
node.on('input', function (msg) {
|
11
10
|
eventEmitter = flowContext.get('emitter');
|
12
|
-
}
|
13
11
|
|
14
|
-
|
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
|
|