@5minds/node-red-contrib-processcube 0.3.3 → 0.3.5-feature-65fd58-lx819m2o
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/Dockerfile +1 -0
- package/docker-compose.yml +6 -6
- package/nodered/.node-red-contrib-processcube-flows.json.backup +1097 -0
- package/{.node-red/data/flows.json → nodered/node-red-contrib-processcube-flows.json} +218 -0
- package/nodered/sample_fields.json +159 -0
- package/package.json +5 -2
- package/processes/SampleUserTask.bpmn +75 -0
- package/usertask-input.html +31 -0
- package/usertask-input.js +89 -0
- package/usertask-output.html +31 -0
- package/usertask-output.js +45 -0
- package/.node-red/data/.config.nodes.json +0 -563
- package/.node-red/data/.config.nodes.json.backup +0 -563
- package/.node-red/data/.config.runtime.json +0 -4
- package/.node-red/data/.config.runtime.json.backup +0 -3
- package/.node-red/data/.config.users.json +0 -22
- package/.node-red/data/.config.users.json.backup +0 -22
- package/.node-red/data/package-lock.json +0 -19
- package/.node-red/data/package.json +0 -6
- package/.node-red/data/settings.js +0 -560
@@ -7,6 +7,14 @@
|
|
7
7
|
"info": "",
|
8
8
|
"env": []
|
9
9
|
},
|
10
|
+
{
|
11
|
+
"id": "fd3c725340de4f74",
|
12
|
+
"type": "tab",
|
13
|
+
"label": "Flow 2",
|
14
|
+
"disabled": false,
|
15
|
+
"info": "",
|
16
|
+
"env": []
|
17
|
+
},
|
10
18
|
{
|
11
19
|
"id": "d042a4c68f51d6ab",
|
12
20
|
"type": "processcube-engine-config",
|
@@ -875,5 +883,215 @@
|
|
875
883
|
"x": 770,
|
876
884
|
"y": 840,
|
877
885
|
"wires": []
|
886
|
+
},
|
887
|
+
{
|
888
|
+
"id": "ec0be0ef92746967",
|
889
|
+
"type": "usertask-input",
|
890
|
+
"z": "fd3c725340de4f74",
|
891
|
+
"name": "",
|
892
|
+
"engine": "d042a4c68f51d6ab",
|
893
|
+
"x": 250,
|
894
|
+
"y": 120,
|
895
|
+
"wires": [
|
896
|
+
[
|
897
|
+
"090d42845540049c",
|
898
|
+
"846c5269df75c7a1"
|
899
|
+
]
|
900
|
+
]
|
901
|
+
},
|
902
|
+
{
|
903
|
+
"id": "090d42845540049c",
|
904
|
+
"type": "debug",
|
905
|
+
"z": "fd3c725340de4f74",
|
906
|
+
"name": "debug 10",
|
907
|
+
"active": true,
|
908
|
+
"tosidebar": true,
|
909
|
+
"console": false,
|
910
|
+
"tostatus": false,
|
911
|
+
"complete": "false",
|
912
|
+
"statusVal": "",
|
913
|
+
"statusType": "auto",
|
914
|
+
"x": 520,
|
915
|
+
"y": 120,
|
916
|
+
"wires": []
|
917
|
+
},
|
918
|
+
{
|
919
|
+
"id": "661e71d204ee957d",
|
920
|
+
"type": "uibuilder",
|
921
|
+
"z": "fd3c725340de4f74",
|
922
|
+
"name": "",
|
923
|
+
"topic": "",
|
924
|
+
"url": "usertasks",
|
925
|
+
"okToGo": true,
|
926
|
+
"fwdInMessages": false,
|
927
|
+
"allowScripts": false,
|
928
|
+
"allowStyles": false,
|
929
|
+
"copyIndex": true,
|
930
|
+
"templateFolder": "blank",
|
931
|
+
"extTemplate": "",
|
932
|
+
"showfolder": false,
|
933
|
+
"reload": true,
|
934
|
+
"sourceFolder": "src",
|
935
|
+
"deployedVersion": "6.8.2",
|
936
|
+
"showMsgUib": false,
|
937
|
+
"title": "",
|
938
|
+
"descr": "",
|
939
|
+
"x": 410,
|
940
|
+
"y": 300,
|
941
|
+
"wires": [
|
942
|
+
[
|
943
|
+
"823445c277179d4e",
|
944
|
+
"4267576c32c782ec"
|
945
|
+
],
|
946
|
+
[
|
947
|
+
"ce674239858cdfa1"
|
948
|
+
]
|
949
|
+
]
|
950
|
+
},
|
951
|
+
{
|
952
|
+
"id": "823445c277179d4e",
|
953
|
+
"type": "debug",
|
954
|
+
"z": "fd3c725340de4f74",
|
955
|
+
"name": "debug 11",
|
956
|
+
"active": true,
|
957
|
+
"tosidebar": true,
|
958
|
+
"console": false,
|
959
|
+
"tostatus": false,
|
960
|
+
"complete": "false",
|
961
|
+
"statusVal": "",
|
962
|
+
"statusType": "auto",
|
963
|
+
"x": 600,
|
964
|
+
"y": 220,
|
965
|
+
"wires": []
|
966
|
+
},
|
967
|
+
{
|
968
|
+
"id": "4078e4fb0a080b04",
|
969
|
+
"type": "uib-element",
|
970
|
+
"z": "fd3c725340de4f74",
|
971
|
+
"name": "",
|
972
|
+
"topic": "",
|
973
|
+
"elementtype": "sform",
|
974
|
+
"parent": "body",
|
975
|
+
"parentSource": "",
|
976
|
+
"parentSourceType": "str",
|
977
|
+
"elementid": "",
|
978
|
+
"elementId": "",
|
979
|
+
"elementIdSourceType": "str",
|
980
|
+
"heading": "",
|
981
|
+
"headingSourceType": "str",
|
982
|
+
"headingLevel": "h2",
|
983
|
+
"data": "payload",
|
984
|
+
"dataSourceType": "msg",
|
985
|
+
"position": "last",
|
986
|
+
"positionSourceType": "str",
|
987
|
+
"passthrough": false,
|
988
|
+
"confData": {},
|
989
|
+
"x": 390,
|
990
|
+
"y": 420,
|
991
|
+
"wires": [
|
992
|
+
[
|
993
|
+
"c59406be55bd5124"
|
994
|
+
]
|
995
|
+
]
|
996
|
+
},
|
997
|
+
{
|
998
|
+
"id": "3b9e8eb5743f557c",
|
999
|
+
"type": "inject",
|
1000
|
+
"z": "fd3c725340de4f74",
|
1001
|
+
"name": "",
|
1002
|
+
"props": [
|
1003
|
+
{
|
1004
|
+
"p": "payload"
|
1005
|
+
}
|
1006
|
+
],
|
1007
|
+
"repeat": "",
|
1008
|
+
"crontab": "",
|
1009
|
+
"once": false,
|
1010
|
+
"onceDelay": 0.1,
|
1011
|
+
"topic": "",
|
1012
|
+
"payload": "[{\"id\":\"r1\",\"type\":\"text\",\"required\":false,\"label\":\"Label for form row 1\",\"value\":\"Foo\",\"title\":\"Some helpful text\"},{\"id\":\"r11\",\"type\":\"email\",\"required\":true,\"label\":\"Label for form row 11\",\"title\":\"Some helpful text\"},{\"id\":\"r12\",\"type\":\"month\",\"required\":true,\"label\":\"Label for form row 11\",\"title\":\"Some helpful text\"},{\"id\":\"r14\",\"type\":\"time\",\"required\":true,\"label\":\"Label for form row 11\",\"title\":\"Some helpful text\"},{\"id\":\"r15\",\"type\":\"week\",\"required\":true,\"label\":\"Label for form row 11\",\"title\":\"Some helpful text\"},{\"id\":\"r16\",\"type\":\"password\",\"required\":true,\"label\":\"Label for form row 11\",\"title\":\"Some helpful text\"},{\"id\":\"r2\",\"type\":\"range\",\"required\":true,\"label\":\"Label for form row 1\",\"value\":\"Foo\"},{\"id\":\"r3\",\"type\":\"button\",\"label\":\"Text on button\",\"value\":\"Buttons can have values as well\"}]",
|
1013
|
+
"payloadType": "json",
|
1014
|
+
"x": 80,
|
1015
|
+
"y": 400,
|
1016
|
+
"wires": [
|
1017
|
+
[
|
1018
|
+
"4078e4fb0a080b04"
|
1019
|
+
]
|
1020
|
+
]
|
1021
|
+
},
|
1022
|
+
{
|
1023
|
+
"id": "c59406be55bd5124",
|
1024
|
+
"type": "link out",
|
1025
|
+
"z": "fd3c725340de4f74",
|
1026
|
+
"name": "link out 1",
|
1027
|
+
"mode": "link",
|
1028
|
+
"links": [
|
1029
|
+
"d9edaa2e3c514edc"
|
1030
|
+
],
|
1031
|
+
"x": 545,
|
1032
|
+
"y": 400,
|
1033
|
+
"wires": []
|
1034
|
+
},
|
1035
|
+
{
|
1036
|
+
"id": "d9edaa2e3c514edc",
|
1037
|
+
"type": "link in",
|
1038
|
+
"z": "fd3c725340de4f74",
|
1039
|
+
"name": "link in 1",
|
1040
|
+
"links": [
|
1041
|
+
"c59406be55bd5124"
|
1042
|
+
],
|
1043
|
+
"x": 245,
|
1044
|
+
"y": 300,
|
1045
|
+
"wires": [
|
1046
|
+
[
|
1047
|
+
"661e71d204ee957d"
|
1048
|
+
]
|
1049
|
+
]
|
1050
|
+
},
|
1051
|
+
{
|
1052
|
+
"id": "846c5269df75c7a1",
|
1053
|
+
"type": "function",
|
1054
|
+
"z": "fd3c725340de4f74",
|
1055
|
+
"name": "function 2",
|
1056
|
+
"func": "msg.payload = msg.payload.formFields;\n\nreturn msg;",
|
1057
|
+
"outputs": 1,
|
1058
|
+
"timeout": 0,
|
1059
|
+
"noerr": 0,
|
1060
|
+
"initialize": "",
|
1061
|
+
"finalize": "",
|
1062
|
+
"libs": [],
|
1063
|
+
"x": 100,
|
1064
|
+
"y": 280,
|
1065
|
+
"wires": [
|
1066
|
+
[
|
1067
|
+
"4078e4fb0a080b04"
|
1068
|
+
]
|
1069
|
+
]
|
1070
|
+
},
|
1071
|
+
{
|
1072
|
+
"id": "ce674239858cdfa1",
|
1073
|
+
"type": "debug",
|
1074
|
+
"z": "fd3c725340de4f74",
|
1075
|
+
"name": "debug 12",
|
1076
|
+
"active": false,
|
1077
|
+
"tosidebar": true,
|
1078
|
+
"console": false,
|
1079
|
+
"tostatus": false,
|
1080
|
+
"complete": "false",
|
1081
|
+
"statusVal": "",
|
1082
|
+
"statusType": "auto",
|
1083
|
+
"x": 580,
|
1084
|
+
"y": 320,
|
1085
|
+
"wires": []
|
1086
|
+
},
|
1087
|
+
{
|
1088
|
+
"id": "4267576c32c782ec",
|
1089
|
+
"type": "usertask-output",
|
1090
|
+
"z": "fd3c725340de4f74",
|
1091
|
+
"name": "",
|
1092
|
+
"engine": "d042a4c68f51d6ab",
|
1093
|
+
"x": 740,
|
1094
|
+
"y": 260,
|
1095
|
+
"wires": []
|
878
1096
|
}
|
879
1097
|
]
|
@@ -0,0 +1,159 @@
|
|
1
|
+
{
|
2
|
+
"formFields": [
|
3
|
+
{
|
4
|
+
"id": "text_id",
|
5
|
+
"type": "text",
|
6
|
+
"required": false,
|
7
|
+
"label": "Text Label",
|
8
|
+
"value": "",
|
9
|
+
"title": "Some helpful text"
|
10
|
+
},
|
11
|
+
{
|
12
|
+
"id": "number_id",
|
13
|
+
"type": "number",
|
14
|
+
"required": true,
|
15
|
+
"label": "Number Label",
|
16
|
+
"title": "Some helpful text"
|
17
|
+
},
|
18
|
+
{
|
19
|
+
"id": "date_id",
|
20
|
+
"type": "date",
|
21
|
+
"required": true,
|
22
|
+
"label": "Date Label",
|
23
|
+
"title": "Some helpful text"
|
24
|
+
},
|
25
|
+
{
|
26
|
+
"id": "select_id",
|
27
|
+
"type": "select",
|
28
|
+
"required": true,
|
29
|
+
"label": "Select Label",
|
30
|
+
"options": [
|
31
|
+
{
|
32
|
+
"id": "value_01",
|
33
|
+
"name": "Value 01"
|
34
|
+
},
|
35
|
+
{
|
36
|
+
"id": "value_02",
|
37
|
+
"name": "Value 02"
|
38
|
+
}
|
39
|
+
],
|
40
|
+
"title": "Choose an option"
|
41
|
+
},
|
42
|
+
{
|
43
|
+
"id": "boolean_id",
|
44
|
+
"type": "checkbox",
|
45
|
+
"required": false,
|
46
|
+
"label": "Boolean Label",
|
47
|
+
"title": "Check for Yes"
|
48
|
+
},
|
49
|
+
{
|
50
|
+
"id": "_flowNodeInstanceId",
|
51
|
+
"type": "hidden",
|
52
|
+
"value": "549abda6-911c-4b10-b8e3-f4d6383674b2"
|
53
|
+
}
|
54
|
+
],
|
55
|
+
"userTask": {
|
56
|
+
"flowNodeInstanceId": "549abda6-911c-4b10-b8e3-f4d6383674b2",
|
57
|
+
"flowNodeId": "Activity_0ljiko7",
|
58
|
+
"flowNodeName": "Hello world",
|
59
|
+
"flowNodeLane": "Lane",
|
60
|
+
"flowNodeType": "bpmn:UserTask",
|
61
|
+
"previousFlowNodeInstanceId": "a678b21e-db08-48e8-b228-ffc48618022b",
|
62
|
+
"parentProcessInstanceId": null,
|
63
|
+
"processDefinitionId": "SampleUserTask_Definition",
|
64
|
+
"processModelId": "SampleUserTask_Process",
|
65
|
+
"processInstanceId": "251bfdd1-16fb-4f2b-98b3-7c28a49eec4d",
|
66
|
+
"correlationId": "3c6dadd7-a0fe-43c0-a8aa-9b1b87c149f5",
|
67
|
+
"state": "suspended",
|
68
|
+
"tokens": [],
|
69
|
+
"startToken": {},
|
70
|
+
"endToken": {},
|
71
|
+
"ownerId": "dummy_token",
|
72
|
+
"startedAt": "2024-06-09T20:47:27.494Z",
|
73
|
+
"assignedUserIds": null,
|
74
|
+
"actualOwnerId": null,
|
75
|
+
"finishedByUserId": null,
|
76
|
+
"userTaskConfig": {
|
77
|
+
"formFields": [
|
78
|
+
{
|
79
|
+
"id": "text_id",
|
80
|
+
"label": "Text Label",
|
81
|
+
"type": "string"
|
82
|
+
},
|
83
|
+
{
|
84
|
+
"id": "number_id",
|
85
|
+
"label": "Number Label",
|
86
|
+
"type": "long",
|
87
|
+
"defaultValue": "undefined",
|
88
|
+
"customForm": "{\"hint\":\"Sample\"}"
|
89
|
+
},
|
90
|
+
{
|
91
|
+
"id": "date_id",
|
92
|
+
"label": "Date Label",
|
93
|
+
"type": "date"
|
94
|
+
},
|
95
|
+
{
|
96
|
+
"id": "select_id",
|
97
|
+
"label": "Select Label",
|
98
|
+
"type": "enum",
|
99
|
+
"enumValues": [
|
100
|
+
{
|
101
|
+
"id": "value_01",
|
102
|
+
"name": "Value 01"
|
103
|
+
},
|
104
|
+
{
|
105
|
+
"id": "value_02",
|
106
|
+
"name": "Value 02"
|
107
|
+
}
|
108
|
+
]
|
109
|
+
},
|
110
|
+
{
|
111
|
+
"id": "boolean_id",
|
112
|
+
"label": "Boolean Label",
|
113
|
+
"type": "boolean"
|
114
|
+
}
|
115
|
+
]
|
116
|
+
},
|
117
|
+
"userTaskConfigModel": {
|
118
|
+
"formFields": [
|
119
|
+
{
|
120
|
+
"id": "text_id",
|
121
|
+
"label": "Text Label",
|
122
|
+
"type": "string"
|
123
|
+
},
|
124
|
+
{
|
125
|
+
"id": "number_id",
|
126
|
+
"label": "Number Label",
|
127
|
+
"type": "long",
|
128
|
+
"defaultValue": "${token.current.sample}",
|
129
|
+
"customForm": "{\"hint\":\"Sample\"}"
|
130
|
+
},
|
131
|
+
{
|
132
|
+
"id": "date_id",
|
133
|
+
"label": "Date Label",
|
134
|
+
"type": "date"
|
135
|
+
},
|
136
|
+
{
|
137
|
+
"id": "select_id",
|
138
|
+
"label": "Select Label",
|
139
|
+
"type": "enum",
|
140
|
+
"enumValues": [
|
141
|
+
{
|
142
|
+
"id": "value_01",
|
143
|
+
"name": "Value 01"
|
144
|
+
},
|
145
|
+
{
|
146
|
+
"id": "value_02",
|
147
|
+
"name": "Value 02"
|
148
|
+
}
|
149
|
+
]
|
150
|
+
},
|
151
|
+
{
|
152
|
+
"id": "boolean_id",
|
153
|
+
"label": "Boolean Label",
|
154
|
+
"type": "boolean"
|
155
|
+
}
|
156
|
+
]
|
157
|
+
}
|
158
|
+
}
|
159
|
+
}
|
package/package.json
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
{
|
2
2
|
"name": "@5minds/node-red-contrib-processcube",
|
3
|
-
"version": "0.3.
|
3
|
+
"version": "0.3.5-feature-65fd58-lx819m2o",
|
4
4
|
"license": "MIT",
|
5
5
|
"description": "Node-RED nodes for ProcessCube",
|
6
|
-
"authors": [
|
6
|
+
"authors": [
|
7
|
+
{
|
7
8
|
"name": "Martin Moellenbeck",
|
8
9
|
"email": "Martin.Moellenbeck@5Minds.de"
|
9
10
|
},
|
@@ -31,6 +32,8 @@
|
|
31
32
|
"externaltaskOutput": "externaltask-output.js",
|
32
33
|
"externaltaskError": "externaltask-error.js",
|
33
34
|
"processStart": "process-start.js",
|
35
|
+
"UserTaskInput": "usertask-input.js",
|
36
|
+
"UserTaskOutput": "usertask-output.js",
|
34
37
|
"processcubeEngineConfig": "processcube-engine-config.js"
|
35
38
|
}
|
36
39
|
},
|
@@ -0,0 +1,75 @@
|
|
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="SampleUserTask_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="SampleUserTask" processRef="SampleUserTask_Process" />
|
5
|
+
</bpmn:collaboration>
|
6
|
+
<bpmn:process id="SampleUserTask_Process" name="SampleUserTask" isExecutable="true">
|
7
|
+
<bpmn:laneSet>
|
8
|
+
<bpmn:lane id="Lane_1xzf0d3" name="Lane">
|
9
|
+
<bpmn:flowNodeRef>StartEvent_1</bpmn:flowNodeRef>
|
10
|
+
<bpmn:flowNodeRef>Event_1eeiwx4</bpmn:flowNodeRef>
|
11
|
+
<bpmn:flowNodeRef>Activity_0ljiko7</bpmn:flowNodeRef>
|
12
|
+
</bpmn:lane>
|
13
|
+
</bpmn:laneSet>
|
14
|
+
<bpmn:startEvent id="StartEvent_1" name="Start">
|
15
|
+
<bpmn:extensionElements>
|
16
|
+
<camunda:properties>
|
17
|
+
<camunda:property name="studio.defaultCustomStartToken" value="{ "sample": "hello" }" />
|
18
|
+
</camunda:properties>
|
19
|
+
</bpmn:extensionElements>
|
20
|
+
<bpmn:outgoing>Flow_1h0giih</bpmn:outgoing>
|
21
|
+
</bpmn:startEvent>
|
22
|
+
<bpmn:sequenceFlow id="Flow_1h0giih" sourceRef="StartEvent_1" targetRef="Activity_0ljiko7" />
|
23
|
+
<bpmn:endEvent id="Event_1eeiwx4">
|
24
|
+
<bpmn:incoming>Flow_1laqnja</bpmn:incoming>
|
25
|
+
</bpmn:endEvent>
|
26
|
+
<bpmn:sequenceFlow id="Flow_1laqnja" sourceRef="Activity_0ljiko7" targetRef="Event_1eeiwx4" />
|
27
|
+
<bpmn:userTask id="Activity_0ljiko7" name="Hello world">
|
28
|
+
<bpmn:extensionElements>
|
29
|
+
<camunda:formData>
|
30
|
+
<camunda:formField id="text_id" label="Text Label" type="string" />
|
31
|
+
<camunda:formField id="number_id" label="Number Label" type="long" defaultValue="${token.current.sample}" customForm="{"hint":"Sample"}" />
|
32
|
+
<camunda:formField id="date_id" label="Date Label" type="date" />
|
33
|
+
<camunda:formField id="select_id" label="Select Label" type="enum">
|
34
|
+
<camunda:value id="value_01" name="Value 01" />
|
35
|
+
<camunda:value id="value_02" name="Value 02" />
|
36
|
+
</camunda:formField>
|
37
|
+
<camunda:formField id="boolean_id" label="Boolean Label" type="boolean" />
|
38
|
+
</camunda:formData>
|
39
|
+
</bpmn:extensionElements>
|
40
|
+
<bpmn:incoming>Flow_1h0giih</bpmn:incoming>
|
41
|
+
<bpmn:outgoing>Flow_1laqnja</bpmn:outgoing>
|
42
|
+
</bpmn:userTask>
|
43
|
+
</bpmn:process>
|
44
|
+
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
|
45
|
+
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Collaboration_1cidyxu">
|
46
|
+
<bpmndi:BPMNShape id="Participant_0px403d_di" bpmnElement="Participant_0px403d" isHorizontal="true">
|
47
|
+
<dc:Bounds x="5" y="4" width="435" height="346" />
|
48
|
+
</bpmndi:BPMNShape>
|
49
|
+
<bpmndi:BPMNShape id="Lane_1xzf0d3_di" bpmnElement="Lane_1xzf0d3" isHorizontal="true">
|
50
|
+
<dc:Bounds x="35" y="4" width="405" height="346" />
|
51
|
+
</bpmndi:BPMNShape>
|
52
|
+
<bpmndi:BPMNShape id="StartEvent_1_di" bpmnElement="StartEvent_1">
|
53
|
+
<dc:Bounds x="92" y="152" width="36" height="36" />
|
54
|
+
<bpmndi:BPMNLabel>
|
55
|
+
<dc:Bounds x="98" y="195" width="24" height="14" />
|
56
|
+
</bpmndi:BPMNLabel>
|
57
|
+
</bpmndi:BPMNShape>
|
58
|
+
<bpmndi:BPMNShape id="Event_1eeiwx4_di" bpmnElement="Event_1eeiwx4">
|
59
|
+
<dc:Bounds x="332" y="152" width="36" height="36" />
|
60
|
+
</bpmndi:BPMNShape>
|
61
|
+
<bpmndi:BPMNShape id="Activity_1uodwbi_di" bpmnElement="Activity_0ljiko7">
|
62
|
+
<dc:Bounds x="180" y="130" width="100" height="80" />
|
63
|
+
<bpmndi:BPMNLabel />
|
64
|
+
</bpmndi:BPMNShape>
|
65
|
+
<bpmndi:BPMNEdge id="Flow_1h0giih_di" bpmnElement="Flow_1h0giih">
|
66
|
+
<di:waypoint x="128" y="170" />
|
67
|
+
<di:waypoint x="180" y="170" />
|
68
|
+
</bpmndi:BPMNEdge>
|
69
|
+
<bpmndi:BPMNEdge id="Flow_1laqnja_di" bpmnElement="Flow_1laqnja">
|
70
|
+
<di:waypoint x="280" y="170" />
|
71
|
+
<di:waypoint x="332" y="170" />
|
72
|
+
</bpmndi:BPMNEdge>
|
73
|
+
</bpmndi:BPMNPlane>
|
74
|
+
</bpmndi:BPMNDiagram>
|
75
|
+
</bpmn:definitions>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<script type="text/javascript">
|
2
|
+
RED.nodes.registerType('usertask-input',{
|
3
|
+
category: 'ProcessCube',
|
4
|
+
color: '#00aed7',
|
5
|
+
defaults: {
|
6
|
+
name: {value: ""},
|
7
|
+
engine: {value: "", type: "processcube-engine-config"}
|
8
|
+
},
|
9
|
+
inputs: 0,
|
10
|
+
outputs: 1,
|
11
|
+
icon: "font-awesome/fa-envelope-open",
|
12
|
+
label: function() {
|
13
|
+
return this.name || "usertask-input";
|
14
|
+
}
|
15
|
+
});
|
16
|
+
</script>
|
17
|
+
|
18
|
+
<script type="text/html" data-template-name="usertask-input">
|
19
|
+
<div class="form-row">
|
20
|
+
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
21
|
+
<input type="text" id="node-input-name" placeholder="Name">
|
22
|
+
</div>
|
23
|
+
<div class="form-row">
|
24
|
+
<label for="node-input-engine"><i class="fa fa-tag"></i> Engine-URL</label>
|
25
|
+
<input type="text" id="node-input-engine" placeholder="http://engine:8000">
|
26
|
+
</div>
|
27
|
+
</script>
|
28
|
+
|
29
|
+
<script type="text/html" data-help-name="usertask-input">
|
30
|
+
<p>A node which subscribes to an User Task of https://processcube.io</p>
|
31
|
+
</script>
|
@@ -0,0 +1,89 @@
|
|
1
|
+
const process = require('process');
|
2
|
+
const EventEmitter = require('node:events');
|
3
|
+
|
4
|
+
const engine_client = require('@5minds/processcube_engine_client');
|
5
|
+
|
6
|
+
function showStatus(node, msgCounter) {
|
7
|
+
if (msgCounter >= 1) {
|
8
|
+
node.status({fill: "blue", shape: "dot", text: `handling tasks ${msgCounter}`});
|
9
|
+
} else {
|
10
|
+
node.status({fill: "blue", shape: "ring", text: `subcribed ${msgCounter}`});
|
11
|
+
}
|
12
|
+
}
|
13
|
+
|
14
|
+
function mapUserTaskToMsg(userTask) {
|
15
|
+
return userTask.userTaskConfig.formFields.map(field => {
|
16
|
+
switch (field.type) {
|
17
|
+
case 'string':
|
18
|
+
return { id: field.id, type: 'text', required: false, label: field.label, value: '', title: 'Some helpful text' };
|
19
|
+
case 'long':
|
20
|
+
return { id: field.id, type: 'number', required: true, label: field.label, title: 'Some helpful text' };
|
21
|
+
case 'date':
|
22
|
+
return { id: field.id, type: 'date', required: true, label: field.label, title: 'Some helpful text' };
|
23
|
+
case 'enum':
|
24
|
+
return { id: field.id, type: 'select', required: true, label: field.label, options: field.enumValues.map(v => ({ id: v.id, name: v.name })), title: 'Choose an option' };
|
25
|
+
case 'boolean':
|
26
|
+
return { id: field.id, type: 'checkbox', required: false, label: field.label, title: 'Check for Yes' };
|
27
|
+
default:
|
28
|
+
return { id: field.id, type: field.type, required: true, label: field.label, title: 'Additional Information Needed' };
|
29
|
+
}
|
30
|
+
});
|
31
|
+
}
|
32
|
+
|
33
|
+
module.exports = function(RED) {
|
34
|
+
function UserTaskInput(config) {
|
35
|
+
RED.nodes.createNode(this,config);
|
36
|
+
var node = this;
|
37
|
+
var msgCounter = 0;
|
38
|
+
var flowContext = node.context().flow;
|
39
|
+
var nodeContext = node.context();
|
40
|
+
|
41
|
+
this.engine = this.server = RED.nodes.getNode(config.engine);
|
42
|
+
|
43
|
+
const engineUrl = this.engine?.url || process.env.ENGINE_URL || 'http://engine:8000';
|
44
|
+
|
45
|
+
var client = nodeContext.get('client');
|
46
|
+
|
47
|
+
if (!client) {
|
48
|
+
nodeContext.set('client', new engine_client.EngineClient(engineUrl));
|
49
|
+
client = nodeContext.get('client');
|
50
|
+
}
|
51
|
+
|
52
|
+
var eventEmitter = flowContext.get('emitter');
|
53
|
+
|
54
|
+
if (!eventEmitter) {
|
55
|
+
flowContext.set('emitter', new EventEmitter());
|
56
|
+
eventEmitter = flowContext.get('emitter');
|
57
|
+
}
|
58
|
+
|
59
|
+
client.userTasks.onUserTaskWaiting((userTaskWaitingNotification) => {
|
60
|
+
console.log(`UserTask with id ${userTaskWaitingNotification.flowNodeInstanceId} is waiting.`);
|
61
|
+
|
62
|
+
// Abschließend mit - client.userTasks.finishUserTask(waitingUserTask?.flowNodeInstanceId, sampleResult)
|
63
|
+
|
64
|
+
// flowNodeInstanceId
|
65
|
+
// processModelName
|
66
|
+
// flowNodeId
|
67
|
+
client.userTasks.query({
|
68
|
+
flowNodeInstanceId: userTaskWaitingNotification.flowNodeInstanceId,
|
69
|
+
processModelId: userTaskWaitingNotification.processModelId,
|
70
|
+
flowNodeId: userTaskWaitingNotification.flowNodeId,
|
71
|
+
}).then((matchingFlowNodes) => {
|
72
|
+
if (matchingFlowNodes && matchingFlowNodes.userTasks && matchingFlowNodes.userTasks.length == 1) {
|
73
|
+
userTask = matchingFlowNodes.userTasks[0];
|
74
|
+
|
75
|
+
let formFields = mapUserTaskToMsg(userTask);
|
76
|
+
|
77
|
+
let flowNodeInstanceId = { id: "_flowNodeInstanceId", type: "hidden", value: userTaskWaitingNotification.flowNodeInstanceId};
|
78
|
+
formFields.push(flowNodeInstanceId);
|
79
|
+
|
80
|
+
node.send({ payload: {formFields: formFields, userTask: userTask }});
|
81
|
+
|
82
|
+
} else {
|
83
|
+
node.send({ payload: matchingFlowNodes });
|
84
|
+
}
|
85
|
+
});
|
86
|
+
});
|
87
|
+
}
|
88
|
+
RED.nodes.registerType("usertask-input", UserTaskInput);
|
89
|
+
}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<script type="text/javascript">
|
2
|
+
RED.nodes.registerType('usertask-output',{
|
3
|
+
category: 'ProcessCube',
|
4
|
+
color: '#00aed7',
|
5
|
+
defaults: {
|
6
|
+
name: {value: ""},
|
7
|
+
engine: {value: "", type: "processcube-engine-config"}
|
8
|
+
},
|
9
|
+
inputs: 1,
|
10
|
+
outputs: 0,
|
11
|
+
icon: "font-awesome/fa-envelope",
|
12
|
+
label: function() {
|
13
|
+
return this.name || "usertask-output";
|
14
|
+
}
|
15
|
+
});
|
16
|
+
</script>
|
17
|
+
|
18
|
+
<script type="text/html" data-template-name="usertask-output">
|
19
|
+
<div class="form-row">
|
20
|
+
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
21
|
+
<input type="text" id="node-input-name" placeholder="Name">
|
22
|
+
</div>
|
23
|
+
<div class="form-row">
|
24
|
+
<label for="node-input-engine"><i class="fa fa-tag"></i> Engine-URL</label>
|
25
|
+
<input type="text" id="node-input-engine" placeholder="http://engine:8000">
|
26
|
+
</div>
|
27
|
+
</script>
|
28
|
+
|
29
|
+
<script type="text/html" data-help-name="usertask-output">
|
30
|
+
<p>A node which send the result to an User Task of https://processcube.io</p>
|
31
|
+
</script>
|