@5minds/node-red-contrib-processcube 1.8.3-develop-d951d3-m7gpd699 → 1.8.3-feature-ce2509-m848p0ot

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.
@@ -0,0 +1,120 @@
1
+ <script type="text/javascript">
2
+ RED.nodes.registerType('dataobject-instance-query', {
3
+ category: 'ProcessCube',
4
+ color: '#02AFD6',
5
+ defaults: {
6
+ name: { value: '' },
7
+ engine: { value: '', type: 'processcube-engine-config' },
8
+ query: { value: 'payload' },
9
+ query_type: { value: 'msg' },
10
+ },
11
+ inputs: 1,
12
+ outputs: 1,
13
+ icon: 'data-object-query.svg',
14
+ label: function () {
15
+ return this.name || 'dataobject-instance-query';
16
+ },
17
+ oneditprepare: function () {
18
+ $('#node-input-query').typedInput({
19
+ default: 'msg',
20
+ types: ['msg', 'json'],
21
+ });
22
+
23
+ $('#node-input-query').typedInput('value', this.query);
24
+ $('#node-input-query').typedInput('type', this.query_type);
25
+ },
26
+ oneditsave: function () {
27
+ (this.query = $('#node-input-query').typedInput('value')),
28
+ (this.query_type = $('#node-input-query').typedInput('type'));
29
+ },
30
+ });
31
+ </script>
32
+
33
+ <script type="text/html" data-template-name="dataobject-instance-query">
34
+ <div class="form-row">
35
+ <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
36
+ <input type="text" id="node-input-name" placeholder="Name" />
37
+ </div>
38
+ <div class="form-row">
39
+ <label for="node-input-engine"><i class="fa fa-tag"></i> Engine-URL</label>
40
+ <input type="text" id="node-input-engine" placeholder="http://engine:8000" />
41
+ </div>
42
+ <div class="form-row">
43
+ <label for="node-input-query"><i class="fa fa-tag"></i> Query</label>
44
+ <input type="text" id="node-input-query" />
45
+ </div>
46
+ </script>
47
+
48
+ <script type="text/markdown" data-help-name="dataobject-instance-query">
49
+ A node to query dataobject instances on the ProcessCube Engine.
50
+
51
+ ## Inputs
52
+
53
+ : msg (Object | JSON) : The selected field of the *msg*, eg *payload*, will be used as the input for the query or can be directly set as JSON.
54
+ : query (Object) : The query that was used.
55
+
56
+ ## Outputs
57
+
58
+ : dataObjectInstances (Array) : The dataobject instances that matched the query.
59
+ : totalCount (number) : The number of matches.
60
+
61
+ ### Query fields
62
+
63
+ **Summary**:
64
+
65
+ **Description**: Gets all DataObjectInstances that match the given query.
66
+
67
+ #### Parameters:
68
+ - Name: `offset` Required: `false`
69
+ - Type: number
70
+ - Description: The index of the first DataObjectInstance to include in the result set.
71
+ - Name: `limit` Required: `false`
72
+ - Type: number
73
+ - Description: The maximum number of DataObjectInstances to return.
74
+ - Name: `dataObjectId` Required: ``
75
+ - Type: Array&lt;string&gt; | string | SearchQuery
76
+ - string: myDataObjectId_12345678
77
+ - Array&lt;string&gt;: myDataObjectId_12345678,myDataObjectId_87654321
78
+ - object:
79
+ - Description: Filter by the ID of the DataObject.
80
+ - Name: `flowNodeInstanceId` Required: ``
81
+ - Type: Array&lt;string&gt; | string | SearchQuery
82
+ - string: myFlowNodeInstanceId_12345678
83
+ - Array&lt;string&gt;: myFlowNodeInstanceId_12345678,myFlowNodeInstanceId_87654321
84
+ - object:
85
+ - Description: Filter by the ID of the FlowNodeInstance that wrote to the DataObject.
86
+ - Name: `processInstanceId` Required: ``
87
+ - Type: Array&lt;string&gt; | string | SearchQuery
88
+ - string: myProcessInstance_12345678
89
+ - Array&lt;string&gt;: myProcessInstance_12345678,myProcessInstance_87654321
90
+ - object:
91
+ - Description: Filter by the ID of the ProcessInstances.
92
+ - Name: `processDefinitionId` Required: ``
93
+ - Type: Array&lt;string&gt; | string | SearchQuery
94
+ - string: myProcess_12345678
95
+ - Array&lt;string&gt;: myProcess_12345678,myProcess_87654321
96
+ - object:
97
+ - Description: Filter by the ID of the ProcessDefinition that the DataObjectInstances belong to.
98
+ - Name: `processModelId` Required: ``
99
+ - Type: Array&lt;string&gt; | string | SearchQuery
100
+ - string: myProcessModel_12345678
101
+ - Array&lt;string&gt;: myProcessModel_12345678,myProcessModel_87654321
102
+ - object:
103
+ - Description: Filter by the ID of the ProcessModel that the DataObjectInstances belong to.
104
+ - Name: `embeddedProcessModelId` Required: ``
105
+ - Type: Array&lt;string&gt; | string | SearchQuery
106
+ - string: myProcessModel_12345678
107
+ - Array&lt;string&gt;: myProcessModel_12345678,myProcessModel_87654321
108
+ - object:
109
+ - Description: Filter by the ID of the EmbeededProcessModel that the DataObjectInstances belong to.
110
+ - Name: `createdAt` Required: ``
111
+ - Type: Array&lt;string&gt; | string
112
+ - string: 2021-01-01T00:00:00.000Z
113
+ - array: 2021-01-01T00:00:00.000Z,2021-01-02T00:00:00.000Z
114
+ - Description: The created date of the DataObjectInstances to include in the results.
115
+
116
+ ### References
117
+
118
+ - [The ProcessCube&copy; Developer Network](https://processcube.io) - All documentation for the ProcessCube&copy; platform
119
+ - [ProcessCube&copy; LowCode Integration](https://processcube.io/docs/node-red) - LowCode integration in ProcessCube&copy;
120
+ </script>
@@ -0,0 +1,32 @@
1
+ module.exports = function (RED) {
2
+ function DataobjectInstanceQuery(config) {
3
+ RED.nodes.createNode(this, config);
4
+ var node = this;
5
+
6
+ node.on('input', function (msg) {
7
+ let query = RED.util.evaluateNodeProperty(config.query, config.query_type, node, msg);
8
+
9
+ node.engine = RED.nodes.getNode(config.engine);
10
+ const client = node.engine.engineClient;
11
+ const isUser = !!msg._client?.user && !!msg._client.user.accessToken;
12
+ const userIdentity = isUser ? { userId: msg._client.user.id, token: msg._client.user.accessToken } : null;
13
+
14
+ if (!client) {
15
+ node.error('No engine configured.', msg);
16
+ return;
17
+ }
18
+
19
+ client.dataObjectInstances
20
+ .query(query, { identity: userIdentity })
21
+ .then((matchingInstances) => {
22
+ msg.payload = matchingInstances;
23
+
24
+ node.send(msg);
25
+ })
26
+ .catch((error) => {
27
+ node.error(`Dataobject Instance Query failed: ${error.message}`, msg);
28
+ });
29
+ });
30
+ }
31
+ RED.nodes.registerType('dataobject-instance-query', DataobjectInstanceQuery);
32
+ };
@@ -0,0 +1,109 @@
1
+ [
2
+ {
3
+ "id": "8b280114f8ac9c23",
4
+ "type": "tab",
5
+ "label": "Dataobject Instances Query Sample",
6
+ "disabled": false,
7
+ "info": "",
8
+ "env": []
9
+ },
10
+ {
11
+ "id": "be0d703c70d1687b",
12
+ "type": "group",
13
+ "z": "8b280114f8ac9c23",
14
+ "style": {
15
+ "stroke": "#999999",
16
+ "stroke-opacity": "1",
17
+ "fill": "none",
18
+ "fill-opacity": "1",
19
+ "label": true,
20
+ "label-position": "nw",
21
+ "color": "#a4a4a4"
22
+ },
23
+ "nodes": [
24
+ "8687cdf9bf6c4d7d",
25
+ "74773491693b7f22",
26
+ "29e796ef38867f2a"
27
+ ],
28
+ "x": 74,
29
+ "y": 79,
30
+ "w": 632,
31
+ "h": 82
32
+ },
33
+ {
34
+ "id": "8687cdf9bf6c4d7d",
35
+ "type": "dataobject-instance-query",
36
+ "z": "8b280114f8ac9c23",
37
+ "g": "be0d703c70d1687b",
38
+ "name": "Query 5 DataobjectInstances",
39
+ "engine": "7de3086e71c028f9",
40
+ "query": "{ \"limit\": 5}",
41
+ "query_type": "json",
42
+ "x": 400,
43
+ "y": 120,
44
+ "wires": [
45
+ [
46
+ "74773491693b7f22"
47
+ ]
48
+ ]
49
+ },
50
+ {
51
+ "id": "74773491693b7f22",
52
+ "type": "debug",
53
+ "z": "8b280114f8ac9c23",
54
+ "g": "be0d703c70d1687b",
55
+ "name": "Log",
56
+ "active": true,
57
+ "tosidebar": true,
58
+ "console": false,
59
+ "tostatus": false,
60
+ "complete": "payload",
61
+ "targetType": "msg",
62
+ "statusVal": "",
63
+ "statusType": "auto",
64
+ "x": 610,
65
+ "y": 120,
66
+ "wires": []
67
+ },
68
+ {
69
+ "id": "29e796ef38867f2a",
70
+ "type": "inject",
71
+ "z": "8b280114f8ac9c23",
72
+ "g": "be0d703c70d1687b",
73
+ "name": "Trigger",
74
+ "props": [
75
+ {
76
+ "p": "payload"
77
+ },
78
+ {
79
+ "p": "topic",
80
+ "vt": "str"
81
+ }
82
+ ],
83
+ "repeat": "",
84
+ "crontab": "",
85
+ "once": false,
86
+ "onceDelay": 0.1,
87
+ "topic": "",
88
+ "payload": "",
89
+ "payloadType": "date",
90
+ "x": 170,
91
+ "y": 120,
92
+ "wires": [
93
+ [
94
+ "8687cdf9bf6c4d7d"
95
+ ]
96
+ ]
97
+ },
98
+ {
99
+ "id": "7de3086e71c028f9",
100
+ "type": "processcube-engine-config",
101
+ "name": "",
102
+ "url": "http://engine:8000",
103
+ "urlType": "str",
104
+ "clientId": "",
105
+ "clientIdType": "str",
106
+ "clientSecret": "",
107
+ "clientSecretType": "str"
108
+ }
109
+ ]
@@ -0,0 +1,5 @@
1
+ <svg width="40" height="60" viewBox="0 0 40 60" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M3.88776 46.3334C4.33879 46.7844 5.07006 46.7844 5.52109 46.3334L11.4215 40.4329C11.7818 40.0726 12.3521 40.0481 12.7896 40.3093C13.1835 40.5444 13.6093 40.7441 14.0669 40.9084C14.8253 41.1806 15.6322 41.3167 16.4878 41.3167C18.6072 41.3167 20.401 40.5827 21.869 39.1146C23.3371 37.6466 24.0711 35.8528 24.0711 33.7334C24.0711 31.6139 23.3371 29.8202 21.869 28.3521C20.401 26.8841 18.6072 26.15 16.4878 26.15C14.3683 26.15 12.5746 26.8841 11.1065 28.3521C9.63845 29.8202 8.90442 31.6139 8.90442 33.7334C8.90442 34.5889 9.04054 35.3959 9.31276 36.1542C9.47704 36.6118 9.67673 37.0376 9.91183 37.4315C10.173 37.8691 10.1485 38.4393 9.7882 38.7996L3.88776 44.7C3.43673 45.1511 3.43672 45.8823 3.88776 46.3334V46.3334ZM16.4878 38.9834C15.0294 38.9834 13.7898 38.4729 12.769 37.4521C11.7482 36.4313 11.2378 35.1917 11.2378 33.7334C11.2378 32.275 11.7482 31.0354 12.769 30.0146C13.7898 28.9938 15.0294 28.4834 16.4878 28.4834C17.9461 28.4834 19.1857 28.9938 20.2065 30.0146C21.2273 31.0354 21.7378 32.275 21.7378 33.7334C21.7378 35.1917 21.2273 36.4313 20.2065 37.4521C19.1857 38.4729 17.9461 38.9834 16.4878 38.9834Z" fill="white"/>
3
+ <path d="M12 46H34V22L28 15H12V22" stroke="white" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/>
4
+ <path d="M25 15V24H34" stroke="white" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/>
5
+ </svg>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@5minds/node-red-contrib-processcube",
3
- "version": "1.8.3-develop-d951d3-m7gpd699",
3
+ "version": "1.8.3-feature-ce2509-m848p0ot",
4
4
  "license": "MIT",
5
5
  "description": "Node-RED nodes for ProcessCube",
6
6
  "scripts": {
@@ -36,6 +36,7 @@
36
36
  "version": ">=3.1.9",
37
37
  "nodes": {
38
38
  "checkAuthorization": "check-authorization.js",
39
+ "DataobjectInstanceQuery": "dataobject-instance-query.js",
39
40
  "EndEventFinishedListener": "endevent-finished-listener.js",
40
41
  "externaltaskInput": "externaltask-input.js",
41
42
  "externaltaskOutput": "externaltask-output.js",