@5minds/node-red-contrib-processcube 1.7.4-feature-6f3f78-m6l0ykww → 1.7.4
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/.processcube/nodered/.config.nodes.json +1 -1
- package/.processcube/nodered/.config.users.json +1 -1
- package/.processcube/nodered/config.js +3 -2
- package/.processcube/nodered/settings.js +1 -1
- package/README.md +2 -8
- package/doc_generator/generator.js +5 -5
- package/doc_generator/generator_with_swagger.js +78 -80
- package/endevent-finished-listener.html +16 -16
- package/externaltask-error.html +11 -11
- package/externaltask-error.js +3 -5
- package/externaltask-event-listener.html +9 -9
- package/externaltask-input.html +26 -26
- package/externaltask-input.js +8 -6
- package/externaltask-output.html +7 -7
- package/externaltask-output.js +1 -1
- package/message-event-trigger.html +8 -8
- package/message-event-trigger.js +0 -3
- package/package.json +2 -5
- package/process-event-listener.html +74 -74
- package/process-event-listener.js +2 -1
- package/process-start.html +12 -12
- package/process-start.js +3 -6
- package/process-terminate.html +9 -9
- package/process-terminate.js +1 -3
- package/processcube-engine-config.html +8 -8
- package/processcube-engine-config.js +2 -0
- package/processdefinition-deploy.html +9 -9
- package/processdefinition-deploy.js +2 -4
- package/processdefinition-query.html +140 -139
- package/processdefinition-query.js +0 -4
- package/processinstance-delete.html +46 -48
- package/processinstance-delete.js +9 -24
- package/processinstance-query.html +119 -120
- package/processinstance-query.js +1 -3
- package/signal-event-trigger.html +9 -8
- package/signal-event-trigger.js +0 -3
- package/usertask-event-listener.html +127 -126
- package/usertask-input.html +125 -126
- package/usertask-input.js +1 -3
- package/usertask-output.html +7 -7
- package/usertask-output.js +2 -5
- package/wait-for-usertask.html +164 -173
- package/wait-for-usertask.js +25 -36
@@ -1,3 +1,4 @@
|
|
1
|
+
|
1
2
|
// let cause of merge custom settings
|
2
3
|
|
3
4
|
let config = {};
|
@@ -5,7 +6,7 @@ let config = {};
|
|
5
6
|
try {
|
6
7
|
config = require('./settings.js');
|
7
8
|
} catch (e) {
|
8
|
-
console.log(
|
9
|
+
console.log(">>>", e);
|
9
10
|
}
|
10
11
|
|
11
12
|
process.on('uncaughtException', (err) => {
|
@@ -14,6 +15,6 @@ process.on('uncaughtException', (err) => {
|
|
14
15
|
|
15
16
|
process.on('unhandledRejection', (reason, promise) => {
|
16
17
|
console.error(`Unhandled Rejection at ${promise} reason: ${reason}`, {});
|
17
|
-
});
|
18
|
+
});
|
18
19
|
|
19
20
|
module.exports = config;
|
@@ -383,7 +383,7 @@ module.exports = {
|
|
383
383
|
|
384
384
|
header: {
|
385
385
|
title: ' powers by Node-RED',
|
386
|
-
image:
|
386
|
+
image: "/data/static/ProcessCube_Logo.svg",
|
387
387
|
url: 'https://processcube.io', // optional url to make the header text/image a link to this url
|
388
388
|
},
|
389
389
|
palette: {
|
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
|
@@ -1,14 +1,14 @@
|
|
1
1
|
const Mustache = require('mustache');
|
2
2
|
const fs = require('fs');
|
3
3
|
|
4
|
-
const swaggerFilename = '../../ProcessCube.Engine/docs/swagger/swagger.json';
|
4
|
+
const swaggerFilename = '../../ProcessCube.Engine/docs/swagger/swagger.json'; // Dateiname der Swagger-Datei
|
5
5
|
|
6
6
|
const swaggerJson = JSON.parse(fs.readFileSync(swaggerFilename, 'utf-8'));
|
7
7
|
|
8
8
|
//console.log(Object.keys(swaggerJson.paths));
|
9
9
|
//return
|
10
10
|
|
11
|
-
const apiPath = '/process_instances/query';
|
11
|
+
const apiPath = '/process_instances/query'; // Die API-Route, die du dokumentieren möchtest
|
12
12
|
const routeData = swaggerJson.paths[apiPath];
|
13
13
|
|
14
14
|
if (routeData) {
|
@@ -20,14 +20,14 @@ if (routeData) {
|
|
20
20
|
// API-Route-Information vorbereiten
|
21
21
|
const apiRouteData = {
|
22
22
|
path: apiPath,
|
23
|
-
method: Object.keys(routeData)[0],
|
23
|
+
method: Object.keys(routeData)[0], // z.B. GET, POST, etc.
|
24
24
|
summary: routeData[Object.keys(routeData)[0]].summary,
|
25
25
|
description: routeData[Object.keys(routeData)[0]].description,
|
26
26
|
parameters: routeData[Object.keys(routeData)[0]].parameters || [],
|
27
27
|
responses: Object.entries(routeData[Object.keys(routeData)[0]].responses).map(([status, response]) => ({
|
28
28
|
status,
|
29
|
-
description: response.description
|
30
|
-
}))
|
29
|
+
description: response.description
|
30
|
+
}))
|
31
31
|
};
|
32
32
|
|
33
33
|
// Mustache-Template einlesen
|
@@ -6,86 +6,84 @@ const SwaggerParser = require('swagger-parser');
|
|
6
6
|
//const swaggerFilename = '../../ProcessCube.Engine/docs/swagger/swagger.json'; // Dateiname der Swagger-Datei
|
7
7
|
//const swaggerFilename = 'swagger.json'; // Dateiname der Swagger-Datei
|
8
8
|
|
9
|
-
SwaggerParser.dereference('http://localhost:56100/atlas_engine/api/v1/swagger')
|
10
|
-
//SwaggerParser.dereference(swaggerFilename)
|
11
|
-
.then((swaggerJson) => {
|
12
|
-
console.log('Dereferenced API:', swaggerJson);
|
13
9
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
}
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
}
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
});
|
10
|
+
SwaggerParser.dereference("http://localhost:56100/atlas_engine/api/v1/swagger")
|
11
|
+
//SwaggerParser.dereference(swaggerFilename)
|
12
|
+
.then(swaggerJson => {
|
13
|
+
console.log('Dereferenced API:', swaggerJson);
|
14
|
+
|
15
|
+
const apiPaths = [{
|
16
|
+
"ProcessInstance Query": {
|
17
|
+
"path": "/process_instances/query",
|
18
|
+
"method": "get"
|
19
|
+
},
|
20
|
+
"UserTasks Input": {
|
21
|
+
"path": "/process_instances/query",
|
22
|
+
"method": "get"
|
23
|
+
},
|
24
|
+
"Wait for UserTask": {
|
25
|
+
"path": "/process_instances/query",
|
26
|
+
"method": "get"
|
27
|
+
},
|
28
|
+
"UserTask Event Listener": {
|
29
|
+
"path": "/process_instances/query",
|
30
|
+
"method": "get"
|
31
|
+
}
|
32
|
+
}];
|
33
|
+
|
34
|
+
apiPaths.forEach(apiEntry => {
|
35
|
+
console.log('API Entry:', apiEntry);
|
36
|
+
console.log('API Entry Keys:', Object.keys(apiEntry));
|
37
|
+
|
38
|
+
Object.keys(apiEntry).forEach(apiName => {
|
39
|
+
console.log('API Name:', apiName);
|
40
|
+
console.log('API Data:', apiEntry[apiName]);
|
41
|
+
|
42
|
+
let apiPath = apiEntry[apiName].path; // Die API-Route, die du dokumentieren möchtest
|
43
|
+
|
44
|
+
//let apiPath = '/process_instances/query'; // Die API-Route, die du dokumentieren möchtest
|
45
|
+
const routeData = swaggerJson.paths[apiPath];
|
46
|
+
|
47
|
+
if (routeData) {
|
48
|
+
console.log(`Details for ${apiPath}:`, routeData);
|
49
|
+
} else {
|
50
|
+
console.error(`Route ${apiPath} not found in Swagger documentation.`);
|
51
|
+
}
|
52
|
+
|
53
|
+
let description = routeData[Object.keys(routeData)[0]].description;
|
54
|
+
|
55
|
+
description = `Filter result for '${apiName}'`;
|
56
|
+
|
57
|
+
// API-Route-Information vorbereiten
|
58
|
+
const apiRouteData = {
|
59
|
+
path: apiPath,
|
60
|
+
method: Object.keys(routeData)[0], // z.B. GET, POST, etc.
|
61
|
+
summary: routeData[Object.keys(routeData)[0]].summary,
|
62
|
+
description: description,
|
63
|
+
parameters: routeData[Object.keys(routeData)[0]].parameters || [],
|
64
|
+
responses: Object.entries(routeData[Object.keys(routeData)[0]].responses).map(([status, response]) => ({
|
65
|
+
status,
|
66
|
+
description: response.description
|
67
|
+
}))
|
68
|
+
};
|
69
|
+
|
70
|
+
// Mustache-Template einlesen
|
71
|
+
const template = fs.readFileSync('query_template.mustache', 'utf-8');
|
72
|
+
|
73
|
+
// Mustache-Rendering
|
74
|
+
const output = Mustache.render(template, apiRouteData);
|
75
|
+
|
76
|
+
// Ausgabe in eine Datei schreiben oder anzeigen
|
77
|
+
//console.log(output);
|
78
|
+
|
79
|
+
const outputFilename = apiName.replace(/\/ /g, '_') + '.md';
|
80
|
+
console.log(`Writing output to ${outputFilename}`);
|
81
|
+
|
82
|
+
fs.writeFileSync(`outputs/${outputFilename}`, output);
|
87
83
|
});
|
88
|
-
})
|
89
|
-
.catch((err) => {
|
90
|
-
console.error('Dereferencing failed:', err);
|
91
84
|
});
|
85
|
+
|
86
|
+
})
|
87
|
+
.catch(err => {
|
88
|
+
console.error('Dereferencing failed:', err);
|
89
|
+
});
|
@@ -27,24 +27,24 @@
|
|
27
27
|
</script>
|
28
28
|
|
29
29
|
<script type="text/markdown" data-help-name="endevent-finished-listener">
|
30
|
-
|
30
|
+
Waiting for end events that are finished.
|
31
31
|
|
32
|
-
|
32
|
+
## Outputs
|
33
33
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
34
|
+
: correlationId (string): The unique identifier for the correlation.
|
35
|
+
: processDefinitionId (string): The identifier for the process definition.
|
36
|
+
: processModelId (string): The identifier for the process model.
|
37
|
+
: processModelName (string): The name of the process model.
|
38
|
+
: processInstanceId (string): The unique identifier for the process instance.
|
39
|
+
: flowNodeId (string): The identifier for the flow node.
|
40
|
+
: flowNodeName (string): The name of the flow node.
|
41
|
+
: flowNodeInstanceId (string): The unique identifier for the flow node instance.
|
42
|
+
: previousFlowNodeInstanceId (string): The unique identifier for the previous flow node instance.
|
43
|
+
: ownerId (string): The identifier of the owner.
|
44
|
+
: currentToken (Object): An object representing the current token.
|
45
45
|
|
46
|
-
|
46
|
+
### References
|
47
47
|
|
48
|
-
|
49
|
-
|
48
|
+
- [The ProcessCube© Developer Network](https://processcube.io) - All documentation for the ProcessCube© platform
|
49
|
+
- [ProcessCube© LowCode Integration](https://processcube.io/docs/node-red) - LowCode integration in ProcessCube©
|
50
50
|
</script>
|
package/externaltask-error.html
CHANGED
@@ -28,19 +28,19 @@
|
|
28
28
|
</script>
|
29
29
|
|
30
30
|
<script type="text/markdown" data-help-name="externaltask-error">
|
31
|
-
|
32
|
-
|
33
|
-
|
31
|
+
Used for reporting errors in the processing of external tasks. The error
|
32
|
+
code `Error` in the configuration is forwarded to the ProcessCube engine for
|
33
|
+
handling within _Error-Boundary-Events_.
|
34
34
|
|
35
|
-
|
35
|
+
## Inputs
|
36
36
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
37
|
+
: msg (Object) : Passed as `ErrorDetails` to the engine
|
38
|
+
: Error (string) : From the configuration
|
39
|
+
: Message (string) : The caught exception message
|
40
|
+
: StackTrace (string) : The stack trace of the exception
|
41
41
|
|
42
|
-
|
42
|
+
### References
|
43
43
|
|
44
|
-
|
45
|
-
|
44
|
+
- [The ProcessCube© Developer Network](https://processcube.io) - All documentation for the ProcessCube© platform
|
45
|
+
- [ProcessCube© LowCode Integration](https://processcube.io/docs/node-red) - LowCode integration in ProcessCube©
|
46
46
|
</script>
|
package/externaltask-error.js
CHANGED
@@ -12,8 +12,8 @@ module.exports = function (RED) {
|
|
12
12
|
if (!eventEmitter) {
|
13
13
|
flowContext.set('emitter', new EventEmitter());
|
14
14
|
eventEmitter = flowContext.get('emitter');
|
15
|
-
}
|
16
|
-
|
15
|
+
}
|
16
|
+
|
17
17
|
const flowNodeInstanceId = msg.flowNodeInstanceId;
|
18
18
|
|
19
19
|
let msgError = msg.error;
|
@@ -29,9 +29,7 @@ module.exports = function (RED) {
|
|
29
29
|
msg.errorCode = config.error;
|
30
30
|
msg.errorMessage = msgError.message;
|
31
31
|
|
32
|
-
node.log(
|
33
|
-
`handle-${flowNodeInstanceId}: *flowNodeInstanceId* '${flowNodeInstanceId}' with *msg._msgid* '${msg._msgid}'`,
|
34
|
-
);
|
32
|
+
node.log(`handle-${flowNodeInstanceId}: *flowNodeInstanceId* '${flowNodeInstanceId}' with *msg._msgid* '${msg._msgid}'`);
|
35
33
|
|
36
34
|
eventEmitter.emit(`handle-${flowNodeInstanceId}`, error, true);
|
37
35
|
|
@@ -41,17 +41,17 @@
|
|
41
41
|
</script>
|
42
42
|
|
43
43
|
<script type="text/markdown" data-help-name="externaltask-event-listener">
|
44
|
-
|
44
|
+
A node which listens for events triggered by externaltasks
|
45
45
|
|
46
|
-
|
46
|
+
## Outputs
|
47
47
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
48
|
+
: flowNodeInstanceId (string): The unique identifier for the flow node instance.
|
49
|
+
: externalTaskEvent (Object): An Object containing the event data returned by the engine.
|
50
|
+
: action (string): The event that occured.
|
51
|
+
: type (string): The target of the event.
|
52
52
|
|
53
|
-
|
53
|
+
### References
|
54
54
|
|
55
|
-
|
56
|
-
|
55
|
+
- [The ProcessCube© Developer Network](https://processcube.io) - All documentation for the ProcessCube© platform
|
56
|
+
- [ProcessCube© LowCode Integration](https://processcube.io/docs/node-red) - LowCode integration in ProcessCube©
|
57
57
|
</script>
|
package/externaltask-input.html
CHANGED
@@ -7,8 +7,8 @@
|
|
7
7
|
engine: { value: '', type: 'processcube-engine-config' },
|
8
8
|
topic: { value: '' },
|
9
9
|
topicType: { value: '' },
|
10
|
-
workerConfig: { value: '{}'
|
11
|
-
workerConfigType: { value: 'json'
|
10
|
+
workerConfig: { value: '{}'},
|
11
|
+
workerConfigType: { value: 'json'}
|
12
12
|
},
|
13
13
|
inputs: 0,
|
14
14
|
outputs: 1,
|
@@ -36,7 +36,7 @@
|
|
36
36
|
oneditsave: function () {
|
37
37
|
this.workerConfig = $('#node-input-workerConfig').typedInput('value');
|
38
38
|
if (this.workerConfig == '') {
|
39
|
-
this.workerConfig = '{}'
|
39
|
+
this.workerConfig = '{}'
|
40
40
|
$('#node-input-workerConfig').typedInput('value', '{}');
|
41
41
|
}
|
42
42
|
this.workerConfigType = $('#node-input-workerConfig').typedInput('type');
|
@@ -66,37 +66,37 @@
|
|
66
66
|
</script>
|
67
67
|
|
68
68
|
<script type="text/markdown" data-help-name="externaltask-input">
|
69
|
-
|
70
|
-
|
69
|
+
Waiting for external tasks that correspond to the `Topic` configured in
|
70
|
+
the connected ProcessCube Engine for processing.
|
71
71
|
|
72
|
-
|
72
|
+
## Configs
|
73
73
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
74
|
+
: name (string) : The name of the node
|
75
|
+
: engine (string) : The ProcessCube Engine to connect to
|
76
|
+
: topic (string) : The topic of the external task
|
77
|
+
: workerConfig (object) : The configuration for the worker
|
78
78
|
|
79
|
-
|
79
|
+
### workerConfig
|
80
80
|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
81
|
+
- workerId (string): The id of the worker
|
82
|
+
- lockDuration (number): The duration in milliseconds the external task is locked for execution
|
83
|
+
- maxTasks (number): The maximum number of tasks that can be fetched at once
|
84
|
+
- longpollingTimeout (number): The duration in milliseconds the external task is locked for execution
|
85
|
+
- payloadFilter (Req-Expression): The filter for the payload of the external task
|
86
86
|
|
87
|
-
|
87
|
+
## Outputs
|
88
88
|
|
89
|
-
|
90
|
-
|
91
|
-
|
89
|
+
: payload (string) : The payload the external task was started with.
|
90
|
+
: task (object) : The external task object
|
91
|
+
: flowNodeInstanceId (string) : The unique identifier of the external task, which is needed to complete the task
|
92
92
|
|
93
|
-
|
93
|
+
### Details
|
94
94
|
|
95
|
-
|
96
|
-
|
95
|
+
- To finish the external task the `externaltask-output` node is required.
|
96
|
+
- For handling a error while executing a flow as external task the `externaltask-error` node is required.
|
97
97
|
|
98
|
-
|
98
|
+
### References
|
99
99
|
|
100
|
-
|
101
|
-
|
100
|
+
- [The ProcessCube© Developer Network](https://processcube.io) - All documentation for the ProcessCube© platform
|
101
|
+
- [ProcessCube© LowCode Integration](https://processcube.io/docs/node-red) - LowCode integration in ProcessCube©
|
102
102
|
</script>
|
package/externaltask-input.js
CHANGED
@@ -10,6 +10,7 @@ function showStatus(node, msgCounter) {
|
|
10
10
|
}
|
11
11
|
}
|
12
12
|
|
13
|
+
|
13
14
|
module.exports = function (RED) {
|
14
15
|
function ExternalTaskInput(config) {
|
15
16
|
RED.nodes.createNode(this, config);
|
@@ -18,6 +19,7 @@ module.exports = function (RED) {
|
|
18
19
|
|
19
20
|
node.started_external_tasks = {};
|
20
21
|
|
22
|
+
|
21
23
|
node.engine = RED.nodes.getNode(config.engine);
|
22
24
|
|
23
25
|
var eventEmitter = flowContext.get('emitter');
|
@@ -60,7 +62,7 @@ module.exports = function (RED) {
|
|
60
62
|
delete result.msg;
|
61
63
|
|
62
64
|
node.log(
|
63
|
-
`handle event for *external task flowNodeInstanceId* '${externalTask.flowNodeInstanceId}' and *processInstanceId* ${externalTask.processInstanceId} with result ${JSON.stringify(result)} on msg._msgid ${msg._msgid}
|
65
|
+
`handle event for *external task flowNodeInstanceId* '${externalTask.flowNodeInstanceId}' and *processInstanceId* ${externalTask.processInstanceId} with result ${JSON.stringify(result)} on msg._msgid ${msg._msgid}.`
|
64
66
|
);
|
65
67
|
|
66
68
|
if (externalTask.flowNodeInstanceId) {
|
@@ -75,7 +77,7 @@ module.exports = function (RED) {
|
|
75
77
|
|
76
78
|
const handleErrorTask = (msg) => {
|
77
79
|
node.log(
|
78
|
-
`handle error event for *external task flowNodeInstanceId* '${externalTask.flowNodeInstanceId}' and *processInstanceId* '${externalTask.processInstanceId}' on *msg._msgid* '${msg._msgid}'
|
80
|
+
`handle error event for *external task flowNodeInstanceId* '${externalTask.flowNodeInstanceId}' and *processInstanceId* '${externalTask.processInstanceId}' on *msg._msgid* '${msg._msgid}'.`
|
79
81
|
);
|
80
82
|
|
81
83
|
if (externalTask.flowNodeInstanceId) {
|
@@ -93,7 +95,7 @@ module.exports = function (RED) {
|
|
93
95
|
|
94
96
|
eventEmitter.once(`handle-${externalTask.flowNodeInstanceId}`, (msg, isError = false) => {
|
95
97
|
node.log(
|
96
|
-
`handle event for *external task flowNodeInstanceId* '${externalTask.flowNodeInstanceId}' and *processInstanceId* '${externalTask.processInstanceId}' with *msg._msgid* '${msg._msgid}' and *isError* '${isError}'
|
98
|
+
`handle event for *external task flowNodeInstanceId* '${externalTask.flowNodeInstanceId}' and *processInstanceId* '${externalTask.processInstanceId}' with *msg._msgid* '${msg._msgid}' and *isError* '${isError}'`
|
97
99
|
);
|
98
100
|
|
99
101
|
if (isError) {
|
@@ -116,7 +118,7 @@ module.exports = function (RED) {
|
|
116
118
|
};
|
117
119
|
|
118
120
|
node.log(
|
119
|
-
`Received *external task flowNodeInstanceId* '${externalTask.flowNodeInstanceId}' and *processInstanceId* '${externalTask.processInstanceId}' with *msg._msgid* '${msg._msgid}'
|
121
|
+
`Received *external task flowNodeInstanceId* '${externalTask.flowNodeInstanceId}' and *processInstanceId* '${externalTask.processInstanceId}' with *msg._msgid* '${msg._msgid}'`
|
120
122
|
);
|
121
123
|
|
122
124
|
node.send(msg);
|
@@ -124,7 +126,7 @@ module.exports = function (RED) {
|
|
124
126
|
};
|
125
127
|
|
126
128
|
let options = RED.util.evaluateNodeProperty(config.workerConfig, config.workerConfigType, node);
|
127
|
-
let topic =
|
129
|
+
let topic = RED.util.evaluateNodeProperty(config.topic, config.topicType, node)
|
128
130
|
|
129
131
|
client.externalTasks
|
130
132
|
.subscribeToExternalTaskTopic(topic, etwCallback, options)
|
@@ -144,7 +146,7 @@ module.exports = function (RED) {
|
|
144
146
|
case 'processExternalTask':
|
145
147
|
node.error(
|
146
148
|
`Worker error ${errorType} for *external task flowNodeInstanceId* '${externalTask.flowNodeInstanceId}' and *processInstanceId* '${externalTask.processInstanceId}': ${error.message}`,
|
147
|
-
{}
|
149
|
+
{}
|
148
150
|
);
|
149
151
|
|
150
152
|
if (externalTask) {
|
package/externaltask-output.html
CHANGED
@@ -22,15 +22,15 @@
|
|
22
22
|
</script>
|
23
23
|
|
24
24
|
<script type="text/markdown" data-help-name="externaltask-output">
|
25
|
-
|
26
|
-
|
25
|
+
Used to complete the external task. The `msg.payload` is returned to the ProcessCube
|
26
|
+
engine as the result of the external task.
|
27
27
|
|
28
|
-
|
28
|
+
## Inputs
|
29
29
|
|
30
|
-
|
30
|
+
: payload (Object) : Returned to the ProcessCube engine as the result of the external task
|
31
31
|
|
32
|
-
|
32
|
+
### References
|
33
33
|
|
34
|
-
|
35
|
-
|
34
|
+
- [The ProcessCube© Developer Network](https://processcube.io) - All documentation for the ProcessCube© platform
|
35
|
+
- [ProcessCube© LowCode Integration](https://processcube.io/docs/node-red) - LowCode integration in ProcessCube©
|
36
36
|
</script>
|
package/externaltask-output.js
CHANGED
@@ -12,7 +12,7 @@ module.exports = function (RED) {
|
|
12
12
|
if (!eventEmitter) {
|
13
13
|
flowContext.set('emitter', new EventEmitter());
|
14
14
|
eventEmitter = flowContext.get('emitter');
|
15
|
-
}
|
15
|
+
}
|
16
16
|
|
17
17
|
const flowNodeInstanceId = msg.flowNodeInstanceId;
|
18
18
|
const processInstanceId = msg.processInstanceId;
|
@@ -32,17 +32,17 @@
|
|
32
32
|
</script>
|
33
33
|
|
34
34
|
<script type="text/markdown" data-help-name="externaltask-input">
|
35
|
-
|
35
|
+
A node to trigger an event that will be send to the corresponding intermediate message event in the connected ProcessCube Engine.
|
36
36
|
|
37
|
-
|
37
|
+
From the config the `messagename` and the `processInstanceId` must be set.
|
38
38
|
|
39
|
-
|
39
|
+
## Inputs
|
40
40
|
|
41
|
-
|
42
|
-
|
41
|
+
: payload (Object) : The payload will be sent to the message event and be used as a new token payload.
|
42
|
+
: processInstanceId (string) : The process instance where the message event should be triggered.
|
43
43
|
|
44
|
-
|
44
|
+
### References
|
45
45
|
|
46
|
-
|
47
|
-
|
46
|
+
- [The ProcessCube© Developer Network](https://processcube.io) - All documentation for the ProcessCube© platform
|
47
|
+
- [ProcessCube© LowCode Integration](https://processcube.io/docs/node-red) - LowCode integration in ProcessCube©
|
48
48
|
</script>
|
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;
|