@5minds/node-red-contrib-processcube 0.6.0-develop-a016f3-lxu6osmc → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -106,6 +106,7 @@
106
106
  "1497b762d2ac1723",
107
107
  "493500b42d8d0f5b",
108
108
  "34984ae3f4e83b0b",
109
+ "8e2a2f993ee7156a",
109
110
  "eee38d2764bac337",
110
111
  "a4d741804929ba73",
111
112
  "915816cdb895af14",
@@ -160,15 +161,12 @@
160
161
  "5cc47f646e818d1e",
161
162
  "66b90cf83a531a75",
162
163
  "e002a108a6c7df75",
163
- "2851b83de5fb070d",
164
- "a547ad5dcdd4613f",
165
- "e98eecc53e433cfe",
166
- "ed3c805cc0dc276c"
164
+ "2851b83de5fb070d"
167
165
  ],
168
166
  "x": 34,
169
167
  "y": 559,
170
- "w": 952,
171
- "h": 182
168
+ "w": 712,
169
+ "h": 142
172
170
  },
173
171
  {
174
172
  "id": "02fef81e2129ea71",
@@ -381,33 +379,6 @@
381
379
  "visible": "true",
382
380
  "disabled": "false"
383
381
  },
384
- {
385
- "id": "973fe345c23a83a4",
386
- "type": "ui-page",
387
- "name": "DynamicTable",
388
- "ui": "26a45d43c064bdb6",
389
- "path": "/page4",
390
- "icon": "home",
391
- "layout": "grid",
392
- "theme": "7175f012d8e51857",
393
- "order": -1,
394
- "className": "",
395
- "visible": "true",
396
- "disabled": "false"
397
- },
398
- {
399
- "id": "99fb2417816969fd",
400
- "type": "ui-group",
401
- "name": "Table",
402
- "page": "973fe345c23a83a4",
403
- "width": "12",
404
- "height": "1",
405
- "order": -1,
406
- "showTitle": true,
407
- "className": "",
408
- "visible": "true",
409
- "disabled": "false"
410
- },
411
382
  {
412
383
  "id": "84f18cf9bf25b858",
413
384
  "type": "openApi-red",
@@ -1479,8 +1450,6 @@
1479
1450
  "g": "405f8c703368777c",
1480
1451
  "name": "",
1481
1452
  "engine": "42e6796dddd9d4db",
1482
- "query": "payload",
1483
- "force_send_array": true,
1484
1453
  "multisend": false,
1485
1454
  "x": 540,
1486
1455
  "y": 140,
@@ -1537,8 +1506,6 @@
1537
1506
  "g": "405f8c703368777c",
1538
1507
  "name": "",
1539
1508
  "engine": "d042a4c68f51d6ab",
1540
- "result": "payload",
1541
- "result_type": "msg",
1542
1509
  "x": 1020,
1543
1510
  "y": 140,
1544
1511
  "wires": [
@@ -1743,10 +1710,10 @@
1743
1710
  "once": false,
1744
1711
  "onceDelay": 0.1,
1745
1712
  "topic": "",
1746
- "payload": "{\"flowNodeInstanceId\":\"a84dfgh2b416-58f7-443f-bd38-c10ddcd776cb\"}",
1747
- "payloadType": "json",
1713
+ "payload": "{\t \"state\": \"suspended\"\t}",
1714
+ "payloadType": "jsonata",
1748
1715
  "x": 160,
1749
- "y": 700,
1716
+ "y": 660,
1750
1717
  "wires": [
1751
1718
  [
1752
1719
  "66b90cf83a531a75"
@@ -1760,16 +1727,12 @@
1760
1727
  "g": "b60e94a5f1ee2790",
1761
1728
  "name": "",
1762
1729
  "engine": "d042a4c68f51d6ab",
1763
- "query": "payload",
1764
- "query_type": "msg",
1765
- "force_send_array": false,
1766
1730
  "multisend": false,
1767
1731
  "x": 400,
1768
- "y": 700,
1732
+ "y": 660,
1769
1733
  "wires": [
1770
1734
  [
1771
- "e002a108a6c7df75",
1772
- "a547ad5dcdd4613f"
1735
+ "e002a108a6c7df75"
1773
1736
  ]
1774
1737
  ]
1775
1738
  },
@@ -1787,7 +1750,7 @@
1787
1750
  "statusVal": "",
1788
1751
  "statusType": "auto",
1789
1752
  "x": 640,
1790
- "y": 700,
1753
+ "y": 660,
1791
1754
  "wires": []
1792
1755
  },
1793
1756
  {
@@ -1798,201 +1761,9 @@
1798
1761
  "name": "Abfragen von UserTasks",
1799
1762
  "info": "",
1800
1763
  "x": 170,
1801
- "y": 640,
1802
- "wires": []
1803
- },
1804
- {
1805
- "id": "a547ad5dcdd4613f",
1806
- "type": "dynamic-form",
1807
- "z": "fd3c725340de4f74",
1808
- "g": "b60e94a5f1ee2790",
1809
- "name": "",
1810
- "group": "5403f00c961584ab",
1811
- "order": 0,
1812
- "options": [
1813
- {
1814
- "label": "jljlkj"
1815
- },
1816
- {
1817
- "label": "another"
1818
- },
1819
- {
1820
- "label": "dsfjklsdj"
1821
- }
1822
- ],
1823
- "waiting_title": "Warten auf den Usertask...",
1824
- "waiting_info": "Der Usertask wird automatisch angezeigt, wenn ein entsprechender Task vorhanden ist.",
1825
- "width": 0,
1826
- "height": 0,
1827
- "outputs": 3,
1828
- "x": 640,
1829
- "y": 640,
1830
- "wires": [
1831
- [
1832
- "e98eecc53e433cfe"
1833
- ],
1834
- [
1835
- "ed3c805cc0dc276c"
1836
- ],
1837
- [
1838
- "ed3c805cc0dc276c"
1839
- ]
1840
- ]
1841
- },
1842
- {
1843
- "id": "e98eecc53e433cfe",
1844
- "type": "debug",
1845
- "z": "fd3c725340de4f74",
1846
- "g": "b60e94a5f1ee2790",
1847
- "name": "debug 25",
1848
- "active": true,
1849
- "tosidebar": true,
1850
- "console": false,
1851
- "tostatus": false,
1852
- "complete": "false",
1853
- "statusVal": "",
1854
- "statusType": "auto",
1855
- "x": 860,
1856
1764
  "y": 600,
1857
1765
  "wires": []
1858
1766
  },
1859
- {
1860
- "id": "ed3c805cc0dc276c",
1861
- "type": "debug",
1862
- "z": "fd3c725340de4f74",
1863
- "g": "b60e94a5f1ee2790",
1864
- "name": "debug 26",
1865
- "active": true,
1866
- "tosidebar": true,
1867
- "console": false,
1868
- "tostatus": false,
1869
- "complete": "false",
1870
- "statusVal": "",
1871
- "statusType": "auto",
1872
- "x": 880,
1873
- "y": 640,
1874
- "wires": []
1875
- },
1876
- {
1877
- "id": "a80d2f28ea46f22f",
1878
- "type": "inject",
1879
- "z": "fd3c725340de4f74",
1880
- "name": "",
1881
- "props": [
1882
- {
1883
- "p": "payload"
1884
- },
1885
- {
1886
- "p": "topic",
1887
- "vt": "str"
1888
- }
1889
- ],
1890
- "repeat": "",
1891
- "crontab": "",
1892
- "once": false,
1893
- "onceDelay": 0.1,
1894
- "topic": "",
1895
- "payload": "",
1896
- "payloadType": "date",
1897
- "x": 140,
1898
- "y": 840,
1899
- "wires": [
1900
- [
1901
- "e283d772578fb6d2"
1902
- ]
1903
- ]
1904
- },
1905
- {
1906
- "id": "09a463e42d3ce5b8",
1907
- "type": "dynamic-table",
1908
- "z": "fd3c725340de4f74",
1909
- "name": "",
1910
- "tableName": "",
1911
- "group": "99fb2417816969fd",
1912
- "order": 0,
1913
- "data": "payload.userTasks",
1914
- "data_type": "msg",
1915
- "options": [
1916
- {
1917
- "label": "action",
1918
- "condition": ""
1919
- },
1920
- {
1921
- "label": "another",
1922
- "condition": ""
1923
- }
1924
- ],
1925
- "columns": [
1926
- {
1927
- "label": "State",
1928
- "value": "state",
1929
- "type": "str"
1930
- }
1931
- ],
1932
- "width": 0,
1933
- "height": 0,
1934
- "outputs": 2,
1935
- "x": 560,
1936
- "y": 840,
1937
- "wires": [
1938
- [
1939
- "8c5309ae86d0cb66"
1940
- ],
1941
- [
1942
- "45208778372636d3"
1943
- ]
1944
- ]
1945
- },
1946
- {
1947
- "id": "e283d772578fb6d2",
1948
- "type": "usertask-input",
1949
- "z": "fd3c725340de4f74",
1950
- "name": "",
1951
- "engine": "d042a4c68f51d6ab",
1952
- "query": "{\"state\":\"suspended\"}",
1953
- "query_type": "json",
1954
- "force_send_array": true,
1955
- "multisend": false,
1956
- "x": 340,
1957
- "y": 840,
1958
- "wires": [
1959
- [
1960
- "09a463e42d3ce5b8"
1961
- ]
1962
- ]
1963
- },
1964
- {
1965
- "id": "8c5309ae86d0cb66",
1966
- "type": "debug",
1967
- "z": "fd3c725340de4f74",
1968
- "name": "debug 27",
1969
- "active": true,
1970
- "tosidebar": true,
1971
- "console": false,
1972
- "tostatus": false,
1973
- "complete": "false",
1974
- "statusVal": "",
1975
- "statusType": "auto",
1976
- "x": 740,
1977
- "y": 780,
1978
- "wires": []
1979
- },
1980
- {
1981
- "id": "45208778372636d3",
1982
- "type": "debug",
1983
- "z": "fd3c725340de4f74",
1984
- "name": "debug 28",
1985
- "active": true,
1986
- "tosidebar": true,
1987
- "console": false,
1988
- "tostatus": false,
1989
- "complete": "false",
1990
- "statusVal": "",
1991
- "statusType": "auto",
1992
- "x": 780,
1993
- "y": 880,
1994
- "wires": []
1995
- },
1996
1767
  {
1997
1768
  "id": "0f5978f327b01bfb",
1998
1769
  "type": "ui-table",
@@ -2347,6 +2118,29 @@
2347
2118
  ]
2348
2119
  ]
2349
2120
  },
2121
+ {
2122
+ "id": "8e2a2f993ee7156a",
2123
+ "type": "dynamic-form",
2124
+ "z": "b195bc3ca2e1a665",
2125
+ "g": "ec36901abb138306",
2126
+ "name": "",
2127
+ "group": "5403f00c961584ab",
2128
+ "order": 0,
2129
+ "waiting_title": "Waiting for Warten auf den Usertask...",
2130
+ "waiting_info": "Der Usertask wird automatisch angezeigt, wenn ein entsprechender Task vorhanden ist.",
2131
+ "submit_title": "Submit your task",
2132
+ "cancel_title": "Cancel your task",
2133
+ "width": 0,
2134
+ "height": 0,
2135
+ "x": 820,
2136
+ "y": 520,
2137
+ "wires": [
2138
+ [
2139
+ "915816cdb895af14",
2140
+ "5399c05e8fea3679"
2141
+ ]
2142
+ ]
2143
+ },
2350
2144
  {
2351
2145
  "id": "eee38d2764bac337",
2352
2146
  "type": "usertask-input",
@@ -2358,7 +2152,9 @@
2358
2152
  "x": 560,
2359
2153
  "y": 580,
2360
2154
  "wires": [
2361
- []
2155
+ [
2156
+ "8e2a2f993ee7156a"
2157
+ ]
2362
2158
  ]
2363
2159
  },
2364
2160
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@5minds/node-red-contrib-processcube",
3
- "version": "0.6.0-develop-a016f3-lxu6osmc",
3
+ "version": "0.6.0",
4
4
  "license": "MIT",
5
5
  "description": "Node-RED nodes for ProcessCube",
6
6
  "authors": [
@@ -5,8 +5,6 @@
5
5
  defaults: {
6
6
  name: {value: ""},
7
7
  engine: {value: "", type: "processcube-engine-config"},
8
- query: {value: "payload"},
9
- query_type: {value: "msg"},
10
8
  force_send_array: {value: false},
11
9
  multisend: {value: false}
12
10
  },
@@ -15,20 +13,6 @@
15
13
  icon: "font-awesome/fa-envelope-open",
16
14
  label: function() {
17
15
  return this.name || "usertask-input";
18
- },
19
- oneditprepare: function() {
20
- $("#node-input-query").typedInput({
21
- default: 'msg',
22
- types: ['msg', 'json']
23
- });
24
-
25
- $("#node-input-query").typedInput('value', this.query);
26
- $("#node-input-query").typedInput('type', this.query_type);
27
- },
28
- oneditsave: function() {
29
- this.query = $("#node-input-query").typedInput('value'),
30
- this.query_type = $("#node-input-query").typedInput('type')
31
-
32
16
  }
33
17
  });
34
18
  </script>
@@ -42,10 +26,6 @@
42
26
  <label for="node-input-engine"><i class="fa fa-tag"></i> Engine-URL</label>
43
27
  <input type="text" id="node-input-engine" placeholder="http://engine:8000">
44
28
  </div>
45
- <div class="form-row">
46
- <label for="node-input-query"><i class="fa fa-tag"></i> Query</label>
47
- <input type="text" id="node-input-query">
48
- </div>
49
29
  <div class="form-row" style="display:flex; margin-bottom: 3px;">
50
30
  <label for="node-input-force_send_array" style="vertical-align:top"><i class="fa fa-list-alt"></i> Force send payload as array</label>
51
31
  <div>
@@ -64,4 +44,4 @@
64
44
 
65
45
  <script type="text/html" data-help-name="usertask-input">
66
46
  <p>A node which subscribes to an User Task of https://processcube.io</p>
67
- </script>
47
+ </script>
package/usertask-input.js CHANGED
@@ -28,7 +28,7 @@ module.exports = function(RED) {
28
28
  if (!client) {
29
29
  nodeContext.set('client', new engine_client.EngineClient(engineUrl));
30
30
  client = nodeContext.get('client');
31
- }
31
+ }
32
32
 
33
33
  var eventEmitter = flowContext.get('emitter');
34
34
 
@@ -42,14 +42,15 @@ module.exports = function(RED) {
42
42
  client = null;
43
43
  });
44
44
 
45
- node.on('input', function(msg) {
46
- const query = RED.util.evaluateNodeProperty(config.query, config.query_type, node, msg)
47
- console.log(query)
45
+ node.on('input', async function(msg) {
46
+ console.log(`UserTaskInput received message: ${JSON.stringify(msg.payload)}`);
47
+
48
+ let query = msg.payload;
48
49
 
49
50
  client.userTasks.query(query).then((matchingFlowNodes) => {
50
51
 
51
52
  console.log(`UserTaskInput query result: ${JSON.stringify(matchingFlowNodes)}`);
52
-
53
+
53
54
  if (!config.force_send_array && matchingFlowNodes && matchingFlowNodes.userTasks && matchingFlowNodes.userTasks.length == 1) {
54
55
  userTask = matchingFlowNodes.userTasks[0];
55
56
 
@@ -71,4 +72,4 @@ module.exports = function(RED) {
71
72
  });
72
73
  }
73
74
  RED.nodes.registerType("usertask-input", UserTaskInput);
74
- }
75
+ }
@@ -4,30 +4,14 @@
4
4
  color: '#00aed7',
5
5
  defaults: {
6
6
  name: {value: ""},
7
- engine: {value: "", type: "processcube-engine-config"},
8
- result: {value: "payload"},
9
- result_type: {value: "msg"}
7
+ engine: {value: "", type: "processcube-engine-config"}
10
8
  },
11
9
  inputs: 1,
12
10
  outputs: 1,
13
11
  icon: "font-awesome/fa-envelope",
14
12
  label: function() {
15
13
  return this.name || "usertask-output";
16
- },
17
- oneditprepare: function() {
18
- $("#node-input-result").typedInput({
19
- default: 'msg',
20
- types: ['msg', 'json']
21
- });
22
-
23
- $("#node-input-result").typedInput('value', this.result);
24
- $("#node-input-result").typedInput('type', this.result_type);
25
- },
26
- oneditsave: function() {
27
- this.result = $("#node-input-result").typedInput('value'),
28
- this.result_type = $("#node-input-result").typedInput('type')
29
-
30
- }
14
+ }
31
15
  });
32
16
  </script>
33
17
 
@@ -40,12 +24,8 @@
40
24
  <label for="node-input-engine"><i class="fa fa-tag"></i> Engine-URL</label>
41
25
  <input type="text" id="node-input-engine" placeholder="http://engine:8000">
42
26
  </div>
43
- <div class="form-row">
44
- <label for="node-input-result"><i class="fa fa-tag"></i> Result</label>
45
- <input type="text" id="node-input-result">
46
- </div>
47
27
  </script>
48
28
 
49
29
  <script type="text/html" data-help-name="usertask-output">
50
30
  <p>A node which send the result to an User Task of https://processcube.io</p>
51
- </script>
31
+ </script>
@@ -21,7 +21,7 @@ module.exports = function(RED) {
21
21
  if (!client) {
22
22
  nodeContext.set('client', new engine_client.EngineClient(engineUrl));
23
23
  client = nodeContext.get('client');
24
- }
24
+ }
25
25
 
26
26
  var eventEmitter = flowContext.get('emitter');
27
27
 
@@ -35,8 +35,7 @@ module.exports = function(RED) {
35
35
  console.log(`Try to finsih UserTask with id ${msg.payload.userTask.flowNodeInstanceId}.`);
36
36
 
37
37
  const flowNodeInstanceId = msg.payload.userTask.flowNodeInstanceId;
38
-
39
- const userTaskResult = RED.util.evaluateNodeProperty(config.result, config.result_type, node, msg);
38
+ const userTaskResult = msg.payload.formData || {};
40
39
 
41
40
  client.userTasks.finishUserTask(flowNodeInstanceId, userTaskResult).then(() => {
42
41
  console.log(`UserTask with id ${flowNodeInstanceId} finished.`);
@@ -48,8 +47,8 @@ module.exports = function(RED) {
48
47
  } else {
49
48
  console.log(`No UserTask found in message: ${JSON.stringify(msg.payload)}`);
50
49
  }
51
- });
50
+ });
52
51
  }
53
52
 
54
53
  RED.nodes.registerType("usertask-output", UserTaskOutput);
55
- }
54
+ }