@5minds/node-red-contrib-processcube 2.0.0-feature-629c78-m2dq1ygt → 7.6.0-develop-51b534-mjy4rzoh
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 +3 -58
- package/check-authorization.html +138 -0
- package/check-authorization.js +27 -0
- package/dataobject-instance-query.html +141 -0
- package/dataobject-instance-query.js +45 -0
- package/endevent-finished-listener.js +14 -25
- package/examples/Check-Authorization-Sample.json +109 -0
- package/examples/Dataobject-Instance-Query-Sample.json +109 -0
- package/externaltask-error.html +8 -3
- package/externaltask-error.js +43 -29
- package/externaltask-event-listener.js +11 -28
- package/externaltask-input.html +48 -3
- package/externaltask-input.js +581 -114
- package/externaltask-output.js +20 -16
- package/icons/data-object-query.svg +5 -0
- package/message-event-trigger.html +1 -1
- package/message-event-trigger.js +8 -7
- package/package.json +74 -67
- package/process-event-listener.js +166 -225
- package/process-start.html +6 -0
- package/process-start.js +29 -6
- package/process-terminate.html +1 -1
- package/process-terminate.js +7 -5
- package/processcube-engine-config.html +25 -7
- package/processcube-engine-config.js +25 -135
- package/processcube-google-docs-mail-template.html +150 -0
- package/processcube-google-docs-mail-template.js +158 -0
- package/processdefinition-deploy.html +44 -0
- package/processdefinition-deploy.js +28 -0
- package/processdefinition-query.html +18 -13
- package/processdefinition-query.js +33 -31
- package/processinstance-delete-advanced.html +82 -0
- package/processinstance-delete-advanced.js +33 -0
- package/processinstance-delete.html +60 -8
- package/processinstance-delete.js +84 -30
- package/processinstance-query.html +116 -109
- package/processinstance-query.js +28 -5
- package/signal-event-trigger.js +8 -6
- package/usertask-event-listener.html +123 -1
- package/usertask-event-listener.js +30 -45
- package/usertask-input.html +119 -0
- package/usertask-input.js +7 -9
- package/usertask-output.js +15 -8
- package/wait-for-usertask.html +122 -6
- package/wait-for-usertask.js +44 -47
- package/.github/workflows/build-and-publish.yml +0 -72
- package/.processcube/authority/config/config.json +0 -36
- package/.processcube/authority/config/upeSeedingData.json +0 -12
- package/Dockerfile +0 -9
- package/doc_generator/_process_instances_query.md +0 -115
- package/doc_generator/generator.js +0 -41
- package/doc_generator/generator_with_swagger.js +0 -72
- package/doc_generator/package-lock.json +0 -176
- package/doc_generator/package.json +0 -15
- package/doc_generator/query_template.mustache +0 -20
- package/doc_generator/swagger.json +0 -4110
- package/docker-compose.yml +0 -44
- package/nodered/flows.json +0 -2156
- package/nodered/flows_cred.json +0 -3
- package/nodered/settings.js +0 -562
- package/nodered/static/ProcessCube_Logo.svg +0 -53
- package/processes/Call-Activity-Sample.bpmn +0 -88
- package/processes/External-Task-Auth-Sample.bpmn +0 -82
- package/processes/External-Task-Sample.bpmn +0 -94
- package/processes/SampleEvent.bpmn +0 -73
- package/processes/User-Task-Auth-Sample.bpmn +0 -63
- package/processes/User-Task-Sample.bpmn +0 -76
- package/processes/Wait-For-Usertask.bpmn +0 -74
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "8b280114f8ac9c23",
|
|
4
|
+
"type": "tab",
|
|
5
|
+
"label": "Dataobject Instances Query Sample",
|
|
6
|
+
"disabled": false,
|
|
7
|
+
"info": "",
|
|
8
|
+
"env": []
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"id": "be0d703c70d1687b",
|
|
12
|
+
"type": "group",
|
|
13
|
+
"z": "8b280114f8ac9c23",
|
|
14
|
+
"style": {
|
|
15
|
+
"stroke": "#999999",
|
|
16
|
+
"stroke-opacity": "1",
|
|
17
|
+
"fill": "none",
|
|
18
|
+
"fill-opacity": "1",
|
|
19
|
+
"label": true,
|
|
20
|
+
"label-position": "nw",
|
|
21
|
+
"color": "#a4a4a4"
|
|
22
|
+
},
|
|
23
|
+
"nodes": [
|
|
24
|
+
"8687cdf9bf6c4d7d",
|
|
25
|
+
"74773491693b7f22",
|
|
26
|
+
"29e796ef38867f2a"
|
|
27
|
+
],
|
|
28
|
+
"x": 74,
|
|
29
|
+
"y": 79,
|
|
30
|
+
"w": 632,
|
|
31
|
+
"h": 82
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"id": "8687cdf9bf6c4d7d",
|
|
35
|
+
"type": "dataobject-instance-query",
|
|
36
|
+
"z": "8b280114f8ac9c23",
|
|
37
|
+
"g": "be0d703c70d1687b",
|
|
38
|
+
"name": "Query 5 DataobjectInstances",
|
|
39
|
+
"engine": "7de3086e71c028f9",
|
|
40
|
+
"query": "{ \"limit\": 5}",
|
|
41
|
+
"query_type": "json",
|
|
42
|
+
"x": 400,
|
|
43
|
+
"y": 120,
|
|
44
|
+
"wires": [
|
|
45
|
+
[
|
|
46
|
+
"74773491693b7f22"
|
|
47
|
+
]
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"id": "74773491693b7f22",
|
|
52
|
+
"type": "debug",
|
|
53
|
+
"z": "8b280114f8ac9c23",
|
|
54
|
+
"g": "be0d703c70d1687b",
|
|
55
|
+
"name": "Log",
|
|
56
|
+
"active": true,
|
|
57
|
+
"tosidebar": true,
|
|
58
|
+
"console": false,
|
|
59
|
+
"tostatus": false,
|
|
60
|
+
"complete": "payload",
|
|
61
|
+
"targetType": "msg",
|
|
62
|
+
"statusVal": "",
|
|
63
|
+
"statusType": "auto",
|
|
64
|
+
"x": 610,
|
|
65
|
+
"y": 120,
|
|
66
|
+
"wires": []
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"id": "29e796ef38867f2a",
|
|
70
|
+
"type": "inject",
|
|
71
|
+
"z": "8b280114f8ac9c23",
|
|
72
|
+
"g": "be0d703c70d1687b",
|
|
73
|
+
"name": "Trigger",
|
|
74
|
+
"props": [
|
|
75
|
+
{
|
|
76
|
+
"p": "payload"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"p": "topic",
|
|
80
|
+
"vt": "str"
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
"repeat": "",
|
|
84
|
+
"crontab": "",
|
|
85
|
+
"once": false,
|
|
86
|
+
"onceDelay": 0.1,
|
|
87
|
+
"topic": "",
|
|
88
|
+
"payload": "",
|
|
89
|
+
"payloadType": "date",
|
|
90
|
+
"x": 170,
|
|
91
|
+
"y": 120,
|
|
92
|
+
"wires": [
|
|
93
|
+
[
|
|
94
|
+
"8687cdf9bf6c4d7d"
|
|
95
|
+
]
|
|
96
|
+
]
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"id": "7de3086e71c028f9",
|
|
100
|
+
"type": "processcube-engine-config",
|
|
101
|
+
"name": "",
|
|
102
|
+
"url": "http://engine:8000",
|
|
103
|
+
"urlType": "str",
|
|
104
|
+
"clientId": "",
|
|
105
|
+
"clientIdType": "str",
|
|
106
|
+
"clientSecret": "",
|
|
107
|
+
"clientSecretType": "str"
|
|
108
|
+
}
|
|
109
|
+
]
|
package/externaltask-error.html
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
defaults: {
|
|
6
6
|
name: { value: '' },
|
|
7
7
|
error: { value: '' },
|
|
8
|
+
message: { value: '' },
|
|
8
9
|
},
|
|
9
10
|
inputs: 1,
|
|
10
11
|
outputs: 1,
|
|
@@ -25,6 +26,10 @@
|
|
|
25
26
|
<label for="node-input-error"><i class="fa fa-tag"></i> Error Code</label>
|
|
26
27
|
<input type="text" id="node-input-error" placeholder="Error Code of ExternalTask" />
|
|
27
28
|
</div>
|
|
29
|
+
<div class="form-row">
|
|
30
|
+
<label for="node-input-message"><i class="fa fa-tag"></i> Error Message</label>
|
|
31
|
+
<input type="text" id="node-input-message" placeholder="Error Message of ExternalTask" />
|
|
32
|
+
</div>
|
|
28
33
|
</script>
|
|
29
34
|
|
|
30
35
|
<script type="text/markdown" data-help-name="externaltask-error">
|
|
@@ -35,9 +40,9 @@ handling within _Error-Boundary-Events_.
|
|
|
35
40
|
## Inputs
|
|
36
41
|
|
|
37
42
|
: 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
|
|
43
|
+
: Error (string) : From the configuration or from `msg.errorCode` or `msg.error.code`
|
|
44
|
+
: Message (string) : The caught exception message or `msg.errorMessage` or `msg.error.message`
|
|
45
|
+
: StackTrace (string) : The stack trace of the exception!
|
|
41
46
|
|
|
42
47
|
### References
|
|
43
48
|
|
package/externaltask-error.js
CHANGED
|
@@ -3,37 +3,51 @@ module.exports = function (RED) {
|
|
|
3
3
|
RED.nodes.createNode(this, config);
|
|
4
4
|
var node = this;
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
let eventEmitter = null;
|
|
8
|
-
|
|
9
|
-
node.on('input', function (msg) {
|
|
10
|
-
eventEmitter = flowContext.get('emitter');
|
|
11
|
-
|
|
12
|
-
if (!eventEmitter) {
|
|
13
|
-
flowContext.set('emitter', new EventEmitter());
|
|
14
|
-
eventEmitter = flowContext.get('emitter');
|
|
15
|
-
}
|
|
16
|
-
|
|
6
|
+
node.on('input', function (msg) {
|
|
17
7
|
const flowNodeInstanceId = msg.flowNodeInstanceId;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
8
|
+
const etw_input_node_id = msg.etw_input_node_id;
|
|
9
|
+
|
|
10
|
+
if (!etw_input_node_id) {
|
|
11
|
+
node.error('Error: The message did not contain the required etw_input_node_id.');
|
|
12
|
+
} else {
|
|
13
|
+
const etwInputNode = RED.nodes.getNode(etw_input_node_id);
|
|
14
|
+
|
|
15
|
+
if (!etwInputNode) {
|
|
16
|
+
node.error('Error: The message did not contain the required etw_input_node_id.');
|
|
17
|
+
} else {
|
|
18
|
+
let msgError = msg.error;
|
|
19
|
+
let errorCode = config.error;
|
|
20
|
+
let errorMessage = config.message;
|
|
21
|
+
let errorDetails = RED.util.encodeObject(msg);
|
|
22
|
+
|
|
23
|
+
if (msgError) {
|
|
24
|
+
if (msgError.code) {
|
|
25
|
+
errorCode = msgError.code;
|
|
26
|
+
errorMessage = msgError.message;
|
|
27
|
+
}
|
|
28
|
+
} else if (msg.errorCode) {
|
|
29
|
+
errorCode = msg.errorCode;
|
|
30
|
+
errorMessage = msg.errorMessage;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const error = new Error(errorMessage);
|
|
34
|
+
error.errorCode = errorCode;
|
|
35
|
+
error.errorDetails = errorDetails;
|
|
36
|
+
|
|
37
|
+
if (!error.etw_started_at) {
|
|
38
|
+
error.etw_started_at = msg.errorDetails?.etw_started_at || msg.etw_started_at;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
msg.errorCode = errorCode;
|
|
42
|
+
msg.errorMessage = errorMessage;
|
|
43
|
+
|
|
44
|
+
node.log(`handle-${flowNodeInstanceId}: *flowNodeInstanceId* '${flowNodeInstanceId}' with *msg._msgid* '${msg._msgid}'`);
|
|
45
|
+
|
|
46
|
+
etwInputNode.eventEmitter.emit(`handle-${flowNodeInstanceId}`, error, true);
|
|
47
|
+
|
|
48
|
+
node.send(msg);
|
|
49
|
+
}
|
|
23
50
|
}
|
|
24
|
-
|
|
25
|
-
const error = new Error(msgError.message);
|
|
26
|
-
error.errorCode = config.error;
|
|
27
|
-
error.errorDetails = RED.util.encodeObject(msg);
|
|
28
|
-
|
|
29
|
-
msg.errorCode = config.error;
|
|
30
|
-
msg.errorMessage = msgError.message;
|
|
31
|
-
|
|
32
|
-
node.log(`handle-${flowNodeInstanceId}: *flowNodeInstanceId* '${flowNodeInstanceId}' with *msg._msgid* '${msg._msgid}'`);
|
|
33
|
-
|
|
34
|
-
eventEmitter.emit(`handle-${flowNodeInstanceId}`, error, true);
|
|
35
|
-
|
|
36
|
-
node.send(msg);
|
|
37
51
|
});
|
|
38
52
|
}
|
|
39
53
|
RED.nodes.registerType('externaltask-error', ExternalTaskError);
|
|
@@ -4,18 +4,16 @@ module.exports = function (RED) {
|
|
|
4
4
|
var node = this;
|
|
5
5
|
node.engine = RED.nodes.getNode(config.engine);
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
let currentIdentity = node.engine.identity;
|
|
7
|
+
let subscription;
|
|
9
8
|
|
|
9
|
+
const register = async () => {
|
|
10
10
|
const client = node.engine.engineClient;
|
|
11
11
|
|
|
12
12
|
if (!client) {
|
|
13
|
-
node.error('No engine configured.');
|
|
13
|
+
node.error('No engine configured.', {});
|
|
14
14
|
return;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
let subscription;
|
|
18
|
-
|
|
19
17
|
function externalTaskCallback() {
|
|
20
18
|
return (externalTaskNotification) => {
|
|
21
19
|
if (config.externaltask != '' && config.externaltask != externalTaskNotification.flowNodeId) return;
|
|
@@ -33,44 +31,29 @@ module.exports = function (RED) {
|
|
|
33
31
|
async function subscribe() {
|
|
34
32
|
switch (config.eventtype) {
|
|
35
33
|
case 'created':
|
|
36
|
-
return await client.notification.onExternalTaskCreated(externalTaskCallback()
|
|
37
|
-
identity: currentIdentity,
|
|
38
|
-
});
|
|
34
|
+
return await client.notification.onExternalTaskCreated(externalTaskCallback());
|
|
39
35
|
case 'locked':
|
|
40
|
-
return await client.notification.onExternalTaskLocked(externalTaskCallback()
|
|
41
|
-
identity: currentIdentity,
|
|
42
|
-
});
|
|
36
|
+
return await client.notification.onExternalTaskLocked(externalTaskCallback());
|
|
43
37
|
case 'unlocked':
|
|
44
|
-
return await client.notification.onExternalTaskUnlocked(externalTaskCallback()
|
|
45
|
-
identity: currentIdentity,
|
|
46
|
-
});
|
|
38
|
+
return await client.notification.onExternalTaskUnlocked(externalTaskCallback());
|
|
47
39
|
default:
|
|
48
40
|
console.error('no such event: ' + config.eventtype);
|
|
49
41
|
}
|
|
50
42
|
}
|
|
51
43
|
|
|
52
|
-
|
|
53
|
-
subscription = subscribe();
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
node.engine.registerOnIdentityChanged(async (identity) => {
|
|
57
|
-
if (subscription) {
|
|
58
|
-
client.notification.removeSubscription(subscription, currentIdentity);
|
|
59
|
-
}
|
|
60
|
-
currentIdentity = identity;
|
|
61
|
-
|
|
62
|
-
subscription = subscribe();
|
|
63
|
-
});
|
|
44
|
+
subscription = subscribe();
|
|
64
45
|
|
|
65
46
|
node.on('close', async () => {
|
|
66
47
|
if (node.engine && node.engine.engineClient && client) {
|
|
67
|
-
client.notification.removeSubscription(subscription
|
|
48
|
+
client.notification.removeSubscription(subscription);
|
|
68
49
|
}
|
|
69
50
|
});
|
|
70
51
|
};
|
|
71
52
|
|
|
72
53
|
if (node.engine) {
|
|
73
|
-
register()
|
|
54
|
+
register().catch((error) => {
|
|
55
|
+
node.error(error, {});
|
|
56
|
+
});
|
|
74
57
|
}
|
|
75
58
|
}
|
|
76
59
|
RED.nodes.registerType('externaltask-event-listener', ExternalTaskEventListener);
|
package/externaltask-input.html
CHANGED
|
@@ -4,16 +4,19 @@
|
|
|
4
4
|
color: '#02AFD6',
|
|
5
5
|
defaults: {
|
|
6
6
|
name: { value: '' },
|
|
7
|
+
workername: { value: '' },
|
|
7
8
|
engine: { value: '', type: 'processcube-engine-config' },
|
|
8
9
|
topic: { value: '' },
|
|
10
|
+
topicType: { value: '' },
|
|
9
11
|
workerConfig: { value: '{}'},
|
|
10
|
-
workerConfigType: { value: 'json'}
|
|
12
|
+
workerConfigType: { value: 'json'},
|
|
13
|
+
traces: { value: [] },
|
|
11
14
|
},
|
|
12
15
|
inputs: 0,
|
|
13
16
|
outputs: 1,
|
|
14
17
|
icon: 'externaltask_input.svg',
|
|
15
18
|
label: function () {
|
|
16
|
-
return this.name || 'externaltask-input';
|
|
19
|
+
return this.name || (this.topic ? `topic: ${this.topic}` : 'externaltask-input');
|
|
17
20
|
},
|
|
18
21
|
oneditprepare: function () {
|
|
19
22
|
$('#node-input-workerConfig').typedInput({
|
|
@@ -23,6 +26,33 @@
|
|
|
23
26
|
|
|
24
27
|
$('#node-input-workerConfig').typedInput('value', this.workerConfig);
|
|
25
28
|
$('#node-input-workerConfig').typedInput('type', this.workerConfigType);
|
|
29
|
+
|
|
30
|
+
$('#node-input-topic').typedInput({
|
|
31
|
+
default: 'str',
|
|
32
|
+
types: ['str', 'env'],
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
$('#node-input-topic').typedInput('value', this.topic);
|
|
36
|
+
$('#node-input-topic').typedInput('type', this.topicType);
|
|
37
|
+
|
|
38
|
+
const allTraces = [
|
|
39
|
+
{ value: "start", label: "Start" },
|
|
40
|
+
{ value: "enter", label: "Enter" },
|
|
41
|
+
{ value: "exit", label: "Exit" },
|
|
42
|
+
{ value: "error", label: "Error" },
|
|
43
|
+
{ value: "finish", label: "Finish" }
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
const selectEl = $("#node-input-traces");
|
|
47
|
+
|
|
48
|
+
// Optionen einfügen
|
|
49
|
+
allTraces.forEach(opt => {
|
|
50
|
+
selectEl.append(new Option(opt.label, opt.value));
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
// Bereits gespeicherte Werte setzen
|
|
54
|
+
const selectedOptions = this.traces || [];
|
|
55
|
+
selectEl.val(selectedOptions);
|
|
26
56
|
},
|
|
27
57
|
oneditsave: function () {
|
|
28
58
|
this.workerConfig = $('#node-input-workerConfig').typedInput('value');
|
|
@@ -31,6 +61,11 @@
|
|
|
31
61
|
$('#node-input-workerConfig').typedInput('value', '{}');
|
|
32
62
|
}
|
|
33
63
|
this.workerConfigType = $('#node-input-workerConfig').typedInput('type');
|
|
64
|
+
this.topic = $('#node-input-topic').typedInput('value');
|
|
65
|
+
this.topicType = $('#node-input-topic').typedInput('type');
|
|
66
|
+
|
|
67
|
+
const selected = $("#node-input-traces").val();
|
|
68
|
+
this.traces = selected;
|
|
34
69
|
},
|
|
35
70
|
});
|
|
36
71
|
</script>
|
|
@@ -40,6 +75,10 @@
|
|
|
40
75
|
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
|
41
76
|
<input type="text" id="node-input-name" placeholder="Name" />
|
|
42
77
|
</div>
|
|
78
|
+
<div class="form-row">
|
|
79
|
+
<label for="node-input-workername"><i class="fa fa-tag"></i> Workername</label>
|
|
80
|
+
<input type="text" id="node-input-workername" placeholder="(optional) Workername" />
|
|
81
|
+
</div>
|
|
43
82
|
<div class="form-row">
|
|
44
83
|
<label for="node-input-engine"><i class="fa fa-tag"></i> Engine</label>
|
|
45
84
|
<input type="text" id="node-input-engine" placeholder="Engine" />
|
|
@@ -52,6 +91,10 @@
|
|
|
52
91
|
<label for="node-input-workerConfig"><i class="fa fa-tag"></i> Config</label>
|
|
53
92
|
<input type="text" id="node-input-workerConfig" />
|
|
54
93
|
</div>
|
|
94
|
+
<div class="form-row">
|
|
95
|
+
<label for="node-input-traces"><i class="fa fa-check-square"></i> Traces</label>
|
|
96
|
+
<select id="node-input-traces" multiple size="5" style="width: 100%"></select>
|
|
97
|
+
</div>
|
|
55
98
|
</script>
|
|
56
99
|
|
|
57
100
|
<script type="text/markdown" data-help-name="externaltask-input">
|
|
@@ -61,7 +104,9 @@ the connected ProcessCube Engine for processing.
|
|
|
61
104
|
## Configs
|
|
62
105
|
|
|
63
106
|
: name (string) : The name of the node
|
|
64
|
-
:
|
|
107
|
+
: workername (string) : The optional name of the worker otherwise it will be generated with the pattern
|
|
108
|
+
nodered:NODERED_NAME-host:HOST_NAME-pid:PID-id:ID of the node
|
|
109
|
+
: engine (engine-node) : The ProcessCube Engine to connect to
|
|
65
110
|
: topic (string) : The topic of the external task
|
|
66
111
|
: workerConfig (object) : The configuration for the worker
|
|
67
112
|
|