@5minds/node-red-contrib-processcube 0.4.0-feature-c86557-lxlmvpx4 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +5 -12
- package/message-event-trigger.html +0 -41
- package/message-event-trigger.js +0 -44
- package/signal-event-trigger.html +0 -41
- package/signal-event-trigger.js +0 -44
package/package.json
CHANGED
@@ -1,20 +1,15 @@
|
|
1
1
|
{
|
2
2
|
"name": "@5minds/node-red-contrib-processcube",
|
3
|
-
"version": "0.4.0
|
3
|
+
"version": "0.4.0",
|
4
4
|
"license": "MIT",
|
5
5
|
"description": "Node-RED nodes for ProcessCube",
|
6
|
-
"authors": [
|
7
|
-
{
|
6
|
+
"authors": [{
|
8
7
|
"name": "Martin Moellenbeck",
|
9
8
|
"email": "Martin.Moellenbeck@5Minds.de"
|
10
9
|
},
|
11
10
|
{
|
12
11
|
"name": "Robin Lenz",
|
13
12
|
"email": "Robin.Lenz@5Minds.de"
|
14
|
-
},
|
15
|
-
{
|
16
|
-
"name": "André Siebelist",
|
17
|
-
"email": "Andre.Siebelist@5Minds.de"
|
18
13
|
}
|
19
14
|
],
|
20
15
|
"repository": {
|
@@ -36,16 +31,14 @@
|
|
36
31
|
"externaltaskOutput": "externaltask-output.js",
|
37
32
|
"externaltaskError": "externaltask-error.js",
|
38
33
|
"processStart": "process-start.js",
|
39
|
-
"processcubeEngineConfig": "processcube-engine-config.js",
|
40
|
-
"messageEventTrigger": "message-event-trigger.js",
|
41
|
-
"signalEventTrigger": "signal-event-trigger.js",
|
42
34
|
"UserTaskNewListener": "usertask-new-listener.js",
|
43
35
|
"UserTaskInput": "usertask-input.js",
|
44
|
-
"UserTaskOutput": "usertask-output.js"
|
36
|
+
"UserTaskOutput": "usertask-output.js",
|
37
|
+
"processcubeEngineConfig": "processcube-engine-config.js"
|
45
38
|
}
|
46
39
|
},
|
47
40
|
"dependencies": {
|
48
|
-
"@5minds/processcube_engine_client": "
|
41
|
+
"@5minds/processcube_engine_client": "4.4.5"
|
49
42
|
},
|
50
43
|
"keywords": [
|
51
44
|
"node-red",
|
@@ -1,41 +0,0 @@
|
|
1
|
-
<script type="text/javascript">
|
2
|
-
RED.nodes.registerType('message-event-trigger',{
|
3
|
-
category: 'ProcessCube',
|
4
|
-
color: '#00aed7',
|
5
|
-
defaults: {
|
6
|
-
name: {value: ""},
|
7
|
-
engine: {value: "", type: "processcube-engine-config"},
|
8
|
-
messagename: {value: "", required: true},
|
9
|
-
processInstanceId: {value:""}
|
10
|
-
},
|
11
|
-
inputs: 1,
|
12
|
-
outputs: 1,
|
13
|
-
icon: "font-awesome/fa-envelope-open",
|
14
|
-
label: function() {
|
15
|
-
return this.name||"message-event-trigger";
|
16
|
-
}
|
17
|
-
});
|
18
|
-
</script>
|
19
|
-
|
20
|
-
<script type="text/html" data-template-name="message-event-trigger">
|
21
|
-
<div class="form-row">
|
22
|
-
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
23
|
-
<input type="text" id="node-input-name" placeholder="Name">
|
24
|
-
</div>
|
25
|
-
<div class="form-row">
|
26
|
-
<label for="node-input-engine"><i class="fa fa-tag"></i> Engine</label>
|
27
|
-
<input type="text" id="node-input-engine" placeholder="Engine">
|
28
|
-
</div>
|
29
|
-
<div class="form-row">
|
30
|
-
<label for="node-input-messagename"><i class="fa fa-tag"></i> Message Name</label>
|
31
|
-
<input type="text" id="node-input-messagename" placeholder="Name of the Message-Event">
|
32
|
-
</div>
|
33
|
-
<div class="form-row">
|
34
|
-
<label for="node-input-processinstanceid"><i class="fa fa-tag"></i> Process Instance Id</label>
|
35
|
-
<input type="text" id="node-input-processinstanceid" placeholder="Id of the recipient process instance">
|
36
|
-
</div>
|
37
|
-
</script>
|
38
|
-
|
39
|
-
<script type="text/html" data-help-name="externaltask-input">
|
40
|
-
<p>A node which emmits an message event to the Engine.</p>
|
41
|
-
</script>
|
package/message-event-trigger.js
DELETED
@@ -1,44 +0,0 @@
|
|
1
|
-
const process = require('process');
|
2
|
-
|
3
|
-
const engine_client = require('@5minds/processcube_engine_client');
|
4
|
-
|
5
|
-
module.exports = function(RED) {
|
6
|
-
function MessageEventTrigger(config) {
|
7
|
-
RED.nodes.createNode(this, config);
|
8
|
-
var node = this;
|
9
|
-
var nodeContext = node.context();
|
10
|
-
|
11
|
-
this.engine = this.server = RED.nodes.getNode(config.engine);
|
12
|
-
|
13
|
-
const engineUrl = this.engine?.url || process.env.ENGINE_URL || 'http://engine:8000';
|
14
|
-
|
15
|
-
var client = nodeContext.get('client');
|
16
|
-
|
17
|
-
if (!client) {
|
18
|
-
nodeContext.set('client', new engine_client.EngineClient(engineUrl));
|
19
|
-
client = nodeContext.get('client');
|
20
|
-
}
|
21
|
-
|
22
|
-
node.on('input', function(msg) {
|
23
|
-
|
24
|
-
client.events.triggerMessageEvent(
|
25
|
-
config.messagename,
|
26
|
-
{
|
27
|
-
processInstanceId: config.processinstanceid,
|
28
|
-
payload: msg.payload
|
29
|
-
}
|
30
|
-
|
31
|
-
).then((result) => {
|
32
|
-
|
33
|
-
msg.payload = result;
|
34
|
-
|
35
|
-
node.send(msg);
|
36
|
-
node.status({fill: "blue", shape: "dot", text: `message event triggered`});
|
37
|
-
|
38
|
-
}).catch((error) => {
|
39
|
-
node.error(error);
|
40
|
-
});
|
41
|
-
});
|
42
|
-
}
|
43
|
-
RED.nodes.registerType("message-event-trigger", MessageEventTrigger);
|
44
|
-
}
|
@@ -1,41 +0,0 @@
|
|
1
|
-
<script type="text/javascript">
|
2
|
-
RED.nodes.registerType('signal-event-trigger',{
|
3
|
-
category: 'ProcessCube',
|
4
|
-
color: '#00aed7',
|
5
|
-
defaults: {
|
6
|
-
name: {value: ""},
|
7
|
-
engine: {value: "", type: "processcube-engine-config"},
|
8
|
-
signalname: {value: "", required: true},
|
9
|
-
processInstanceId: {value:""}
|
10
|
-
},
|
11
|
-
inputs: 1,
|
12
|
-
outputs: 1,
|
13
|
-
icon: "font-awesome/fa-envelope-open",
|
14
|
-
label: function() {
|
15
|
-
return this.name||"signal-event-trigger";
|
16
|
-
}
|
17
|
-
});
|
18
|
-
</script>
|
19
|
-
|
20
|
-
<script type="text/html" data-template-name="signal-event-trigger">
|
21
|
-
<div class="form-row">
|
22
|
-
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
23
|
-
<input type="text" id="node-input-name" placeholder="Name">
|
24
|
-
</div>
|
25
|
-
<div class="form-row">
|
26
|
-
<label for="node-input-engine"><i class="fa fa-tag"></i> Engine</label>
|
27
|
-
<input type="text" id="node-input-engine" placeholder="Engine">
|
28
|
-
</div>
|
29
|
-
<div class="form-row">
|
30
|
-
<label for="node-input-signalname"><i class="fa fa-tag"></i> Signal Name</label>
|
31
|
-
<input type="text" id="node-input-signalname" placeholder="Name of the Signal">
|
32
|
-
</div>
|
33
|
-
<div class="form-row">
|
34
|
-
<label for="node-input-processinstanceid"><i class="fa fa-tag"></i> Process Instance Id</label>
|
35
|
-
<input type="text" id="node-input-processinstanceid" placeholder="Id of the recipient process instance">
|
36
|
-
</div>
|
37
|
-
</script>
|
38
|
-
|
39
|
-
<script type="text/html" data-help-name="signal-event-trigger">
|
40
|
-
<p>A node which emmits a signal event to the Engine.</p>
|
41
|
-
</script>
|
package/signal-event-trigger.js
DELETED
@@ -1,44 +0,0 @@
|
|
1
|
-
const process = require('process');
|
2
|
-
|
3
|
-
const engine_client = require('@5minds/processcube_engine_client');
|
4
|
-
|
5
|
-
module.exports = function(RED) {
|
6
|
-
function SignalEventTrigger(config) {
|
7
|
-
RED.nodes.createNode(this, config);
|
8
|
-
var node = this;
|
9
|
-
var nodeContext = node.context();
|
10
|
-
|
11
|
-
this.engine = this.server = RED.nodes.getNode(config.engine);
|
12
|
-
|
13
|
-
const engineUrl = this.engine?.url || process.env.ENGINE_URL || 'http://engine:8000';
|
14
|
-
|
15
|
-
var client = nodeContext.get('client');
|
16
|
-
|
17
|
-
if (!client) {
|
18
|
-
nodeContext.set('client', new engine_client.EngineClient(engineUrl));
|
19
|
-
client = nodeContext.get('client');
|
20
|
-
}
|
21
|
-
|
22
|
-
node.on('input', function(msg) {
|
23
|
-
|
24
|
-
client.events.triggerSignalEvent(
|
25
|
-
config.signalname,
|
26
|
-
{
|
27
|
-
processInstanceId: config.processinstanceid,
|
28
|
-
payload: msg.payload
|
29
|
-
}
|
30
|
-
|
31
|
-
).then((result) => {
|
32
|
-
|
33
|
-
msg.payload = result;
|
34
|
-
|
35
|
-
node.send(msg);
|
36
|
-
node.status({fill: "blue", shape: "dot", text: `signal event triggered`});
|
37
|
-
|
38
|
-
}).catch((error) => {
|
39
|
-
node.error(error);
|
40
|
-
});
|
41
|
-
});
|
42
|
-
}
|
43
|
-
RED.nodes.registerType("signal-event-trigger", SignalEventTrigger);
|
44
|
-
}
|