@5minds/node-red-contrib-processcube 1.9.9 → 1.10.0

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.
@@ -28,15 +28,15 @@ module.exports = function (RED) {
28
28
  }
29
29
 
30
30
  if (!options['lockDuration'] && process.env.NODE_RED_ETW_LOCK_DURATION) {
31
- options['lockDuration'] = process.env.NODE_RED_ETW_LOCK_DURATION;
31
+ options['lockDuration'] = parseInt(process.env.NODE_RED_ETW_LOCK_DURATION) || undefined;
32
32
  }
33
33
 
34
34
  if (!options['longpollingTimeout']) {
35
- options['longpollingTimeout'] = process.env.NODE_RED_ETW_LONGPOLLING_TIMEOUT;
35
+ options['longpollingTimeout'] = parseInt(process.env.NODE_RED_ETW_LONGPOLLING_TIMEOUT) || undefined;
36
36
  }
37
37
 
38
38
  if (!options['idleTimeout']) {
39
- options['idleTimeout'] = process.env.NODE_RED_ETW_IDLE_TIMEOUT;
39
+ options['idleTimeout'] = parseInt(process.env.NODE_RED_ETW_IDLE_TIMEOUT) || undefined;
40
40
  }
41
41
 
42
42
  node._subscribed = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@5minds/node-red-contrib-processcube",
3
- "version": "1.9.9",
3
+ "version": "1.10.0",
4
4
  "license": "MIT",
5
5
  "description": "Node-RED nodes for ProcessCube",
6
6
  "scripts": {
@@ -7,6 +7,8 @@
7
7
  engine: { value: '', type: 'processcube-engine-config' },
8
8
  query: { value: 'payload' },
9
9
  query_type: { value: 'msg' },
10
+ limit: { value: '' },
11
+ offset: { value: '' },
10
12
  },
11
13
  inputs: 1,
12
14
  outputs: 1,
@@ -43,6 +45,14 @@
43
45
  <label for="node-input-query"><i class="fa fa-tag"></i> Query</label>
44
46
  <input type="text" id="node-input-query" />
45
47
  </div>
48
+ <div class="form-row">
49
+ <label for="node-input-limit"><i class="fa fa-tag"></i> Limit</label>
50
+ <input type="text" id="node-input-limit" />
51
+ </div>
52
+ <div class="form-row">
53
+ <label for="node-input-offset"><i class="fa fa-tag"></i> Offset</label>
54
+ <input type="text" id="node-input-offset" />
55
+ </div>
46
56
  </script>
47
57
 
48
58
  <script type="text/markdown" data-help-name="processinstance-query">
@@ -50,8 +60,10 @@ A node to query process instances on the ProcessCube Engine.
50
60
 
51
61
  ## Inputs
52
62
 
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.
63
+ : 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
64
  : query (Object) : The query that was used.
65
+ : limit (number) : The maximum number of ProcessInstances to return, can be overridden by the _msg.limit_.
66
+ : offset (number) : The index of the first ProcessInstance to include in the result set, can be overridden by the _msg.offset_.
55
67
 
56
68
  ## Outputs
57
69
 
@@ -60,119 +72,114 @@ A node to query process instances on the ProcessCube Engine.
60
72
 
61
73
  ### Query fields
62
74
 
63
- **Summary**:
75
+ **Summary**:
64
76
 
65
77
  **Description**: Gets all ProcessInstances that match the given query.
66
78
 
67
79
  #### Parameters:
68
- - Name: `offset` Required: `false`
69
- - Type: number
70
- - Description: The index of the first ProcessInstance to include in the result set.
71
- - Name: `limit` Required: `false`
72
- - Type: number
73
- - Description: The maximum number of ProcessInstances to return.
74
- - Name: `correlationId` Required: `false`
75
- - Type: Array&lt;string&gt; | string | SearchQuery
76
- - string: myCorrelationId
77
- - Array&lt;string&gt;: myCorrelationId1,myCorrelationId2
78
- - object:
79
- - Description: Filter by the CorrelationId of the ProcessInstances.
80
- - Name: `processInstanceId` Required: ``
81
- - Type: Array&lt;string&gt; | string | SearchQuery
82
- - string: myProcessInstance_12345678
83
- - Array&lt;string&gt;: myProcessInstance_12345678,myProcessInstance_87654321
84
- - object:
85
- - Description: Filter by the ID of the ProcessInstances.
86
- - Name: `processDefinitionId` Required: ``
87
- - Type: Array&lt;string&gt; | string | SearchQuery
88
- - string: myProcess_12345678
89
- - Array&lt;string&gt;: myProcess_12345678,myProcess_87654321
90
- - object:
91
- - Description: Filter by the ID of the ProcessDefinition that the ProcessInstances belong to.
92
- - Name: `processModelId` Required: ``
93
- - Type: Array&lt;string&gt; | string | SearchQuery
94
- - string: myProcessModel_12345678
95
- - Array&lt;string&gt;: myProcessModel_12345678,myProcessModel_87654321
96
- - object:
97
- - Description: Filter by the ID of the ProcessModel that the ProcessInstances belong to.
98
- - Name: `processModelName` Required: ``
99
- - Type: Array&lt;string&gt; | string | SearchQuery
100
- - string: My Process Model
101
- - Array&lt;string&gt;: My Process Model,My Other Process Model
102
- - object:
103
- - Description: Filter by the name of the ProcessModel that the ProcessInstances belong to.
104
- - Name: `processModelHash` Required: ``
105
- - Type: Array&lt;string&gt; | string | SearchQuery
106
- - string: 12345678
107
- - Array&lt;string&gt;: 12345678,87654321
108
- - object:
109
- - Description: Filter by the hash of the ProcessModel that the ProcessInstances belong to.
110
- - Name: `ownerId` Required: ``
111
- - Type: Array&lt;string&gt; | string | SearchQuery
112
- - string: 12345678
113
- - Array&lt;string&gt;: 12345678,87654321
114
- - object:
115
- - Description: Filter by the ID of the User that owns the ProcessInstances.
116
- - Name: `state` Required: ``
117
- - Type: Array&lt;string&gt; | string | SearchQuery
118
- - string: running
119
- - Array&lt;string&gt;: running,finished
120
- - object:
121
- - Description: Filter by the state of the ProcessInstances.
122
- - Name: `parentProcessInstanceId` Required: ``
123
- - Type: Array&lt;string&gt; | string | SearchQuery
124
- - string: myParentProcessInstance_12345678
125
- - Array&lt;string&gt;: myParentProcessInstance_12345678,myParentProcessInstance_87654321
126
- - object:
127
- - Description: Filter by the ID of the parent ProcessInstance.
128
- - Name: `terminatedByUserId` Required: ``
129
- - Type: Array&lt;string&gt; | string | SearchQuery
130
- - string: 12345678
131
- - Array&lt;string&gt;: 12345678,87654321
132
- - object:
133
- - Description: Filter by the ID of the User that terminated the ProcessInstances.
134
- - Name: `createdBefore` Required: ``
135
- - Type: string
136
- - Description: The maximum created date of the ProcessInstances to include in the results.
137
- - Name: `createdAt` Required: ``
138
- - Type: Array&lt;string&gt; | string
139
- - string: 2021-01-01T00:00:00.000Z
140
- - array: 2021-01-01T00:00:00.000Z,2021-01-02T00:00:00.000Z
141
- - Description: The minimum created date of the ProcessInstances to include in the results.
142
- - Name: `createdAfter` Required: ``
143
- - Type: string
144
- - Description: The minimum created date of the ProcessInstances to include in the results.
145
- - Name: `updatedBefore` Required: ``
146
- - Type: string
147
- - Description: The maximum updated date of the ProcessInstances to include in the results.
148
- - Name: `updatedAt` Required: ``
149
- - Type: Array&lt;string&gt; | string
150
- - string: 2021-01-01T00:00:00.000Z
151
- - array: 2021-01-01T00:00:00.000Z,2021-01-02T00:00:00.000Z
152
- - Description: The exact updated date of the ProcessInstances to include in the results.
153
- - Name: `updatedAfter` Required: ``
154
- - Type: string
155
- - Description: The minimum updated date of the ProcessInstances to include in the results.
156
- - Name: `finishedBefore` Required: ``
157
- - Type: string
158
- - Description: The maximum finished date of the ProcessInstances to include in the results.
159
- - Name: `finishedAt` Required: ``
160
- - Type: Array&lt;string&gt; | string
161
- - string: 2021-01-01T00:00:00.000Z
162
- - array: 2021-01-01T00:00:00.000Z,2021-01-02T00:00:00.000Z
163
- - Description: The exact finished date of the ProcessInstances to include in the results.
164
- - Name: `finishedAfter` Required: ``
165
- - Type: string
166
- - Description: The minimum finished date of the ProcessInstances to include in the results.
167
- - Name: `triggeredByFlowNodeInstance` Required: ``
168
- - Type: Array&lt;string&gt; | string | SearchQuery
169
- - string: myFlowNodeInstance_12345678
170
- - array: myFlowNodeInstance_12345678,myFlowNodeInstance_87654321
171
- - object:
172
- - Description: Filter by the ID of the FlowNodeInstance that triggered the ProcessInstance.
80
+
81
+ - Name: `correlationId` Required: `false`
82
+ - Type: Array&lt;string&gt; | string | SearchQuery
83
+ - string: myCorrelationId
84
+ - Array&lt;string&gt;: myCorrelationId1,myCorrelationId2
85
+ - object:
86
+ - Description: Filter by the CorrelationId of the ProcessInstances.
87
+ - Name: `processInstanceId` Required: ``
88
+ - Type: Array&lt;string&gt; | string | SearchQuery
89
+ - string: myProcessInstance_12345678
90
+ - Array&lt;string&gt;: myProcessInstance_12345678,myProcessInstance_87654321
91
+ - object:
92
+ - Description: Filter by the ID of the ProcessInstances.
93
+ - Name: `processDefinitionId` Required: ``
94
+ - Type: Array&lt;string&gt; | string | SearchQuery
95
+ - string: myProcess_12345678
96
+ - Array&lt;string&gt;: myProcess_12345678,myProcess_87654321
97
+ - object:
98
+ - Description: Filter by the ID of the ProcessDefinition that the ProcessInstances belong to.
99
+ - Name: `processModelId` Required: ``
100
+ - Type: Array&lt;string&gt; | string | SearchQuery
101
+ - string: myProcessModel_12345678
102
+ - Array&lt;string&gt;: myProcessModel_12345678,myProcessModel_87654321
103
+ - object:
104
+ - Description: Filter by the ID of the ProcessModel that the ProcessInstances belong to.
105
+ - Name: `processModelName` Required: ``
106
+ - Type: Array&lt;string&gt; | string | SearchQuery
107
+ - string: My Process Model
108
+ - Array&lt;string&gt;: My Process Model,My Other Process Model
109
+ - object:
110
+ - Description: Filter by the name of the ProcessModel that the ProcessInstances belong to.
111
+ - Name: `processModelHash` Required: ``
112
+ - Type: Array&lt;string&gt; | string | SearchQuery
113
+ - string: 12345678
114
+ - Array&lt;string&gt;: 12345678,87654321
115
+ - object:
116
+ - Description: Filter by the hash of the ProcessModel that the ProcessInstances belong to.
117
+ - Name: `ownerId` Required: ``
118
+ - Type: Array&lt;string&gt; | string | SearchQuery
119
+ - string: 12345678
120
+ - Array&lt;string&gt;: 12345678,87654321
121
+ - object:
122
+ - Description: Filter by the ID of the User that owns the ProcessInstances.
123
+ - Name: `state` Required: ``
124
+ - Type: Array&lt;string&gt; | string | SearchQuery
125
+ - string: running
126
+ - Array&lt;string&gt;: running,finished
127
+ - object:
128
+ - Description: Filter by the state of the ProcessInstances.
129
+ - Name: `parentProcessInstanceId` Required: ``
130
+ - Type: Array&lt;string&gt; | string | SearchQuery
131
+ - string: myParentProcessInstance_12345678
132
+ - Array&lt;string&gt;: myParentProcessInstance_12345678,myParentProcessInstance_87654321
133
+ - object:
134
+ - Description: Filter by the ID of the parent ProcessInstance.
135
+ - Name: `terminatedByUserId` Required: ``
136
+ - Type: Array&lt;string&gt; | string | SearchQuery
137
+ - string: 12345678
138
+ - Array&lt;string&gt;: 12345678,87654321
139
+ - object:
140
+ - Description: Filter by the ID of the User that terminated the ProcessInstances.
141
+ - Name: `createdBefore` Required: ``
142
+ - Type: string
143
+ - Description: The maximum created date of the ProcessInstances to include in the results.
144
+ - Name: `createdAt` Required: ``
145
+ - Type: Array&lt;string&gt; | string
146
+ - string: 2021-01-01T00:00:00.000Z
147
+ - array: 2021-01-01T00:00:00.000Z,2021-01-02T00:00:00.000Z
148
+ - Description: The minimum created date of the ProcessInstances to include in the results.
149
+ - Name: `createdAfter` Required: ``
150
+ - Type: string
151
+ - Description: The minimum created date of the ProcessInstances to include in the results.
152
+ - Name: `updatedBefore` Required: ``
153
+ - Type: string
154
+ - Description: The maximum updated date of the ProcessInstances to include in the results.
155
+ - Name: `updatedAt` Required: ``
156
+ - Type: Array&lt;string&gt; | string
157
+ - string: 2021-01-01T00:00:00.000Z
158
+ - array: 2021-01-01T00:00:00.000Z,2021-01-02T00:00:00.000Z
159
+ - Description: The exact updated date of the ProcessInstances to include in the results.
160
+ - Name: `updatedAfter` Required: ``
161
+ - Type: string
162
+ - Description: The minimum updated date of the ProcessInstances to include in the results.
163
+ - Name: `finishedBefore` Required: ``
164
+ - Type: string
165
+ - Description: The maximum finished date of the ProcessInstances to include in the results.
166
+ - Name: `finishedAt` Required: ``
167
+ - Type: Array&lt;string&gt; | string
168
+ - string: 2021-01-01T00:00:00.000Z
169
+ - array: 2021-01-01T00:00:00.000Z,2021-01-02T00:00:00.000Z
170
+ - Description: The exact finished date of the ProcessInstances to include in the results.
171
+ - Name: `finishedAfter` Required: ``
172
+ - Type: string
173
+ - Description: The minimum finished date of the ProcessInstances to include in the results.
174
+ - Name: `triggeredByFlowNodeInstance` Required: ``
175
+ - Type: Array&lt;string&gt; | string | SearchQuery
176
+ - string: myFlowNodeInstance_12345678
177
+ - array: myFlowNodeInstance_12345678,myFlowNodeInstance_87654321
178
+ - object:
179
+ - Description: Filter by the ID of the FlowNodeInstance that triggered the ProcessInstance.
173
180
 
174
181
  ### References
175
182
 
176
- - [The ProcessCube&copy; Developer Network](https://processcube.io) - All documentation for the ProcessCube&copy; platform
177
- - [ProcessCube&copy; LowCode Integration](https://processcube.io/docs/node-red) - LowCode integration in ProcessCube&copy;
183
+ - [The ProcessCube&copy; Developer Network](https://processcube.io) - All documentation for the ProcessCube&copy; platform
184
+ - [ProcessCube&copy; LowCode Integration](https://processcube.io/docs/node-red) - LowCode integration in ProcessCube&copy;
178
185
  </script>
@@ -5,6 +5,7 @@ module.exports = function (RED) {
5
5
 
6
6
  node.on('input', function (msg) {
7
7
  let query = RED.util.evaluateNodeProperty(config.query, config.query_type, node, msg);
8
+
8
9
 
9
10
  node.engine = RED.nodes.getNode(config.engine);
10
11
  const client = node.engine.engineClient;
@@ -16,8 +17,28 @@ module.exports = function (RED) {
16
17
  return;
17
18
  }
18
19
 
20
+ let query_options = {identity: userIdentity};
21
+
22
+ let limit = config.limit;
23
+ if (msg.limit !== undefined) {
24
+ limit = msg.limit;
25
+ }
26
+
27
+ if (limit) {
28
+ query_options.limit = limit;
29
+ }
30
+
31
+ let offset = config.offset;
32
+ if (msg.offset !== undefined) {
33
+ offset = msg.offset;
34
+ }
35
+
36
+ if (offset) {
37
+ query_options.offset = offset;
38
+ }
39
+
19
40
  client.processInstances
20
- .query(query, { identity: userIdentity })
41
+ .query(query, query_options)
21
42
  .then((matchingInstances) => {
22
43
  msg.payload = matchingInstances;
23
44