@5minds/node-red-contrib-processcube 1.7.4-feature-07cad4-m6jljf8p → 1.7.4-feature-da60e6-m6kk6nga
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/package.json +1 -1
- package/process-start.js +4 -8
package/package.json
CHANGED
package/process-start.js
CHANGED
@@ -35,22 +35,18 @@ module.exports = function (RED) {
|
|
35
35
|
}
|
36
36
|
|
37
37
|
node.engine = RED.nodes.getNode(config.engine);
|
38
|
-
const
|
39
|
-
|
40
|
-
var client = engineClientExternalSecret;
|
38
|
+
const client = node.engine.engineClient;
|
41
39
|
|
42
40
|
if (!client) {
|
43
41
|
node.error('No engine configured.', msg);
|
44
42
|
return;
|
45
43
|
}
|
46
44
|
|
47
|
-
|
48
|
-
|
49
|
-
client = new engine_client.EngineClient(engineClientExternalSecret.engineUrl, identity);
|
50
|
-
}
|
45
|
+
const isUser = !!msg._client.user
|
46
|
+
const identity = isUser ? { userId: msg._client.user.id, token: msg._client.user.accessToken } : null;
|
51
47
|
|
52
48
|
client.processDefinitions
|
53
|
-
.startProcessInstance(startParameters)
|
49
|
+
.startProcessInstance(startParameters, identity)
|
54
50
|
.then((result) => {
|
55
51
|
msg.payload = result;
|
56
52
|
|