@5minds/node-red-contrib-processcube 1.8.2 → 1.8.3-feature-829069-m7nhmav6

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.
@@ -698,6 +698,17 @@
698
698
  "name": "Engine Auth 8000",
699
699
  "url": "http://engine:8000"
700
700
  },
701
+ {
702
+ "id": "f7961bee80d8bcb5",
703
+ "type": "processcube-engine-config",
704
+ "name": "",
705
+ "url": "http://engine:8001",
706
+ "urlType": "str",
707
+ "clientId": "",
708
+ "clientIdType": "str",
709
+ "clientSecret": "",
710
+ "clientSecretType": "str"
711
+ },
701
712
  {
702
713
  "id": "b7ddfedf82d8120f",
703
714
  "type": "externaltask-error",
@@ -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: 'processinstance_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
+ ]
@@ -214,7 +214,7 @@ module.exports = function (RED) {
214
214
 
215
215
  try {
216
216
  externalTaskWorker.start();
217
- node.showStatus();
217
+ node.setUnsubscribedStatus();
218
218
  } catch (error) {
219
219
  node.error(`Worker start 'externalTaskWorker.start' failed: ${error.message}`, {});
220
220
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@5minds/node-red-contrib-processcube",
3
- "version": "1.8.2",
3
+ "version": "1.8.3-feature-829069-m7nhmav6",
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",