@5minds/node-red-contrib-processcube 1.1.2 → 1.1.3-feature-770fc4-m1higci1
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +2 -2
- package/usertask-input.js +35 -32
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@5minds/node-red-contrib-processcube",
|
3
|
-
"version": "1.1.
|
3
|
+
"version": "1.1.3-feature-770fc4-m1higci1",
|
4
4
|
"license": "MIT",
|
5
5
|
"description": "Node-RED nodes for ProcessCube",
|
6
6
|
"scripts": {
|
@@ -53,7 +53,7 @@
|
|
53
53
|
"examples": "examples"
|
54
54
|
},
|
55
55
|
"dependencies": {
|
56
|
-
"@5minds/processcube_engine_client": "
|
56
|
+
"@5minds/processcube_engine_client": "5.0.2-hotfix-243ebc-m1gf97ov",
|
57
57
|
"jwt-decode": "^4.0.0",
|
58
58
|
"openid-client": "^5.5.0"
|
59
59
|
},
|
package/usertask-input.js
CHANGED
@@ -20,42 +20,45 @@ module.exports = function (RED) {
|
|
20
20
|
...query
|
21
21
|
};
|
22
22
|
|
23
|
-
client.userTasks.query(query, { identity: engine.identity} )
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
if (config.
|
37
|
-
matchingFlowNodes.userTasks.
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
if (matchingFlowNodes.userTasks == 1) {
|
43
|
-
msg.payload = {
|
44
|
-
userTasks: matchingFlowNodes.userTasks,
|
45
|
-
};
|
46
|
-
node.send(msg);
|
23
|
+
client.userTasks.query(query, { identity: engine.identity} )
|
24
|
+
.then((matchingFlowNodes) => {
|
25
|
+
if (
|
26
|
+
!config.force_send_array &&
|
27
|
+
matchingFlowNodes &&
|
28
|
+
matchingFlowNodes.userTasks &&
|
29
|
+
matchingFlowNodes.userTasks.length == 1
|
30
|
+
) {
|
31
|
+
userTask = matchingFlowNodes.userTasks[0];
|
32
|
+
|
33
|
+
msg.payload = { userTask: userTask };
|
34
|
+
node.send(msg);
|
35
|
+
} else {
|
36
|
+
if (!config.force_send_array) {
|
37
|
+
if (config.multisend && matchingFlowNodes.userTasks && matchingFlowNodes.userTasks.length > 1) {
|
38
|
+
matchingFlowNodes.userTasks.forEach((userTask) => {
|
39
|
+
msg.payload = { userTask: userTask };
|
40
|
+
node.send(msg);
|
41
|
+
});
|
47
42
|
} else {
|
48
|
-
|
43
|
+
if (matchingFlowNodes.userTasks == 1) {
|
44
|
+
msg.payload = {
|
45
|
+
userTasks: matchingFlowNodes.userTasks,
|
46
|
+
};
|
47
|
+
node.send(msg);
|
48
|
+
} else {
|
49
|
+
node.log(`No user tasks found for query: ${JSON.stringify(query)}`);
|
50
|
+
}
|
49
51
|
}
|
52
|
+
} else {
|
53
|
+
msg.payload = {
|
54
|
+
userTasks: matchingFlowNodes.userTasks || [],
|
55
|
+
};
|
56
|
+
node.send(msg);
|
50
57
|
}
|
51
|
-
} else {
|
52
|
-
msg.payload = {
|
53
|
-
userTasks: matchingFlowNodes.userTasks || [],
|
54
|
-
};
|
55
|
-
node.send(msg);
|
56
58
|
}
|
57
|
-
}
|
58
|
-
|
59
|
+
}).catch((error) => {
|
60
|
+
node.error(error);
|
61
|
+
});
|
59
62
|
});
|
60
63
|
}
|
61
64
|
RED.nodes.registerType('usertask-input', UserTaskInput);
|