@5minds/node-red-contrib-processcube 1.1.4-feature-3050c0-m04ysmbf → 1.1.4-feature-e9faa8-m04zlkr3
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +1 -1
- package/process-new-listener.js +22 -20
package/package.json
CHANGED
package/process-new-listener.js
CHANGED
@@ -19,15 +19,16 @@ module.exports = function (RED) {
|
|
19
19
|
if (node.engine.isIdentityReady()) {
|
20
20
|
subscription = await client.notification.onProcessStarted(
|
21
21
|
(processNotification) => {
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
22
|
+
if (config.processmodel != processNotification.processModelId) return;
|
23
|
+
node.send({
|
24
|
+
payload: {
|
25
|
+
processInstanceId: processNotification.processInstanceId,
|
26
|
+
flowNodeId: processNotification.flowNodeId,
|
27
|
+
token: processNotification.currentToken,
|
28
|
+
action: 'started',
|
29
|
+
type: 'processInstance',
|
30
|
+
},
|
31
|
+
});
|
31
32
|
},
|
32
33
|
{ identity: currentIdentity }
|
33
34
|
);
|
@@ -35,22 +36,23 @@ module.exports = function (RED) {
|
|
35
36
|
|
36
37
|
node.engine.registerOnIdentityChanged(async (identity) => {
|
37
38
|
if (subscription) {
|
38
|
-
client.
|
39
|
+
client.notification.removeSubscription(subscription, currentIdentity);
|
39
40
|
}
|
40
41
|
|
41
42
|
currentIdentity = identity;
|
42
43
|
|
43
44
|
subscription = await client.notification.onProcessStarted(
|
44
45
|
(processNotification) => {
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
46
|
+
if (config.processmodel != processNotification.processModelId) return;
|
47
|
+
node.send({
|
48
|
+
payload: {
|
49
|
+
processInstanceId: processNotification.processInstanceId,
|
50
|
+
flowNodeId: processNotification.flowNodeId,
|
51
|
+
token: processNotification.currentToken,
|
52
|
+
action: 'started',
|
53
|
+
type: 'processInstance',
|
54
|
+
},
|
55
|
+
});
|
54
56
|
},
|
55
57
|
{ identity: currentIdentity }
|
56
58
|
);
|
@@ -58,7 +60,7 @@ module.exports = function (RED) {
|
|
58
60
|
|
59
61
|
node.on('close', () => {
|
60
62
|
if (node.engine && node.engine.engineClient && client) {
|
61
|
-
client.
|
63
|
+
client.notification.removeSubscription(subscription, currentIdentity);
|
62
64
|
}
|
63
65
|
});
|
64
66
|
};
|