@5minds/node-red-contrib-processcube 1.1.4-feature-8dd331-m05435uk → 1.1.4-feature-e31a04-m0576r20
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +1 -6
- package/processes/User-Task-Sample.bpmn +4 -4
- package/process-error-listener.html +0 -49
- package/process-error-listener.js +0 -76
- package/process-finished-listener.html +0 -50
- package/process-finished-listener.js +0 -77
- package/process-resumed-listener.html +0 -49
- package/process-resumed-listener.js +0 -75
- package/process-started-listener.html +0 -50
- package/process-started-listener.js +0 -77
- package/process-terminated-listener.html +0 -49
- package/process-terminated-listener.js +0 -75
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@5minds/node-red-contrib-processcube",
|
3
|
-
"version": "1.1.4-feature-
|
3
|
+
"version": "1.1.4-feature-e31a04-m0576r20",
|
4
4
|
"license": "MIT",
|
5
5
|
"description": "Node-RED nodes for ProcessCube",
|
6
6
|
"scripts": {
|
@@ -40,11 +40,6 @@
|
|
40
40
|
"externaltaskOutput": "externaltask-output.js",
|
41
41
|
"externaltaskError": "externaltask-error.js",
|
42
42
|
"processStart": "process-start.js",
|
43
|
-
"processStartedListener": "process-started-listener.js",
|
44
|
-
"processFinishedListener": "process-finished-listener.js",
|
45
|
-
"processTerminatedListener": "process-terminated-listener.js",
|
46
|
-
"processErrorListener": "process-error-listener.js",
|
47
|
-
"processResumedListener": "process-resumed-listener.js",
|
48
43
|
"processcubeEngineConfig": "processcube-engine-config.js",
|
49
44
|
"ProcessinstanceQuery": "processinstance-query.js",
|
50
45
|
"ProcessdefinitionQuery": "processdefinition-query.js",
|
@@ -9,6 +9,10 @@
|
|
9
9
|
<bpmn:outgoing>Flow_142awo6</bpmn:outgoing>
|
10
10
|
</bpmn:startEvent>
|
11
11
|
<bpmn:sequenceFlow id="Flow_142awo6" sourceRef="StartEvent_1" targetRef="user_task" />
|
12
|
+
<bpmn:endEvent id="Event_07hak5r" name="End">
|
13
|
+
<bpmn:incoming>Flow_0i7xqvi</bpmn:incoming>
|
14
|
+
</bpmn:endEvent>
|
15
|
+
<bpmn:sequenceFlow id="Flow_0i7xqvi" sourceRef="user_task" targetRef="Event_07hak5r" />
|
12
16
|
<bpmn:userTask id="user_task" name="User Task">
|
13
17
|
<bpmn:extensionElements>
|
14
18
|
<camunda:formData>
|
@@ -19,10 +23,6 @@
|
|
19
23
|
<bpmn:incoming>Flow_142awo6</bpmn:incoming>
|
20
24
|
<bpmn:outgoing>Flow_0i7xqvi</bpmn:outgoing>
|
21
25
|
</bpmn:userTask>
|
22
|
-
<bpmn:endEvent id="Event_07hak5r" name="End">
|
23
|
-
<bpmn:incoming>Flow_0i7xqvi</bpmn:incoming>
|
24
|
-
</bpmn:endEvent>
|
25
|
-
<bpmn:sequenceFlow id="Flow_0i7xqvi" sourceRef="user_task" targetRef="Event_07hak5r" />
|
26
26
|
</bpmn:process>
|
27
27
|
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
|
28
28
|
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Collaboration_1cidyxu">
|
@@ -1,49 +0,0 @@
|
|
1
|
-
<script type="text/javascript">
|
2
|
-
RED.nodes.registerType('process-error-listener', {
|
3
|
-
category: 'ProcessCube',
|
4
|
-
color: '#02AFD6',
|
5
|
-
defaults: {
|
6
|
-
name: { value: '' },
|
7
|
-
engine: { value: '', type: 'processcube-engine-config' },
|
8
|
-
processmodel: { value: '', required: false },
|
9
|
-
},
|
10
|
-
inputs: 0,
|
11
|
-
outputs: 1,
|
12
|
-
icon: 'font-awesome/fa-sign-in',
|
13
|
-
label: function () {
|
14
|
-
return this.name || 'process-error-listener';
|
15
|
-
},
|
16
|
-
});
|
17
|
-
</script>
|
18
|
-
|
19
|
-
<script type="text/html" data-template-name="process-error-listener">
|
20
|
-
<div class="form-row">
|
21
|
-
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
22
|
-
<input type="text" id="node-input-name" placeholder="Name" />
|
23
|
-
</div>
|
24
|
-
<div class="form-row">
|
25
|
-
<label for="node-input-engine"><i class="fa fa-tag"></i> Engine-URL</label>
|
26
|
-
<input type="text" id="node-input-engine" placeholder="http://engine:8000" />
|
27
|
-
</div>
|
28
|
-
<div class="form-row">
|
29
|
-
<label for="node-input-processmodel"><i class="fa fa-tag"></i> Processmodel</label>
|
30
|
-
<input type="text" id="node-input-processmodel" placeholder="ID of Processmodel" />
|
31
|
-
</div>
|
32
|
-
</script>
|
33
|
-
|
34
|
-
<script type="text/markdown" data-help-name="process-error-listener">
|
35
|
-
A node which listens for errors in processes.
|
36
|
-
|
37
|
-
## Outputs
|
38
|
-
|
39
|
-
: processInstanceId (string): The instance id of the processInstance with the error.
|
40
|
-
: processModelId (string): The model id of the processInstance with the error.
|
41
|
-
: token (object): The current token of the processInstance with the error.
|
42
|
-
: action (string): The action of the event (error).
|
43
|
-
: type (string): The type of the event.
|
44
|
-
|
45
|
-
### References
|
46
|
-
|
47
|
-
- [The ProcessCube Developer Network](https://processcube.io) - All documentation for the ProcessCube© platform
|
48
|
-
- [Node-RED Integration in ProcessCube©](https://processcube.io/docs/node-red) - Node-RED integration in ProcessCube©
|
49
|
-
</script>
|
@@ -1,76 +0,0 @@
|
|
1
|
-
module.exports = function (RED) {
|
2
|
-
function ProcessErrorListener(config) {
|
3
|
-
RED.nodes.createNode(this, config);
|
4
|
-
var node = this;
|
5
|
-
node.engine = RED.nodes.getNode(config.engine);
|
6
|
-
|
7
|
-
const register = async () => {
|
8
|
-
const client = node.engine.engineClient;
|
9
|
-
|
10
|
-
if (!client) {
|
11
|
-
node.error('No engine configured.');
|
12
|
-
return;
|
13
|
-
}
|
14
|
-
|
15
|
-
let currentIdentity = node.engine.identity;
|
16
|
-
|
17
|
-
let subscription;
|
18
|
-
|
19
|
-
if (node.engine.isIdentityReady()) {
|
20
|
-
subscription = await client.notification.onProcessError(
|
21
|
-
(processNotification) => {
|
22
|
-
if (config.processmodel != '' && config.processmodel != processNotification.processModelId)
|
23
|
-
return;
|
24
|
-
console.log(processNotification);
|
25
|
-
node.send({
|
26
|
-
payload: {
|
27
|
-
processInstanceId: processNotification.processInstanceId,
|
28
|
-
processModelId: processNotification.processModelId,
|
29
|
-
token: processNotification.currentToken,
|
30
|
-
action: 'error',
|
31
|
-
type: 'processInstance',
|
32
|
-
},
|
33
|
-
});
|
34
|
-
},
|
35
|
-
{ identity: currentIdentity }
|
36
|
-
);
|
37
|
-
}
|
38
|
-
|
39
|
-
node.engine.registerOnIdentityChanged(async (identity) => {
|
40
|
-
if (subscription) {
|
41
|
-
client.notification.removeSubscription(subscription, currentIdentity);
|
42
|
-
}
|
43
|
-
|
44
|
-
currentIdentity = identity;
|
45
|
-
|
46
|
-
subscription = await client.notification.onProcessError(
|
47
|
-
(processNotification) => {
|
48
|
-
if (config.processmodel != '' && config.processmodel != processNotification.processModelId)
|
49
|
-
return;
|
50
|
-
node.send({
|
51
|
-
payload: {
|
52
|
-
processInstanceId: processNotification.processInstanceId,
|
53
|
-
processModelId: processNotification.processModelId,
|
54
|
-
token: processNotification.currentToken,
|
55
|
-
action: 'error',
|
56
|
-
type: 'processInstance',
|
57
|
-
},
|
58
|
-
});
|
59
|
-
},
|
60
|
-
{ identity: currentIdentity }
|
61
|
-
);
|
62
|
-
});
|
63
|
-
|
64
|
-
node.on('close', () => {
|
65
|
-
if (node.engine && node.engine.engineClient && client) {
|
66
|
-
client.notification.removeSubscription(subscription, currentIdentity);
|
67
|
-
}
|
68
|
-
});
|
69
|
-
};
|
70
|
-
|
71
|
-
if (node.engine) {
|
72
|
-
register();
|
73
|
-
}
|
74
|
-
}
|
75
|
-
RED.nodes.registerType('process-error-listener', ProcessErrorListener);
|
76
|
-
};
|
@@ -1,50 +0,0 @@
|
|
1
|
-
<script type="text/javascript">
|
2
|
-
RED.nodes.registerType('process-finished-listener', {
|
3
|
-
category: 'ProcessCube',
|
4
|
-
color: '#02AFD6',
|
5
|
-
defaults: {
|
6
|
-
name: { value: '' },
|
7
|
-
engine: { value: '', type: 'processcube-engine-config' },
|
8
|
-
processmodel: { value: '', required: false },
|
9
|
-
},
|
10
|
-
inputs: 0,
|
11
|
-
outputs: 1,
|
12
|
-
icon: 'font-awesome/fa-sign-in',
|
13
|
-
label: function () {
|
14
|
-
return this.name || 'process-finished-listener';
|
15
|
-
},
|
16
|
-
});
|
17
|
-
</script>
|
18
|
-
|
19
|
-
<script type="text/html" data-template-name="process-finished-listener">
|
20
|
-
<div class="form-row">
|
21
|
-
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
22
|
-
<input type="text" id="node-input-name" placeholder="Name" />
|
23
|
-
</div>
|
24
|
-
<div class="form-row">
|
25
|
-
<label for="node-input-engine"><i class="fa fa-tag"></i> Engine-URL</label>
|
26
|
-
<input type="text" id="node-input-engine" placeholder="http://engine:8000" />
|
27
|
-
</div>
|
28
|
-
<div class="form-row">
|
29
|
-
<label for="node-input-processmodel"><i class="fa fa-tag"></i> Processmodel</label>
|
30
|
-
<input type="text" id="node-input-processmodel" placeholder="ID of Processmodel" />
|
31
|
-
</div>
|
32
|
-
</script>
|
33
|
-
|
34
|
-
<script type="text/markdown" data-help-name="process-finished-listener">
|
35
|
-
A node which listens for finished processes.
|
36
|
-
|
37
|
-
## Outputs
|
38
|
-
|
39
|
-
: processInstanceId (string): The instance id of the finished processInstance.
|
40
|
-
: processModelId (string): The model id of the finished processInstance.
|
41
|
-
: flowNodeId (string): The id of the flowNode that the processInstance was finished with.
|
42
|
-
: token (object): The current token of the finished processInstance.
|
43
|
-
: action (string): The action of the event (finished).
|
44
|
-
: type (string): The type of the event.
|
45
|
-
|
46
|
-
### References
|
47
|
-
|
48
|
-
- [The ProcessCube Developer Network](https://processcube.io) - All documentation for the ProcessCube© platform
|
49
|
-
- [Node-RED Integration in ProcessCube©](https://processcube.io/docs/node-red) - Node-RED integration in ProcessCube©
|
50
|
-
</script>
|
@@ -1,77 +0,0 @@
|
|
1
|
-
module.exports = function (RED) {
|
2
|
-
function ProcessFinishedListener(config) {
|
3
|
-
RED.nodes.createNode(this, config);
|
4
|
-
var node = this;
|
5
|
-
node.engine = RED.nodes.getNode(config.engine);
|
6
|
-
|
7
|
-
const register = async () => {
|
8
|
-
const client = node.engine.engineClient;
|
9
|
-
|
10
|
-
if (!client) {
|
11
|
-
node.error('No engine configured.');
|
12
|
-
return;
|
13
|
-
}
|
14
|
-
|
15
|
-
let currentIdentity = node.engine.identity;
|
16
|
-
|
17
|
-
let subscription;
|
18
|
-
|
19
|
-
if (node.engine.isIdentityReady()) {
|
20
|
-
subscription = await client.notification.onProcessEnded(
|
21
|
-
(processNotification) => {
|
22
|
-
if (config.processmodel != '' && config.processmodel != processNotification.processModelId)
|
23
|
-
return;
|
24
|
-
node.send({
|
25
|
-
payload: {
|
26
|
-
processInstanceId: processNotification.processInstanceId,
|
27
|
-
processModelId: processNotification.processModelId,
|
28
|
-
flowNodeId: processNotification.flowNodeId,
|
29
|
-
token: processNotification.currentToken,
|
30
|
-
action: 'finished',
|
31
|
-
type: 'processInstance',
|
32
|
-
},
|
33
|
-
});
|
34
|
-
},
|
35
|
-
{ identity: currentIdentity }
|
36
|
-
);
|
37
|
-
}
|
38
|
-
|
39
|
-
node.engine.registerOnIdentityChanged(async (identity) => {
|
40
|
-
if (subscription) {
|
41
|
-
client.notification.removeSubscription(subscription, currentIdentity);
|
42
|
-
}
|
43
|
-
|
44
|
-
currentIdentity = identity;
|
45
|
-
|
46
|
-
subscription = await client.notification.onProcessEnded(
|
47
|
-
(processNotification) => {
|
48
|
-
if (config.processmodel != '' && config.processmodel != processNotification.processModelId)
|
49
|
-
return;
|
50
|
-
node.send({
|
51
|
-
payload: {
|
52
|
-
processInstanceId: processNotification.processInstanceId,
|
53
|
-
processModelId: processNotification.processModelId,
|
54
|
-
flowNodeId: processNotification.flowNodeId,
|
55
|
-
token: processNotification.currentToken,
|
56
|
-
action: 'finished',
|
57
|
-
type: 'processInstance',
|
58
|
-
},
|
59
|
-
});
|
60
|
-
},
|
61
|
-
{ identity: currentIdentity }
|
62
|
-
);
|
63
|
-
});
|
64
|
-
|
65
|
-
node.on('close', () => {
|
66
|
-
if (node.engine && node.engine.engineClient && client) {
|
67
|
-
client.notification.removeSubscription(subscription, currentIdentity);
|
68
|
-
}
|
69
|
-
});
|
70
|
-
};
|
71
|
-
|
72
|
-
if (node.engine) {
|
73
|
-
register();
|
74
|
-
}
|
75
|
-
}
|
76
|
-
RED.nodes.registerType('process-finished-listener', ProcessFinishedListener);
|
77
|
-
};
|
@@ -1,49 +0,0 @@
|
|
1
|
-
<script type="text/javascript">
|
2
|
-
RED.nodes.registerType('process-resumed-listener', {
|
3
|
-
category: 'ProcessCube',
|
4
|
-
color: '#02AFD6',
|
5
|
-
defaults: {
|
6
|
-
name: { value: '' },
|
7
|
-
engine: { value: '', type: 'processcube-engine-config' },
|
8
|
-
processmodel: { value: '', required: false },
|
9
|
-
},
|
10
|
-
inputs: 0,
|
11
|
-
outputs: 1,
|
12
|
-
icon: 'font-awesome/fa-sign-in',
|
13
|
-
label: function () {
|
14
|
-
return this.name || 'process-resumed-listener';
|
15
|
-
},
|
16
|
-
});
|
17
|
-
</script>
|
18
|
-
|
19
|
-
<script type="text/html" data-template-name="process-resumed-listener">
|
20
|
-
<div class="form-row">
|
21
|
-
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
22
|
-
<input type="text" id="node-input-name" placeholder="Name" />
|
23
|
-
</div>
|
24
|
-
<div class="form-row">
|
25
|
-
<label for="node-input-engine"><i class="fa fa-tag"></i> Engine-URL</label>
|
26
|
-
<input type="text" id="node-input-engine" placeholder="http://engine:8000" />
|
27
|
-
</div>
|
28
|
-
<div class="form-row">
|
29
|
-
<label for="node-input-processmodel"><i class="fa fa-tag"></i> Processmodel</label>
|
30
|
-
<input type="text" id="node-input-processmodel" placeholder="ID of Processmodel" />
|
31
|
-
</div>
|
32
|
-
</script>
|
33
|
-
|
34
|
-
<script type="text/markdown" data-help-name="process-resumed-listener">
|
35
|
-
A node which listens for resumed processes.
|
36
|
-
|
37
|
-
## Outputs
|
38
|
-
|
39
|
-
: processInstanceId (string): The instance id of the resumed processInstance.
|
40
|
-
: processModelId (string): The model id of the resumed processInstance.
|
41
|
-
: token (object): The current token of the resumed processInstance.
|
42
|
-
: action (string): The action of the event (resumed).
|
43
|
-
: type (string): The type of the event.
|
44
|
-
|
45
|
-
### References
|
46
|
-
|
47
|
-
- [The ProcessCube Developer Network](https://processcube.io) - All documentation for the ProcessCube© platform
|
48
|
-
- [Node-RED Integration in ProcessCube©](https://processcube.io/docs/node-red) - Node-RED integration in ProcessCube©
|
49
|
-
</script>
|
@@ -1,75 +0,0 @@
|
|
1
|
-
module.exports = function (RED) {
|
2
|
-
function ProcessResumedListener(config) {
|
3
|
-
RED.nodes.createNode(this, config);
|
4
|
-
var node = this;
|
5
|
-
node.engine = RED.nodes.getNode(config.engine);
|
6
|
-
|
7
|
-
const register = async () => {
|
8
|
-
const client = node.engine.engineClient;
|
9
|
-
|
10
|
-
if (!client) {
|
11
|
-
node.error('No engine configured.');
|
12
|
-
return;
|
13
|
-
}
|
14
|
-
|
15
|
-
let currentIdentity = node.engine.identity;
|
16
|
-
|
17
|
-
let subscription;
|
18
|
-
|
19
|
-
if (node.engine.isIdentityReady()) {
|
20
|
-
subscription = await client.notification.onProcessResumed(
|
21
|
-
(processNotification) => {
|
22
|
-
if (config.processmodel != '' && config.processmodel != processNotification.processModelId)
|
23
|
-
return;
|
24
|
-
node.send({
|
25
|
-
payload: {
|
26
|
-
processInstanceId: processNotification.processInstanceId,
|
27
|
-
processModelId: processNotification.processModelId,
|
28
|
-
token: processNotification.currentToken,
|
29
|
-
action: 'resumed',
|
30
|
-
type: 'processInstance',
|
31
|
-
},
|
32
|
-
});
|
33
|
-
},
|
34
|
-
{ identity: currentIdentity }
|
35
|
-
);
|
36
|
-
}
|
37
|
-
|
38
|
-
node.engine.registerOnIdentityChanged(async (identity) => {
|
39
|
-
if (subscription) {
|
40
|
-
client.notification.removeSubscription(subscription, currentIdentity);
|
41
|
-
}
|
42
|
-
|
43
|
-
currentIdentity = identity;
|
44
|
-
|
45
|
-
subscription = await client.notification.onProcessResumed(
|
46
|
-
(processNotification) => {
|
47
|
-
if (config.processmodel != '' && config.processmodel != processNotification.processModelId)
|
48
|
-
return;
|
49
|
-
node.send({
|
50
|
-
payload: {
|
51
|
-
processInstanceId: processNotification.processInstanceId,
|
52
|
-
processModelId: processNotification.processModelId,
|
53
|
-
token: processNotification.currentToken,
|
54
|
-
action: 'resumed',
|
55
|
-
type: 'processInstance',
|
56
|
-
},
|
57
|
-
});
|
58
|
-
},
|
59
|
-
{ identity: currentIdentity }
|
60
|
-
);
|
61
|
-
});
|
62
|
-
|
63
|
-
node.on('close', () => {
|
64
|
-
if (node.engine && node.engine.engineClient && client) {
|
65
|
-
client.notification.removeSubscription(subscription, currentIdentity);
|
66
|
-
}
|
67
|
-
});
|
68
|
-
};
|
69
|
-
|
70
|
-
if (node.engine) {
|
71
|
-
register();
|
72
|
-
}
|
73
|
-
}
|
74
|
-
RED.nodes.registerType('process-resumed-listener', ProcessResumedListener);
|
75
|
-
};
|
@@ -1,50 +0,0 @@
|
|
1
|
-
<script type="text/javascript">
|
2
|
-
RED.nodes.registerType('process-started-listener', {
|
3
|
-
category: 'ProcessCube',
|
4
|
-
color: '#02AFD6',
|
5
|
-
defaults: {
|
6
|
-
name: { value: '' },
|
7
|
-
engine: { value: '', type: 'processcube-engine-config' },
|
8
|
-
processmodel: { value: '', required: false },
|
9
|
-
},
|
10
|
-
inputs: 0,
|
11
|
-
outputs: 1,
|
12
|
-
icon: 'font-awesome/fa-sign-in',
|
13
|
-
label: function () {
|
14
|
-
return this.name || 'process-started-listener';
|
15
|
-
},
|
16
|
-
});
|
17
|
-
</script>
|
18
|
-
|
19
|
-
<script type="text/html" data-template-name="process-started-listener">
|
20
|
-
<div class="form-row">
|
21
|
-
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
22
|
-
<input type="text" id="node-input-name" placeholder="Name" />
|
23
|
-
</div>
|
24
|
-
<div class="form-row">
|
25
|
-
<label for="node-input-engine"><i class="fa fa-tag"></i> Engine-URL</label>
|
26
|
-
<input type="text" id="node-input-engine" placeholder="http://engine:8000" />
|
27
|
-
</div>
|
28
|
-
<div class="form-row">
|
29
|
-
<label for="node-input-processmodel"><i class="fa fa-tag"></i> Processmodel</label>
|
30
|
-
<input type="text" id="node-input-processmodel" placeholder="ID of Processmodel" />
|
31
|
-
</div>
|
32
|
-
</script>
|
33
|
-
|
34
|
-
<script type="text/markdown" data-help-name="process-started-listener">
|
35
|
-
A node which listens for started processes.
|
36
|
-
|
37
|
-
## Outputs
|
38
|
-
|
39
|
-
: processInstanceId (string): The instance id of the started processInstance.
|
40
|
-
: processModelId (string): The model id of the started processInstance.
|
41
|
-
: flowNodeId (string): The id of the flowNode that the processInstance was started with.
|
42
|
-
: token (object): The current token of the started processInstance.
|
43
|
-
: action (string): The action of the event (started).
|
44
|
-
: type (string): The type of the event.
|
45
|
-
|
46
|
-
### References
|
47
|
-
|
48
|
-
- [The ProcessCube Developer Network](https://processcube.io) - All documentation for the ProcessCube© platform
|
49
|
-
- [Node-RED Integration in ProcessCube©](https://processcube.io/docs/node-red) - Node-RED integration in ProcessCube©
|
50
|
-
</script>
|
@@ -1,77 +0,0 @@
|
|
1
|
-
module.exports = function (RED) {
|
2
|
-
function ProcessStartedListener(config) {
|
3
|
-
RED.nodes.createNode(this, config);
|
4
|
-
var node = this;
|
5
|
-
node.engine = RED.nodes.getNode(config.engine);
|
6
|
-
|
7
|
-
const register = async () => {
|
8
|
-
const client = node.engine.engineClient;
|
9
|
-
|
10
|
-
if (!client) {
|
11
|
-
node.error('No engine configured.');
|
12
|
-
return;
|
13
|
-
}
|
14
|
-
|
15
|
-
let currentIdentity = node.engine.identity;
|
16
|
-
|
17
|
-
let subscription;
|
18
|
-
|
19
|
-
if (node.engine.isIdentityReady()) {
|
20
|
-
subscription = await client.notification.onProcessStarted(
|
21
|
-
(processNotification) => {
|
22
|
-
if (config.processmodel != '' && config.processmodel != processNotification.processModelId)
|
23
|
-
return;
|
24
|
-
node.send({
|
25
|
-
payload: {
|
26
|
-
processInstanceId: processNotification.processInstanceId,
|
27
|
-
processModelId: processNotification.processModelId,
|
28
|
-
flowNodeId: processNotification.flowNodeId,
|
29
|
-
token: processNotification.currentToken,
|
30
|
-
action: 'started',
|
31
|
-
type: 'processInstance',
|
32
|
-
},
|
33
|
-
});
|
34
|
-
},
|
35
|
-
{ identity: currentIdentity }
|
36
|
-
);
|
37
|
-
}
|
38
|
-
|
39
|
-
node.engine.registerOnIdentityChanged(async (identity) => {
|
40
|
-
if (subscription) {
|
41
|
-
client.notification.removeSubscription(subscription, currentIdentity);
|
42
|
-
}
|
43
|
-
|
44
|
-
currentIdentity = identity;
|
45
|
-
|
46
|
-
subscription = await client.notification.onProcessStarted(
|
47
|
-
(processNotification) => {
|
48
|
-
if (config.processmodel != '' && config.processmodel != processNotification.processModelId)
|
49
|
-
return;
|
50
|
-
node.send({
|
51
|
-
payload: {
|
52
|
-
processInstanceId: processNotification.processInstanceId,
|
53
|
-
processModelId: processNotification.processModelId,
|
54
|
-
flowNodeId: processNotification.flowNodeId,
|
55
|
-
token: processNotification.currentToken,
|
56
|
-
action: 'started',
|
57
|
-
type: 'processInstance',
|
58
|
-
},
|
59
|
-
});
|
60
|
-
},
|
61
|
-
{ identity: currentIdentity }
|
62
|
-
);
|
63
|
-
});
|
64
|
-
|
65
|
-
node.on('close', () => {
|
66
|
-
if (node.engine && node.engine.engineClient && client) {
|
67
|
-
client.notification.removeSubscription(subscription, currentIdentity);
|
68
|
-
}
|
69
|
-
});
|
70
|
-
};
|
71
|
-
|
72
|
-
if (node.engine) {
|
73
|
-
register();
|
74
|
-
}
|
75
|
-
}
|
76
|
-
RED.nodes.registerType('process-started-listener', ProcessStartedListener);
|
77
|
-
};
|
@@ -1,49 +0,0 @@
|
|
1
|
-
<script type="text/javascript">
|
2
|
-
RED.nodes.registerType('process-terminated-listener', {
|
3
|
-
category: 'ProcessCube',
|
4
|
-
color: '#02AFD6',
|
5
|
-
defaults: {
|
6
|
-
name: { value: '' },
|
7
|
-
engine: { value: '', type: 'processcube-engine-config' },
|
8
|
-
processmodel: { value: '', required: false },
|
9
|
-
},
|
10
|
-
inputs: 0,
|
11
|
-
outputs: 1,
|
12
|
-
icon: 'font-awesome/fa-sign-in',
|
13
|
-
label: function () {
|
14
|
-
return this.name || 'process-terminated-listener';
|
15
|
-
},
|
16
|
-
});
|
17
|
-
</script>
|
18
|
-
|
19
|
-
<script type="text/html" data-template-name="process-terminated-listener">
|
20
|
-
<div class="form-row">
|
21
|
-
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
22
|
-
<input type="text" id="node-input-name" placeholder="Name" />
|
23
|
-
</div>
|
24
|
-
<div class="form-row">
|
25
|
-
<label for="node-input-engine"><i class="fa fa-tag"></i> Engine-URL</label>
|
26
|
-
<input type="text" id="node-input-engine" placeholder="http://engine:8000" />
|
27
|
-
</div>
|
28
|
-
<div class="form-row">
|
29
|
-
<label for="node-input-processmodel"><i class="fa fa-tag"></i> Processmodel</label>
|
30
|
-
<input type="text" id="node-input-processmodel" placeholder="ID of Processmodel" />
|
31
|
-
</div>
|
32
|
-
</script>
|
33
|
-
|
34
|
-
<script type="text/markdown" data-help-name="process-terminated-listener">
|
35
|
-
A node which listens for terminated processes.
|
36
|
-
|
37
|
-
## Outputs
|
38
|
-
|
39
|
-
: processInstanceId (string): The instance id of the terminated processInstance.
|
40
|
-
: processModelId (string): The model id of the terminated processInstance.
|
41
|
-
: token (object): The current token of the terminated processInstance.
|
42
|
-
: action (string): The action of the event (terminated).
|
43
|
-
: type (string): The type of the event.
|
44
|
-
|
45
|
-
### References
|
46
|
-
|
47
|
-
- [The ProcessCube Developer Network](https://processcube.io) - All documentation for the ProcessCube© platform
|
48
|
-
- [Node-RED Integration in ProcessCube©](https://processcube.io/docs/node-red) - Node-RED integration in ProcessCube©
|
49
|
-
</script>
|
@@ -1,75 +0,0 @@
|
|
1
|
-
module.exports = function (RED) {
|
2
|
-
function ProcessTerminatedListener(config) {
|
3
|
-
RED.nodes.createNode(this, config);
|
4
|
-
var node = this;
|
5
|
-
node.engine = RED.nodes.getNode(config.engine);
|
6
|
-
|
7
|
-
const register = async () => {
|
8
|
-
const client = node.engine.engineClient;
|
9
|
-
|
10
|
-
if (!client) {
|
11
|
-
node.error('No engine configured.');
|
12
|
-
return;
|
13
|
-
}
|
14
|
-
|
15
|
-
let currentIdentity = node.engine.identity;
|
16
|
-
|
17
|
-
let subscription;
|
18
|
-
|
19
|
-
if (node.engine.isIdentityReady()) {
|
20
|
-
subscription = await client.notification.onProcessTerminated(
|
21
|
-
(processNotification) => {
|
22
|
-
if (config.processmodel != '' && config.processmodel != processNotification.processModelId)
|
23
|
-
return;
|
24
|
-
node.send({
|
25
|
-
payload: {
|
26
|
-
processInstanceId: processNotification.processInstanceId,
|
27
|
-
processModelId: processNotification.processModelId,
|
28
|
-
token: processNotification.currentToken,
|
29
|
-
action: 'terminated',
|
30
|
-
type: 'processInstance',
|
31
|
-
},
|
32
|
-
});
|
33
|
-
},
|
34
|
-
{ identity: currentIdentity }
|
35
|
-
);
|
36
|
-
}
|
37
|
-
|
38
|
-
node.engine.registerOnIdentityChanged(async (identity) => {
|
39
|
-
if (subscription) {
|
40
|
-
client.notification.removeSubscription(subscription, currentIdentity);
|
41
|
-
}
|
42
|
-
|
43
|
-
currentIdentity = identity;
|
44
|
-
|
45
|
-
subscription = await client.notification.onProcessTerminated(
|
46
|
-
(processNotification) => {
|
47
|
-
if (config.processmodel != '' && config.processmodel != processNotification.processModelId)
|
48
|
-
return;
|
49
|
-
node.send({
|
50
|
-
payload: {
|
51
|
-
processInstanceId: processNotification.processInstanceId,
|
52
|
-
processModelId: processNotification.processModelId,
|
53
|
-
token: processNotification.currentToken,
|
54
|
-
action: 'terminated',
|
55
|
-
type: 'processInstance',
|
56
|
-
},
|
57
|
-
});
|
58
|
-
},
|
59
|
-
{ identity: currentIdentity }
|
60
|
-
);
|
61
|
-
});
|
62
|
-
|
63
|
-
node.on('close', () => {
|
64
|
-
if (node.engine && node.engine.engineClient && client) {
|
65
|
-
client.notification.removeSubscription(subscription, currentIdentity);
|
66
|
-
}
|
67
|
-
});
|
68
|
-
};
|
69
|
-
|
70
|
-
if (node.engine) {
|
71
|
-
register();
|
72
|
-
}
|
73
|
-
}
|
74
|
-
RED.nodes.registerType('process-terminated-listener', ProcessTerminatedListener);
|
75
|
-
};
|