@5minds/node-red-contrib-processcube 1.6.3 → 1.6.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/docker-compose.yml +1 -0
- package/externaltask-input.html +11 -0
- package/externaltask-input.js +3 -2
- package/nodered/flows.json +121 -0
- package/package.json +1 -1
- package/processes/External-Task-Env-Topic.bpmn +57 -0
- package/usertask-output.js +6 -1
package/docker-compose.yml
CHANGED
package/externaltask-input.html
CHANGED
@@ -6,6 +6,7 @@
|
|
6
6
|
name: { value: '' },
|
7
7
|
engine: { value: '', type: 'processcube-engine-config' },
|
8
8
|
topic: { value: '' },
|
9
|
+
topicType: { value: '' },
|
9
10
|
workerConfig: { value: '{}'},
|
10
11
|
workerConfigType: { value: 'json'}
|
11
12
|
},
|
@@ -23,6 +24,14 @@
|
|
23
24
|
|
24
25
|
$('#node-input-workerConfig').typedInput('value', this.workerConfig);
|
25
26
|
$('#node-input-workerConfig').typedInput('type', this.workerConfigType);
|
27
|
+
|
28
|
+
$('#node-input-topic').typedInput({
|
29
|
+
default: 'str',
|
30
|
+
types: ['str', 'env'],
|
31
|
+
});
|
32
|
+
|
33
|
+
$('#node-input-topic').typedInput('value', this.topic);
|
34
|
+
$('#node-input-topic').typedInput('type', this.topicType);
|
26
35
|
},
|
27
36
|
oneditsave: function () {
|
28
37
|
this.workerConfig = $('#node-input-workerConfig').typedInput('value');
|
@@ -31,6 +40,8 @@
|
|
31
40
|
$('#node-input-workerConfig').typedInput('value', '{}');
|
32
41
|
}
|
33
42
|
this.workerConfigType = $('#node-input-workerConfig').typedInput('type');
|
43
|
+
this.topic = $('#node-input-topic').typedInput('value');
|
44
|
+
this.topicType = $('#node-input-topic').typedInput('type');
|
34
45
|
},
|
35
46
|
});
|
36
47
|
</script>
|
package/externaltask-input.js
CHANGED
@@ -121,10 +121,11 @@ module.exports = function (RED) {
|
|
121
121
|
});
|
122
122
|
};
|
123
123
|
|
124
|
-
let options = RED.util.evaluateNodeProperty(config.workerConfig,
|
124
|
+
let options = RED.util.evaluateNodeProperty(config.workerConfig, config.workerConfigType, node);
|
125
|
+
let topic = RED.util.evaluateNodeProperty(config.topic, config.topicType, node)
|
125
126
|
|
126
127
|
client.externalTasks
|
127
|
-
.subscribeToExternalTaskTopic(
|
128
|
+
.subscribeToExternalTaskTopic(topic, etwCallback, options)
|
128
129
|
.then(async (externalTaskWorker) => {
|
129
130
|
node.status({ fill: 'blue', shape: 'ring', text: 'subcribed' });
|
130
131
|
|
package/nodered/flows.json
CHANGED
@@ -507,6 +507,32 @@
|
|
507
507
|
"w": 552,
|
508
508
|
"h": 142
|
509
509
|
},
|
510
|
+
{
|
511
|
+
"id": "73ca179de59cdabf",
|
512
|
+
"type": "group",
|
513
|
+
"z": "a23d2e782beb66f4",
|
514
|
+
"style": {
|
515
|
+
"stroke": "#999999",
|
516
|
+
"stroke-opacity": "1",
|
517
|
+
"fill": "none",
|
518
|
+
"fill-opacity": "1",
|
519
|
+
"label": true,
|
520
|
+
"label-position": "nw",
|
521
|
+
"color": "#a4a4a4"
|
522
|
+
},
|
523
|
+
"nodes": [
|
524
|
+
"3283986789f6f865",
|
525
|
+
"f2b869714547df91",
|
526
|
+
"7a24dd57f7964be1",
|
527
|
+
"9be410342a64e57a",
|
528
|
+
"7bc885294b6f6b08",
|
529
|
+
"412d03bddecd4fd4"
|
530
|
+
],
|
531
|
+
"x": 34,
|
532
|
+
"y": 739,
|
533
|
+
"w": 682,
|
534
|
+
"h": 202
|
535
|
+
},
|
510
536
|
{
|
511
537
|
"id": "42e6796dddd9d4db",
|
512
538
|
"type": "processcube-engine-config",
|
@@ -824,6 +850,101 @@
|
|
824
850
|
"y": 540,
|
825
851
|
"wires": []
|
826
852
|
},
|
853
|
+
{
|
854
|
+
"id": "3283986789f6f865",
|
855
|
+
"type": "externaltask-input",
|
856
|
+
"z": "a23d2e782beb66f4",
|
857
|
+
"g": "73ca179de59cdabf",
|
858
|
+
"name": "TopicFromENV",
|
859
|
+
"engine": "42e6796dddd9d4db",
|
860
|
+
"topic": "TOPIC",
|
861
|
+
"topicType": "env",
|
862
|
+
"workerConfig": "{}",
|
863
|
+
"workerConfigType": "json",
|
864
|
+
"x": 140,
|
865
|
+
"y": 840,
|
866
|
+
"wires": [
|
867
|
+
[
|
868
|
+
"f2b869714547df91"
|
869
|
+
]
|
870
|
+
]
|
871
|
+
},
|
872
|
+
{
|
873
|
+
"id": "f2b869714547df91",
|
874
|
+
"type": "delay",
|
875
|
+
"z": "a23d2e782beb66f4",
|
876
|
+
"g": "73ca179de59cdabf",
|
877
|
+
"name": "",
|
878
|
+
"pauseType": "delay",
|
879
|
+
"timeout": "5",
|
880
|
+
"timeoutUnits": "seconds",
|
881
|
+
"rate": "1",
|
882
|
+
"nbRateUnits": "1",
|
883
|
+
"rateUnits": "second",
|
884
|
+
"randomFirst": "1",
|
885
|
+
"randomLast": "5",
|
886
|
+
"randomUnits": "seconds",
|
887
|
+
"drop": false,
|
888
|
+
"allowrate": false,
|
889
|
+
"outputs": 1,
|
890
|
+
"x": 400,
|
891
|
+
"y": 840,
|
892
|
+
"wires": [
|
893
|
+
[
|
894
|
+
"7a24dd57f7964be1"
|
895
|
+
]
|
896
|
+
]
|
897
|
+
},
|
898
|
+
{
|
899
|
+
"id": "7a24dd57f7964be1",
|
900
|
+
"type": "externaltask-output",
|
901
|
+
"z": "a23d2e782beb66f4",
|
902
|
+
"g": "73ca179de59cdabf",
|
903
|
+
"name": "",
|
904
|
+
"x": 600,
|
905
|
+
"y": 840,
|
906
|
+
"wires": []
|
907
|
+
},
|
908
|
+
{
|
909
|
+
"id": "9be410342a64e57a",
|
910
|
+
"type": "externaltask-error",
|
911
|
+
"z": "a23d2e782beb66f4",
|
912
|
+
"g": "73ca179de59cdabf",
|
913
|
+
"name": "",
|
914
|
+
"error": "",
|
915
|
+
"x": 510,
|
916
|
+
"y": 900,
|
917
|
+
"wires": [
|
918
|
+
[]
|
919
|
+
]
|
920
|
+
},
|
921
|
+
{
|
922
|
+
"id": "7bc885294b6f6b08",
|
923
|
+
"type": "catch",
|
924
|
+
"z": "a23d2e782beb66f4",
|
925
|
+
"g": "73ca179de59cdabf",
|
926
|
+
"name": "",
|
927
|
+
"scope": null,
|
928
|
+
"uncaught": false,
|
929
|
+
"x": 320,
|
930
|
+
"y": 900,
|
931
|
+
"wires": [
|
932
|
+
[
|
933
|
+
"9be410342a64e57a"
|
934
|
+
]
|
935
|
+
]
|
936
|
+
},
|
937
|
+
{
|
938
|
+
"id": "412d03bddecd4fd4",
|
939
|
+
"type": "comment",
|
940
|
+
"z": "a23d2e782beb66f4",
|
941
|
+
"g": "73ca179de59cdabf",
|
942
|
+
"name": "External Task with Topic from ENV",
|
943
|
+
"info": "",
|
944
|
+
"x": 200,
|
945
|
+
"y": 780,
|
946
|
+
"wires": []
|
947
|
+
},
|
827
948
|
{
|
828
949
|
"id": "82533b02fb9a9f04",
|
829
950
|
"type": "comment",
|
package/package.json
CHANGED
@@ -0,0 +1,57 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="External-Task-Env-Topic_Definition" targetNamespace="http://bpmn.io/schema/bpmn" exporter="5Minds Studio" exporterVersion="1">
|
3
|
+
<bpmn:collaboration id="Collaboration_1cidyxu" name="">
|
4
|
+
<bpmn:participant id="Participant_0px403d" name="External-Task-Env-Topic" processRef="External-Task-Env-Topic_Process" />
|
5
|
+
</bpmn:collaboration>
|
6
|
+
<bpmn:process id="External-Task-Env-Topic_Process" name="External-Task-Env-Topic" isExecutable="true">
|
7
|
+
<bpmn:laneSet>
|
8
|
+
<bpmn:lane id="Lane_1xzf0d3">
|
9
|
+
<bpmn:flowNodeRef>StartEvent_1</bpmn:flowNodeRef>
|
10
|
+
<bpmn:flowNodeRef>Event_0altset</bpmn:flowNodeRef>
|
11
|
+
<bpmn:flowNodeRef>Activity_0oql7b5</bpmn:flowNodeRef>
|
12
|
+
</bpmn:lane>
|
13
|
+
</bpmn:laneSet>
|
14
|
+
<bpmn:startEvent id="StartEvent_1" name="Start">
|
15
|
+
<bpmn:outgoing>Flow_1y2qxv2</bpmn:outgoing>
|
16
|
+
</bpmn:startEvent>
|
17
|
+
<bpmn:sequenceFlow id="Flow_1y2qxv2" sourceRef="StartEvent_1" targetRef="Activity_0oql7b5" />
|
18
|
+
<bpmn:endEvent id="Event_0altset">
|
19
|
+
<bpmn:incoming>Flow_01qqshn</bpmn:incoming>
|
20
|
+
</bpmn:endEvent>
|
21
|
+
<bpmn:sequenceFlow id="Flow_01qqshn" sourceRef="Activity_0oql7b5" targetRef="Event_0altset" />
|
22
|
+
<bpmn:serviceTask id="Activity_0oql7b5" name="External Task with topic from ENV" camunda:type="external" camunda:topic="TopicFromENV">
|
23
|
+
<bpmn:incoming>Flow_1y2qxv2</bpmn:incoming>
|
24
|
+
<bpmn:outgoing>Flow_01qqshn</bpmn:outgoing>
|
25
|
+
</bpmn:serviceTask>
|
26
|
+
</bpmn:process>
|
27
|
+
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
|
28
|
+
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Collaboration_1cidyxu">
|
29
|
+
<bpmndi:BPMNShape id="Participant_0px403d_di" bpmnElement="Participant_0px403d" isHorizontal="true">
|
30
|
+
<dc:Bounds x="5" y="4" width="885" height="346" />
|
31
|
+
</bpmndi:BPMNShape>
|
32
|
+
<bpmndi:BPMNShape id="Lane_1xzf0d3_di" bpmnElement="Lane_1xzf0d3" isHorizontal="true">
|
33
|
+
<dc:Bounds x="35" y="4" width="855" height="346" />
|
34
|
+
</bpmndi:BPMNShape>
|
35
|
+
<bpmndi:BPMNShape id="StartEvent_1_di" bpmnElement="StartEvent_1">
|
36
|
+
<dc:Bounds x="92" y="152" width="36" height="36" />
|
37
|
+
<bpmndi:BPMNLabel>
|
38
|
+
<dc:Bounds x="98" y="195" width="24" height="14" />
|
39
|
+
</bpmndi:BPMNLabel>
|
40
|
+
</bpmndi:BPMNShape>
|
41
|
+
<bpmndi:BPMNShape id="Event_0altset_di" bpmnElement="Event_0altset">
|
42
|
+
<dc:Bounds x="332" y="152" width="36" height="36" />
|
43
|
+
</bpmndi:BPMNShape>
|
44
|
+
<bpmndi:BPMNShape id="Activity_1hcksxj_di" bpmnElement="Activity_0oql7b5">
|
45
|
+
<dc:Bounds x="180" y="130" width="100" height="80" />
|
46
|
+
</bpmndi:BPMNShape>
|
47
|
+
<bpmndi:BPMNEdge id="Flow_1y2qxv2_di" bpmnElement="Flow_1y2qxv2">
|
48
|
+
<di:waypoint x="128" y="170" />
|
49
|
+
<di:waypoint x="180" y="170" />
|
50
|
+
</bpmndi:BPMNEdge>
|
51
|
+
<bpmndi:BPMNEdge id="Flow_01qqshn_di" bpmnElement="Flow_01qqshn">
|
52
|
+
<di:waypoint x="280" y="170" />
|
53
|
+
<di:waypoint x="332" y="170" />
|
54
|
+
</bpmndi:BPMNEdge>
|
55
|
+
</bpmndi:BPMNPlane>
|
56
|
+
</bpmndi:BPMNDiagram>
|
57
|
+
</bpmn:definitions>
|
package/usertask-output.js
CHANGED
@@ -7,7 +7,12 @@ module.exports = function (RED) {
|
|
7
7
|
if (msg.payload.userTask) {
|
8
8
|
const flowNodeInstanceId = msg.payload.userTask.flowNodeInstanceId;
|
9
9
|
|
10
|
-
|
10
|
+
let userTaskResult = RED.util.evaluateNodeProperty(config.result, config.result_type, node, msg);
|
11
|
+
|
12
|
+
// remote msg and format from result
|
13
|
+
delete userTaskResult.format;
|
14
|
+
delete userTaskResult.msg;
|
15
|
+
|
11
16
|
|
12
17
|
node.engine = RED.nodes.getNode(config.engine);
|
13
18
|
|