@5minds/node-red-contrib-processcube 1.7.5-feature-4ddcce-m6q6den1 → 1.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -8
- package/message-event-trigger.js +0 -3
- package/package.json +1 -1
- package/process-start.js +1 -4
- package/process-terminate.js +1 -3
- package/processcube-engine-config.js +2 -0
- package/processdefinition-deploy.js +1 -3
- package/processdefinition-query.js +0 -4
- package/processinstance-delete.js +2 -8
- package/processinstance-query.js +1 -3
- package/signal-event-trigger.js +0 -3
- package/usertask-input.js +1 -3
- package/usertask-output.js +1 -3
- package/wait-for-usertask.js +5 -9
package/README.md
CHANGED
@@ -25,19 +25,13 @@ To install and run the Node-RED flows, follow these steps:
|
|
25
25
|
cd processcube_nodered
|
26
26
|
```
|
27
27
|
|
28
|
-
3.
|
29
|
-
|
30
|
-
```bash
|
31
|
-
npm install
|
32
|
-
```
|
33
|
-
|
34
|
-
4. Build the Docker containers:
|
28
|
+
3. Build the Docker containers:
|
35
29
|
|
36
30
|
```bash
|
37
31
|
docker-compose build
|
38
32
|
```
|
39
33
|
|
40
|
-
|
34
|
+
4. Start the Docker containers:
|
41
35
|
|
42
36
|
```bash
|
43
37
|
docker-compose up -d
|
package/message-event-trigger.js
CHANGED
@@ -6,8 +6,6 @@ module.exports = function (RED) {
|
|
6
6
|
node.on('input', function (msg) {
|
7
7
|
node.engine = RED.nodes.getNode(config.engine);
|
8
8
|
const client = node.engine.engineClient;
|
9
|
-
const isUser = !!msg._client?.user
|
10
|
-
const userIdentity = isUser ? { userId: msg._client.user.id, token: msg._client.user.accessToken } : null;
|
11
9
|
|
12
10
|
if (!client) {
|
13
11
|
node.error('No engine configured.', msg);
|
@@ -18,7 +16,6 @@ module.exports = function (RED) {
|
|
18
16
|
.triggerMessageEvent(config.messagename, {
|
19
17
|
processInstanceId: msg.processinstanceid,
|
20
18
|
payload: msg.payload,
|
21
|
-
identity: userIdentity
|
22
19
|
})
|
23
20
|
.then((result) => {
|
24
21
|
msg.payload = result;
|
package/package.json
CHANGED
package/process-start.js
CHANGED
@@ -40,11 +40,8 @@ module.exports = function (RED) {
|
|
40
40
|
return;
|
41
41
|
}
|
42
42
|
|
43
|
-
const isUser = !!msg._client?.user
|
44
|
-
const identity = isUser ? { userId: msg._client.user.id, token: msg._client.user.accessToken } : null;
|
45
|
-
|
46
43
|
client.processDefinitions
|
47
|
-
.startProcessInstance(startParameters
|
44
|
+
.startProcessInstance(startParameters)
|
48
45
|
.then((result) => {
|
49
46
|
msg.payload = result;
|
50
47
|
|
package/process-terminate.js
CHANGED
@@ -6,8 +6,6 @@ module.exports = function (RED) {
|
|
6
6
|
node.on('input', function (msg) {
|
7
7
|
node.engine = RED.nodes.getNode(config.engine);
|
8
8
|
const client = node.engine.engineClient;
|
9
|
-
const isUser = !!msg._client?.user
|
10
|
-
const userIdentity = isUser ? { userId: msg._client.user.id, token: msg._client.user.accessToken } : null;
|
11
9
|
|
12
10
|
if (!client) {
|
13
11
|
node.error('No engine configured.', msg);
|
@@ -15,7 +13,7 @@ module.exports = function (RED) {
|
|
15
13
|
}
|
16
14
|
|
17
15
|
client.processInstances
|
18
|
-
.terminateProcessInstance(msg.payload
|
16
|
+
.terminateProcessInstance(msg.payload)
|
19
17
|
.then(() => {
|
20
18
|
node.send(msg);
|
21
19
|
})
|
@@ -6,8 +6,6 @@ module.exports = function (RED) {
|
|
6
6
|
node.on('input', function (msg) {
|
7
7
|
node.engine = RED.nodes.getNode(config.engine);
|
8
8
|
const client = node.engine.engineClient;
|
9
|
-
const isUser = !!msg._client?.user
|
10
|
-
const userIdentity = isUser ? { userId: msg._client.user.id, token: msg._client.user.accessToken } : null;
|
11
9
|
|
12
10
|
if (!client) {
|
13
11
|
node.error('No engine configured.');
|
@@ -15,7 +13,7 @@ module.exports = function (RED) {
|
|
15
13
|
}
|
16
14
|
|
17
15
|
client.processDefinitions
|
18
|
-
.persistProcessDefinitions(msg.payload, { overwriteExisting: true
|
16
|
+
.persistProcessDefinitions(msg.payload, { overwriteExisting: true })
|
19
17
|
.then(() => {
|
20
18
|
node.send(msg);
|
21
19
|
})
|
@@ -16,10 +16,6 @@ module.exports = function (RED) {
|
|
16
16
|
|
17
17
|
node.log(`Querying process definitions with query: ${JSON.stringify(query)}`);
|
18
18
|
|
19
|
-
const isUser = !!msg._client?.user
|
20
|
-
const identity = isUser ? { userId: msg._client.user.id, token: msg._client.user.accessToken } : null;
|
21
|
-
query.identity = identity;
|
22
|
-
|
23
19
|
client.processDefinitions
|
24
20
|
.getAll(query)
|
25
21
|
.then((matchingProcessDefinitions) => {
|
@@ -7,9 +7,6 @@ module.exports = function (RED) {
|
|
7
7
|
node.engine = RED.nodes.getNode(config.engine);
|
8
8
|
const client = node.engine ? node.engine.engineClient : null;
|
9
9
|
|
10
|
-
const isUser = !!msg._client?.user
|
11
|
-
const userIdentity = isUser ? { userId: msg._client.user.id, token: msg._client.user.accessToken } : null;
|
12
|
-
|
13
10
|
if (!client || !client.processInstances) {
|
14
11
|
node.error('No engine or processInstances API configured.', msg);
|
15
12
|
return;
|
@@ -67,10 +64,7 @@ module.exports = function (RED) {
|
|
67
64
|
state: ['finished', 'error', 'terminated'],
|
68
65
|
limit: batchSize,
|
69
66
|
},
|
70
|
-
{
|
71
|
-
includeXml: false,
|
72
|
-
identity: userIdentity
|
73
|
-
}
|
67
|
+
{ includeXml: false }
|
74
68
|
);
|
75
69
|
|
76
70
|
const processInstances = result.processInstances || [];
|
@@ -83,7 +77,7 @@ module.exports = function (RED) {
|
|
83
77
|
const ids = processInstances.map((obj) => obj.processInstanceId);
|
84
78
|
|
85
79
|
try {
|
86
|
-
await client.processInstances.deleteProcessInstances(ids, true
|
80
|
+
await client.processInstances.deleteProcessInstances(ids, true);
|
87
81
|
msg.payload.successfulDeletions.push(...ids);
|
88
82
|
sumSuccessful += ids.length;
|
89
83
|
} catch (deleteError) {
|
package/processinstance-query.js
CHANGED
@@ -8,8 +8,6 @@ module.exports = function (RED) {
|
|
8
8
|
|
9
9
|
node.engine = RED.nodes.getNode(config.engine);
|
10
10
|
const client = node.engine.engineClient;
|
11
|
-
const isUser = !!msg._client?.user
|
12
|
-
const userIdentity = isUser ? { userId: msg._client.user.id, token: msg._client.user.accessToken } : null;
|
13
11
|
|
14
12
|
if (!client) {
|
15
13
|
node.error('No engine configured.', msg);
|
@@ -17,7 +15,7 @@ module.exports = function (RED) {
|
|
17
15
|
}
|
18
16
|
|
19
17
|
client.processInstances
|
20
|
-
.query(query
|
18
|
+
.query(query)
|
21
19
|
.then((matchingInstances) => {
|
22
20
|
msg.payload = matchingInstances;
|
23
21
|
|
package/signal-event-trigger.js
CHANGED
@@ -7,8 +7,6 @@ module.exports = function (RED) {
|
|
7
7
|
node.engine = RED.nodes.getNode(config.engine);
|
8
8
|
|
9
9
|
const client = node.engine.engineClient;
|
10
|
-
const isUser = !!msg._client?.user
|
11
|
-
const userIdentity = isUser ? { userId: msg._client.user.id, token: msg._client.user.accessToken } : null;
|
12
10
|
|
13
11
|
if (!client) {
|
14
12
|
node.error('No engine configured.', msg);
|
@@ -19,7 +17,6 @@ module.exports = function (RED) {
|
|
19
17
|
.triggerSignalEvent(config.signalname, {
|
20
18
|
processInstanceId: msg.processinstanceid,
|
21
19
|
payload: msg.payload,
|
22
|
-
identity: userIdentity
|
23
20
|
})
|
24
21
|
.then((result) => {
|
25
22
|
msg.payload = result;
|
package/usertask-input.js
CHANGED
@@ -7,8 +7,6 @@ module.exports = function (RED) {
|
|
7
7
|
node.engine = RED.nodes.getNode(config.engine);
|
8
8
|
|
9
9
|
const client = node.engine.engineClient;
|
10
|
-
const isUser = !!msg._client?.user
|
11
|
-
const userIdentity = isUser ? { userId: msg._client.user.id, token: msg._client.user.accessToken } : null;
|
12
10
|
|
13
11
|
if (!client) {
|
14
12
|
node.error('No engine configured.', msg);
|
@@ -18,7 +16,7 @@ module.exports = function (RED) {
|
|
18
16
|
let query = RED.util.evaluateNodeProperty(config.query, config.query_type, node, msg);
|
19
17
|
|
20
18
|
client.userTasks
|
21
|
-
.query(query
|
19
|
+
.query(query)
|
22
20
|
.then((matchingFlowNodes) => {
|
23
21
|
if (config.sendtype === 'array') {
|
24
22
|
msg.payload = { userTasks: matchingFlowNodes.userTasks || [] };
|
package/usertask-output.js
CHANGED
@@ -17,8 +17,6 @@ module.exports = function (RED) {
|
|
17
17
|
node.engine = RED.nodes.getNode(config.engine);
|
18
18
|
|
19
19
|
const client = node.engine.engineClient;
|
20
|
-
const isUser = !!msg._client?.user
|
21
|
-
const userIdentity = isUser ? { userId: msg._client.user.id, token: msg._client.user.accessToken } : null;
|
22
20
|
|
23
21
|
if (!client) {
|
24
22
|
node.error('No engine configured.', msg);
|
@@ -26,7 +24,7 @@ module.exports = function (RED) {
|
|
26
24
|
}
|
27
25
|
|
28
26
|
client.userTasks
|
29
|
-
.finishUserTask(flowNodeInstanceId, userTaskResult
|
27
|
+
.finishUserTask(flowNodeInstanceId, userTaskResult)
|
30
28
|
.then(() => {
|
31
29
|
node.send(msg);
|
32
30
|
})
|
package/wait-for-usertask.js
CHANGED
@@ -10,8 +10,6 @@ module.exports = function (RED) {
|
|
10
10
|
|
11
11
|
node.on('input', async function (msg) {
|
12
12
|
const client = node.engine.engineClient;
|
13
|
-
const isUser = !!msg._client?.user
|
14
|
-
const userIdentity = isUser ? { userId: msg._client.user.id, token: msg._client.user.accessToken } : null;
|
15
13
|
subscribe = async () => {
|
16
14
|
if (!client) {
|
17
15
|
node.error('No engine configured.', msg);
|
@@ -27,11 +25,11 @@ module.exports = function (RED) {
|
|
27
25
|
};
|
28
26
|
|
29
27
|
try {
|
30
|
-
const matchingFlowNodes = await client.userTasks.query(newQuery
|
28
|
+
const matchingFlowNodes = await client.userTasks.query(newQuery);
|
31
29
|
|
32
30
|
if (matchingFlowNodes.userTasks && matchingFlowNodes.userTasks.length == 1) {
|
33
31
|
// remove subscription
|
34
|
-
client.userTasks.removeSubscription(subscription
|
32
|
+
client.userTasks.removeSubscription(subscription);
|
35
33
|
|
36
34
|
const userTask = matchingFlowNodes.userTasks[0];
|
37
35
|
|
@@ -43,8 +41,6 @@ module.exports = function (RED) {
|
|
43
41
|
} catch (error) {
|
44
42
|
node.error(error, msg);
|
45
43
|
}
|
46
|
-
},{
|
47
|
-
identity: userIdentity,
|
48
44
|
});
|
49
45
|
|
50
46
|
node.log({ 'Handling old userTasks config.only_for_new': config.only_for_new });
|
@@ -57,7 +53,7 @@ module.exports = function (RED) {
|
|
57
53
|
};
|
58
54
|
|
59
55
|
try {
|
60
|
-
const matchingFlowNodes = await client.userTasks.query(suspendedQuery
|
56
|
+
const matchingFlowNodes = await client.userTasks.query(suspendedQuery);
|
61
57
|
|
62
58
|
if (matchingFlowNodes.userTasks && matchingFlowNodes.userTasks.length >= 1) {
|
63
59
|
const userTask = matchingFlowNodes.userTasks[0];
|
@@ -66,7 +62,7 @@ module.exports = function (RED) {
|
|
66
62
|
node.send(msg);
|
67
63
|
|
68
64
|
// remove subscription
|
69
|
-
client.userTasks.removeSubscription(subscription
|
65
|
+
client.userTasks.removeSubscription(subscription);
|
70
66
|
} else {
|
71
67
|
// let the *currentIdentity* be active
|
72
68
|
}
|
@@ -81,7 +77,7 @@ module.exports = function (RED) {
|
|
81
77
|
|
82
78
|
node.on('close', () => {
|
83
79
|
if (client != null && subscription != null) {
|
84
|
-
client.userTasks.removeSubscription(subscription
|
80
|
+
client.userTasks.removeSubscription(subscription);
|
85
81
|
}
|
86
82
|
});
|
87
83
|
}
|