@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.
- package/externaltask-input.js +3 -3
- package/package.json +1 -1
- package/processinstance-query.html +116 -109
- package/processinstance-query.js +22 -1
package/externaltask-input.js
CHANGED
@@ -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
@@ -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
|
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
|
-
|
69
|
-
|
70
|
-
|
71
|
-
-
|
72
|
-
|
73
|
-
|
74
|
-
-
|
75
|
-
|
76
|
-
- string
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
-
|
81
|
-
|
82
|
-
- string
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
-
|
87
|
-
|
88
|
-
- string
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
-
|
93
|
-
|
94
|
-
- string
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
-
|
99
|
-
|
100
|
-
- string
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
-
|
105
|
-
|
106
|
-
- string
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
-
|
111
|
-
|
112
|
-
- string
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
-
|
117
|
-
|
118
|
-
- string
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
-
|
123
|
-
|
124
|
-
- string
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
-
|
129
|
-
|
130
|
-
- string
|
131
|
-
-
|
132
|
-
|
133
|
-
|
134
|
-
-
|
135
|
-
|
136
|
-
|
137
|
-
-
|
138
|
-
|
139
|
-
-
|
140
|
-
|
141
|
-
|
142
|
-
-
|
143
|
-
|
144
|
-
|
145
|
-
-
|
146
|
-
|
147
|
-
|
148
|
-
-
|
149
|
-
|
150
|
-
-
|
151
|
-
|
152
|
-
|
153
|
-
-
|
154
|
-
|
155
|
-
|
156
|
-
-
|
157
|
-
|
158
|
-
|
159
|
-
-
|
160
|
-
|
161
|
-
-
|
162
|
-
|
163
|
-
|
164
|
-
-
|
165
|
-
|
166
|
-
|
167
|
-
-
|
168
|
-
- Type: Array<string> | 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<string> | string | SearchQuery
|
83
|
+
- string: myCorrelationId
|
84
|
+
- Array<string>: myCorrelationId1,myCorrelationId2
|
85
|
+
- object:
|
86
|
+
- Description: Filter by the CorrelationId of the ProcessInstances.
|
87
|
+
- Name: `processInstanceId` Required: ``
|
88
|
+
- Type: Array<string> | string | SearchQuery
|
89
|
+
- string: myProcessInstance_12345678
|
90
|
+
- Array<string>: myProcessInstance_12345678,myProcessInstance_87654321
|
91
|
+
- object:
|
92
|
+
- Description: Filter by the ID of the ProcessInstances.
|
93
|
+
- Name: `processDefinitionId` Required: ``
|
94
|
+
- Type: Array<string> | string | SearchQuery
|
95
|
+
- string: myProcess_12345678
|
96
|
+
- Array<string>: 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<string> | string | SearchQuery
|
101
|
+
- string: myProcessModel_12345678
|
102
|
+
- Array<string>: 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<string> | string | SearchQuery
|
107
|
+
- string: My Process Model
|
108
|
+
- Array<string>: 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<string> | string | SearchQuery
|
113
|
+
- string: 12345678
|
114
|
+
- Array<string>: 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<string> | string | SearchQuery
|
119
|
+
- string: 12345678
|
120
|
+
- Array<string>: 12345678,87654321
|
121
|
+
- object:
|
122
|
+
- Description: Filter by the ID of the User that owns the ProcessInstances.
|
123
|
+
- Name: `state` Required: ``
|
124
|
+
- Type: Array<string> | string | SearchQuery
|
125
|
+
- string: running
|
126
|
+
- Array<string>: running,finished
|
127
|
+
- object:
|
128
|
+
- Description: Filter by the state of the ProcessInstances.
|
129
|
+
- Name: `parentProcessInstanceId` Required: ``
|
130
|
+
- Type: Array<string> | string | SearchQuery
|
131
|
+
- string: myParentProcessInstance_12345678
|
132
|
+
- Array<string>: myParentProcessInstance_12345678,myParentProcessInstance_87654321
|
133
|
+
- object:
|
134
|
+
- Description: Filter by the ID of the parent ProcessInstance.
|
135
|
+
- Name: `terminatedByUserId` Required: ``
|
136
|
+
- Type: Array<string> | string | SearchQuery
|
137
|
+
- string: 12345678
|
138
|
+
- Array<string>: 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<string> | 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<string> | 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<string> | 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<string> | 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
|
-
-
|
177
|
-
-
|
183
|
+
- [The ProcessCube© Developer Network](https://processcube.io) - All documentation for the ProcessCube© platform
|
184
|
+
- [ProcessCube© LowCode Integration](https://processcube.io/docs/node-red) - LowCode integration in ProcessCube©
|
178
185
|
</script>
|
package/processinstance-query.js
CHANGED
@@ -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,
|
41
|
+
.query(query, query_options)
|
21
42
|
.then((matchingInstances) => {
|
22
43
|
msg.payload = matchingInstances;
|
23
44
|
|