@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@5minds/node-red-contrib-processcube",
3
- "version": "1.1.4-feature-3050c0-m04ysmbf",
3
+ "version": "1.1.4-feature-e9faa8-m04zlkr3",
4
4
  "license": "MIT",
5
5
  "description": "Node-RED nodes for ProcessCube",
6
6
  "scripts": {
@@ -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
- // node.send({
23
- // payload: {
24
- // flowNodeInstanceId: userTaskWaitingNotification.flowNodeInstanceId,
25
- // userTaskEvent: userTaskWaitingNotification,
26
- // action: 'new',
27
- // type: 'usertask',
28
- // },
29
- // });
30
- console.log(processNotification);
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.notifications.removeSubscription(subscription, currentIdentity);
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
- // node.send({
46
- // payload: {
47
- // flowNodeInstanceId: userTaskWaitingNotification.flowNodeInstanceId,
48
- // userTaskEvent: userTaskWaitingNotification,
49
- // action: 'new',
50
- // type: 'usertask',
51
- // },
52
- // });
53
- console.log(processNotification);
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.notifications.removeSubscription(subscription, currentIdentity);
63
+ client.notification.removeSubscription(subscription, currentIdentity);
62
64
  }
63
65
  });
64
66
  };