|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Jabe\Engine\Impl; |
|
4
|
|
|
|
|
5
|
|
|
use Jabe\Engine\Exception\NotValidException; |
|
6
|
|
|
use Jabe\Engine\History\{ |
|
7
|
|
|
ExternalTaskStateImpl, |
|
8
|
|
|
ExternalTaskStateInterface, |
|
9
|
|
|
HistoricExternalTaskLogQueryInterface |
|
10
|
|
|
}; |
|
11
|
|
|
use Jabe\Engine\Impl\Interceptor\{ |
|
12
|
|
|
CommandContext, |
|
13
|
|
|
CommandExecutorInterface |
|
14
|
|
|
}; |
|
15
|
|
|
use Jabe\Engine\Impl\Util\{ |
|
16
|
|
|
CollectionUtil, |
|
17
|
|
|
EnsureUtil |
|
|
|
|
|
|
18
|
|
|
}; |
|
19
|
|
|
|
|
20
|
|
|
class HistoricExternalTaskLogQueryImpl extends AbstractQuery implements HistoricExternalTaskLogQueryInterface |
|
21
|
|
|
{ |
|
22
|
|
|
protected $id; |
|
23
|
|
|
protected $externalTaskId; |
|
24
|
|
|
protected $topicName; |
|
25
|
|
|
protected $workerId; |
|
26
|
|
|
protected $errorMessage; |
|
27
|
|
|
protected $activityIds = []; |
|
28
|
|
|
protected $activityInstanceIds = []; |
|
29
|
|
|
protected $executionIds = []; |
|
30
|
|
|
protected $processInstanceId; |
|
31
|
|
|
protected $processDefinitionId; |
|
32
|
|
|
protected $processDefinitionKey; |
|
33
|
|
|
protected $priorityHigherThanOrEqual; |
|
34
|
|
|
protected $priorityLowerThanOrEqual; |
|
35
|
|
|
protected $tenantIds = []; |
|
36
|
|
|
protected $isTenantIdSet; |
|
37
|
|
|
protected $state; |
|
38
|
|
|
|
|
39
|
|
|
public function __construct(CommandExecutorInterface $commandExecutor = null) |
|
40
|
|
|
{ |
|
41
|
|
|
parent::__construct($commandExecutor); |
|
42
|
|
|
} |
|
43
|
|
|
|
|
44
|
|
|
// query parameter //////////////////////////////////////////// |
|
45
|
|
|
|
|
46
|
|
|
public function logId(string $historicExternalTaskLogId): HistoricExternalTaskLogQueryInterface |
|
47
|
|
|
{ |
|
48
|
|
|
EnsureUtil::ensureNotNull(NotValidException::class, "historicExternalTaskLogId", $historicExternalTaskLogId); |
|
49
|
|
|
$this->id = $historicExternalTaskLogId; |
|
50
|
|
|
return $this; |
|
51
|
|
|
} |
|
52
|
|
|
|
|
53
|
|
|
public function externalTaskId(string $externalTaskId): HistoricExternalTaskLogQueryInterface |
|
54
|
|
|
{ |
|
55
|
|
|
EnsureUtil::ensureNotNull(NotValidException::class, "externalTaskId", $externalTaskId); |
|
56
|
|
|
$this->externalTaskId = $externalTaskId; |
|
57
|
|
|
return $this; |
|
58
|
|
|
} |
|
59
|
|
|
|
|
60
|
|
|
public function topicName(string $topicName): HistoricExternalTaskLogQueryInterface |
|
61
|
|
|
{ |
|
62
|
|
|
EnsureUtil::ensureNotNull(NotValidException::class, "topicName", $topicName); |
|
63
|
|
|
$this->topicName = $topicName; |
|
64
|
|
|
return $this; |
|
65
|
|
|
} |
|
66
|
|
|
|
|
67
|
|
|
public function workerId(string $workerId): HistoricExternalTaskLogQueryInterface |
|
68
|
|
|
{ |
|
69
|
|
|
EnsureUtil::ensureNotNull(NotValidException::class, "workerId", $workerId); |
|
70
|
|
|
$this->workerId = $workerId; |
|
71
|
|
|
return $this; |
|
72
|
|
|
} |
|
73
|
|
|
|
|
74
|
|
|
public function errorMessage(string $errorMessage): HistoricExternalTaskLogQueryInterface |
|
75
|
|
|
{ |
|
76
|
|
|
EnsureUtil::ensureNotNull(NotValidException::class, "errorMessage", $errorMessage); |
|
77
|
|
|
$this->errorMessage = $errorMessage; |
|
78
|
|
|
return $this; |
|
79
|
|
|
} |
|
80
|
|
|
|
|
81
|
|
|
public function activityIdIn(array $activityIds): HistoricExternalTaskLogQueryInterface |
|
82
|
|
|
{ |
|
83
|
|
|
EnsureUtil::ensureNotNull(NotValidException::class, "activityIds", $activityIds); |
|
84
|
|
|
$activityIdList = CollectionUtil::asArrayList($activityIds); |
|
85
|
|
|
EnsureUtil::ensureNotContainsNull("activityIds", "activityIds", $activityIdList); |
|
86
|
|
|
EnsureUtil::ensureNotContainsEmptyString("activityIds", "activityIds", $activityIdList); |
|
87
|
|
|
$this->activityIds = $activityIds; |
|
88
|
|
|
return $this; |
|
89
|
|
|
} |
|
90
|
|
|
|
|
91
|
|
|
public function activityInstanceIdIn(array $activityInstanceIds): HistoricExternalTaskLogQueryInterface |
|
92
|
|
|
{ |
|
93
|
|
|
EnsureUtil::ensureNotNull(NotValidException::class, "activityIds", $activityInstanceIds); |
|
94
|
|
|
$activityInstanceIdList = CollectionUtil::asArrayList($activityInstanceIds); |
|
95
|
|
|
EnsureUtil::ensureNotContainsNull("activityInstanceIds", $activityInstanceIdList); |
|
96
|
|
|
EnsureUtil::ensureNotContainsEmptyString("activityInstanceIds", $activityInstanceIdList); |
|
97
|
|
|
$this->activityInstanceIds = $activityInstanceIds; |
|
98
|
|
|
return $this; |
|
99
|
|
|
} |
|
100
|
|
|
|
|
101
|
|
|
public function executionIdIn(array $executionIds): HistoricExternalTaskLogQueryInterface |
|
102
|
|
|
{ |
|
103
|
|
|
EnsureUtil::ensureNotNull(NotValidException::class, "activityIds", $executionIds); |
|
104
|
|
|
$executionIdList = CollectionUtil::asArrayList($executionIds); |
|
105
|
|
|
EnsureUtil::ensureNotContainsNull("executionIds", "executionIds", $executionIdList); |
|
106
|
|
|
EnsureUtil::ensureNotContainsEmptyString("executionIds", "executionIds", $executionIdList); |
|
107
|
|
|
$this->executionIds = $executionIds; |
|
108
|
|
|
return $this; |
|
109
|
|
|
} |
|
110
|
|
|
|
|
111
|
|
|
public function processInstanceId(string $processInstanceId): HistoricExternalTaskLogQueryInterface |
|
112
|
|
|
{ |
|
113
|
|
|
EnsureUtil::ensureNotNull(NotValidException::class, "processInstanceId", $processInstanceId); |
|
114
|
|
|
$this->processInstanceId = $processInstanceId; |
|
115
|
|
|
return $this; |
|
116
|
|
|
} |
|
117
|
|
|
|
|
118
|
|
|
public function processDefinitionId(string $processDefinitionId): HistoricExternalTaskLogQueryInterface |
|
119
|
|
|
{ |
|
120
|
|
|
EnsureUtil::ensureNotNull(NotValidException::class, "processDefinitionId", $processDefinitionId); |
|
121
|
|
|
$this->processDefinitionId = $processDefinitionId; |
|
122
|
|
|
return $this; |
|
123
|
|
|
} |
|
124
|
|
|
|
|
125
|
|
|
public function processDefinitionKey(string $processDefinitionKey): HistoricExternalTaskLogQueryInterface |
|
126
|
|
|
{ |
|
127
|
|
|
EnsureUtil::ensureNotNull(NotValidException::class, "processDefinitionKey", $processDefinitionKey); |
|
128
|
|
|
$this->processDefinitionKey = $processDefinitionKey; |
|
129
|
|
|
return $this; |
|
130
|
|
|
} |
|
131
|
|
|
|
|
132
|
|
|
public function tenantIdIn(array $tenantIds): HistoricExternalTaskLogQueryInterface |
|
133
|
|
|
{ |
|
134
|
|
|
EnsureUtil::ensureNotNull("tenantIds", "tenantIds", $tenantIds); |
|
135
|
|
|
$this->tenantIds = $tenantIds; |
|
136
|
|
|
$this->isTenantIdSet = true; |
|
137
|
|
|
return $this; |
|
138
|
|
|
} |
|
139
|
|
|
|
|
140
|
|
|
public function withoutTenantId(): HistoricExternalTaskLogQueryInterface |
|
141
|
|
|
{ |
|
142
|
|
|
$this->tenantIds = null; |
|
143
|
|
|
$this->isTenantIdSet = true; |
|
144
|
|
|
return $this; |
|
145
|
|
|
} |
|
146
|
|
|
|
|
147
|
|
|
public function priorityHigherThanOrEquals(int $priority): HistoricExternalTaskLogQueryInterface |
|
148
|
|
|
{ |
|
149
|
|
|
$this->priorityHigherThanOrEqual = $priority; |
|
150
|
|
|
return $this; |
|
151
|
|
|
} |
|
152
|
|
|
|
|
153
|
|
|
public function priorityLowerThanOrEquals(int $priority): HistoricExternalTaskLogQueryInterface |
|
154
|
|
|
{ |
|
155
|
|
|
$this->priorityLowerThanOrEqual = $priority; |
|
156
|
|
|
return $this; |
|
157
|
|
|
} |
|
158
|
|
|
|
|
159
|
|
|
public function creationLog(): HistoricExternalTaskLogQueryInterface |
|
160
|
|
|
{ |
|
161
|
|
|
$this->setState(ExternalTaskStateImpl::created()); |
|
162
|
|
|
return $this; |
|
163
|
|
|
} |
|
164
|
|
|
|
|
165
|
|
|
public function failureLog(): HistoricExternalTaskLogQueryInterface |
|
166
|
|
|
{ |
|
167
|
|
|
$this->setState(ExternalTaskState::failed()); |
|
|
|
|
|
|
168
|
|
|
return $this; |
|
169
|
|
|
} |
|
170
|
|
|
|
|
171
|
|
|
public function successLog(): HistoricExternalTaskLogQueryInterface |
|
172
|
|
|
{ |
|
173
|
|
|
$this->setState(ExternalTaskState::successful()); |
|
174
|
|
|
return $this; |
|
175
|
|
|
} |
|
176
|
|
|
|
|
177
|
|
|
public function deletionLog(): HistoricExternalTaskLogQueryInterface |
|
178
|
|
|
{ |
|
179
|
|
|
$this->setState(ExternalTaskState::deleted()); |
|
180
|
|
|
return $this; |
|
181
|
|
|
} |
|
182
|
|
|
|
|
183
|
|
|
// order by ////////////////////////////////////////////// |
|
184
|
|
|
|
|
185
|
|
|
public function orderByTimestamp(): HistoricExternalTaskLogQueryInterface |
|
186
|
|
|
{ |
|
187
|
|
|
$this->orderBy(HistoricExternalTaskLogQueryProperty::timestamp()); |
|
188
|
|
|
return $this; |
|
189
|
|
|
} |
|
190
|
|
|
|
|
191
|
|
|
public function orderByExternalTaskId(): HistoricExternalTaskLogQueryInterface |
|
192
|
|
|
{ |
|
193
|
|
|
$this->orderBy(HistoricExternalTaskLogQueryProperty::externalTaskId()); |
|
194
|
|
|
return $this; |
|
195
|
|
|
} |
|
196
|
|
|
|
|
197
|
|
|
public function orderByRetries(): HistoricExternalTaskLogQueryInterface |
|
198
|
|
|
{ |
|
199
|
|
|
$this->orderBy(HistoricExternalTaskLogQueryProperty::retries()); |
|
200
|
|
|
return $this; |
|
201
|
|
|
} |
|
202
|
|
|
|
|
203
|
|
|
public function orderByPriority(): HistoricExternalTaskLogQueryInterface |
|
204
|
|
|
{ |
|
205
|
|
|
$this->orderBy(HistoricExternalTaskLogQueryProperty::priority()); |
|
206
|
|
|
return $this; |
|
207
|
|
|
} |
|
208
|
|
|
|
|
209
|
|
|
public function orderByTopicName(): HistoricExternalTaskLogQueryInterface |
|
210
|
|
|
{ |
|
211
|
|
|
$this->orderBy(HistoricExternalTaskLogQueryProperty::topicName()); |
|
212
|
|
|
return $this; |
|
213
|
|
|
} |
|
214
|
|
|
|
|
215
|
|
|
public function orderByWorkerId(): HistoricExternalTaskLogQueryInterface |
|
216
|
|
|
{ |
|
217
|
|
|
$this->orderBy(HistoricExternalTaskLogQueryProperty::workerId()); |
|
218
|
|
|
return $this; |
|
219
|
|
|
} |
|
220
|
|
|
|
|
221
|
|
|
public function orderByActivityId(): HistoricExternalTaskLogQueryInterface |
|
222
|
|
|
{ |
|
223
|
|
|
$this->orderBy(HistoricExternalTaskLogQueryProperty::activityId()); |
|
224
|
|
|
return $this; |
|
225
|
|
|
} |
|
226
|
|
|
|
|
227
|
|
|
public function orderByActivityInstanceId(): HistoricExternalTaskLogQueryInterface |
|
228
|
|
|
{ |
|
229
|
|
|
$this->orderBy(HistoricExternalTaskLogQueryProperty::activityInstanceId()); |
|
230
|
|
|
return $this; |
|
231
|
|
|
} |
|
232
|
|
|
|
|
233
|
|
|
public function orderByExecutionId(): HistoricExternalTaskLogQueryInterface |
|
234
|
|
|
{ |
|
235
|
|
|
$this->orderBy(HistoricExternalTaskLogQueryProperty::executionId()); |
|
236
|
|
|
return $this; |
|
237
|
|
|
} |
|
238
|
|
|
|
|
239
|
|
|
public function orderByProcessInstanceId(): HistoricExternalTaskLogQueryInterface |
|
240
|
|
|
{ |
|
241
|
|
|
$this->orderBy(HistoricExternalTaskLogQueryProperty::processInstanceId()); |
|
242
|
|
|
return $this; |
|
243
|
|
|
} |
|
244
|
|
|
|
|
245
|
|
|
public function orderByProcessDefinitionId(): HistoricExternalTaskLogQueryInterface |
|
246
|
|
|
{ |
|
247
|
|
|
$this->orderBy(HistoricExternalTaskLogQueryProperty::processDefinitionId()); |
|
248
|
|
|
return $this; |
|
249
|
|
|
} |
|
250
|
|
|
|
|
251
|
|
|
public function orderByProcessDefinitionKey(): HistoricExternalTaskLogQueryInterface |
|
252
|
|
|
{ |
|
253
|
|
|
$this->orderBy(HistoricExternalTaskLogQueryProperty::processDefinitionKey()); |
|
254
|
|
|
return $this; |
|
255
|
|
|
} |
|
256
|
|
|
|
|
257
|
|
|
public function orderByTenantId(): HistoricExternalTaskLogQueryInterface |
|
258
|
|
|
{ |
|
259
|
|
|
$this->orderBy(HistoricExternalTaskLogQueryProperty::tenantId()); |
|
260
|
|
|
return $this; |
|
261
|
|
|
} |
|
262
|
|
|
|
|
263
|
|
|
// results ////////////////////////////////////////////////////////////// |
|
264
|
|
|
|
|
265
|
|
|
public function executeCount(CommandContext $commandContext): int |
|
266
|
|
|
{ |
|
267
|
|
|
$this->checkQueryOk(); |
|
268
|
|
|
return $commandContext |
|
269
|
|
|
->getHistoricExternalTaskLogManager() |
|
270
|
|
|
->findHistoricExternalTaskLogsCountByQueryCriteria($this); |
|
271
|
|
|
} |
|
272
|
|
|
|
|
273
|
|
|
public function executeList(CommandContext $commandContext, Page $page): array |
|
|
|
|
|
|
274
|
|
|
{ |
|
275
|
|
|
$this->checkQueryOk(); |
|
276
|
|
|
return $commandContext |
|
277
|
|
|
->getHistoricExternalTaskLogManager() |
|
278
|
|
|
->findHistoricExternalTaskLogsByQueryCriteria($this, $page); |
|
279
|
|
|
} |
|
280
|
|
|
|
|
281
|
|
|
// getters & setters //////////////////////////////////////////////////////////// |
|
282
|
|
|
|
|
283
|
|
|
protected function setState(ExternalTaskStateInterface $state): void |
|
284
|
|
|
{ |
|
285
|
|
|
$this->state = $state; |
|
286
|
|
|
} |
|
287
|
|
|
|
|
288
|
|
|
public function isTenantIdSet(): bool |
|
289
|
|
|
{ |
|
290
|
|
|
return $this->isTenantIdSet; |
|
291
|
|
|
} |
|
292
|
|
|
} |
|
293
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths