| Total Complexity | 145 |
| Total Lines | 843 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
Complex classes like HistoricProcessInstanceQueryImpl often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use HistoricProcessInstanceQueryImpl, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 25 | class HistoricProcessInstanceQueryImpl extends AbstractVariableQueryImpl implements HistoricProcessInstanceQueryInterface |
||
| 26 | { |
||
| 27 | protected $processInstanceId; |
||
| 28 | protected $processDefinitionId; |
||
| 29 | protected $processDefinitionName; |
||
| 30 | protected $processDefinitionNameLike; |
||
| 31 | protected $businessKey; |
||
| 32 | protected $businessKeyIn = []; |
||
| 33 | protected $businessKeyLike; |
||
| 34 | protected $finished = false; |
||
| 35 | protected $unfinished = false; |
||
| 36 | protected $withIncidents = false; |
||
| 37 | protected $withRootIncidents = false; |
||
| 38 | protected $incidentType; |
||
| 39 | protected $incidentStatus; |
||
| 40 | protected $incidentMessage; |
||
| 41 | protected $incidentMessageLike; |
||
| 42 | protected $startedBy; |
||
| 43 | protected $isRootProcessInstances; |
||
| 44 | protected $superProcessInstanceId; |
||
| 45 | protected $subProcessInstanceId; |
||
| 46 | //protected $superCaseInstanceId; |
||
| 47 | //protected $subCaseInstanceId; |
||
| 48 | protected $processKeyNotIn = []; |
||
| 49 | protected $startedBefore; |
||
| 50 | protected $startedAfter; |
||
| 51 | protected $finishedBefore; |
||
| 52 | protected $finishedAfter; |
||
| 53 | protected $executedActivityAfter; |
||
| 54 | protected $executedActivityBefore; |
||
| 55 | protected $executedJobAfter; |
||
| 56 | protected $executedJobBefore; |
||
| 57 | protected $processDefinitionKey; |
||
| 58 | protected $processDefinitionKeys = []; |
||
| 59 | protected $processInstanceIds = []; |
||
| 60 | protected $tenantIds = []; |
||
| 61 | protected $isTenantIdSet; |
||
| 62 | protected $executedActivityIds = []; |
||
| 63 | protected $activeActivityIds = []; |
||
| 64 | protected $state; |
||
| 65 | protected $caseInstanceId; |
||
| 66 | protected $queries = []; |
||
| 67 | protected $isOrQueryActive = false; |
||
| 68 | protected $queryVariableNameToValuesMap = []; |
||
| 69 | |||
| 70 | public function __construct(CommandExecutorInterface $commandExecutor = null) |
||
| 71 | { |
||
| 72 | parent::__construct($commandExecutor); |
||
| 73 | $this->queries[] = $this; |
||
| 74 | } |
||
| 75 | |||
| 76 | public function processInstanceId(string $processInstanceId): HistoricProcessInstanceQueryImpl |
||
| 77 | { |
||
| 78 | $this->processInstanceId = $processInstanceId; |
||
| 79 | return $this; |
||
| 80 | } |
||
| 81 | |||
| 82 | public function processInstanceIds(array $processInstanceIds): HistoricProcessInstanceQueryInterface |
||
| 83 | { |
||
| 84 | EnsureUtil::ensureNotEmpty("Set of process instance ids", "processInstanceIds", $processInstanceIds); |
||
| 85 | $this->processInstanceIds = $processInstanceIds; |
||
| 86 | return $this; |
||
| 87 | } |
||
| 88 | |||
| 89 | public function processDefinitionId(string $processDefinitionId): HistoricProcessInstanceQueryImpl |
||
| 90 | { |
||
| 91 | $this->processDefinitionId = $processDefinitionId; |
||
| 92 | return $this; |
||
| 93 | } |
||
| 94 | |||
| 95 | public function processDefinitionKey(string $processDefinitionKey): HistoricProcessInstanceQueryInterface |
||
| 96 | { |
||
| 97 | $this->processDefinitionKey = $processDefinitionKey; |
||
| 98 | return $this; |
||
| 99 | } |
||
| 100 | |||
| 101 | public function processDefinitionKeyIn(array $processDefinitionKeys): HistoricProcessInstanceQueryInterface |
||
| 102 | { |
||
| 103 | EnsureUtil::ensureNotNull("processDefinitionKeys", "processDefinitionKeys", $processDefinitionKeys); |
||
| 104 | $this->processDefinitionKeys = $processDefinitionKeys; |
||
| 105 | return $this; |
||
| 106 | } |
||
| 107 | |||
| 108 | public function processDefinitionName(string $processDefinitionName): HistoricProcessInstanceQueryInterface |
||
| 109 | { |
||
| 110 | $this->processDefinitionName = $processDefinitionName; |
||
| 111 | return $this; |
||
| 112 | } |
||
| 113 | |||
| 114 | public function processDefinitionNameLike(string $nameLike): HistoricProcessInstanceQueryInterface |
||
| 115 | { |
||
| 116 | $this->processDefinitionNameLike = $nameLike; |
||
| 117 | return $this; |
||
| 118 | } |
||
| 119 | |||
| 120 | public function processInstanceBusinessKey(string $businessKey): HistoricProcessInstanceQueryInterface |
||
| 121 | { |
||
| 122 | $this->businessKey = $businessKey; |
||
| 123 | return $this; |
||
| 124 | } |
||
| 125 | |||
| 126 | public function processInstanceBusinessKeyIn(array $businessKeyIn): HistoricProcessInstanceQueryInterface |
||
| 127 | { |
||
| 128 | $this->businessKeyIn = $businessKeyIn; |
||
| 129 | return $this; |
||
| 130 | } |
||
| 131 | |||
| 132 | public function processInstanceBusinessKeyLike(string $businessKeyLike): HistoricProcessInstanceQueryInterface |
||
| 133 | { |
||
| 134 | $this->businessKeyLike = $businessKeyLike; |
||
| 135 | return $this; |
||
| 136 | } |
||
| 137 | |||
| 138 | public function finished(): HistoricProcessInstanceQueryInterface |
||
| 139 | { |
||
| 140 | $this->finished = true; |
||
| 141 | return $this; |
||
| 142 | } |
||
| 143 | |||
| 144 | public function unfinished(): HistoricProcessInstanceQueryInterface |
||
| 145 | { |
||
| 146 | $this->unfinished = true; |
||
| 147 | return $this; |
||
| 148 | } |
||
| 149 | |||
| 150 | public function withIncidents(): HistoricProcessInstanceQueryInterface |
||
| 151 | { |
||
| 152 | $this->withIncidents = true; |
||
| 153 | return $this; |
||
| 154 | } |
||
| 155 | |||
| 156 | public function withRootIncidents(): HistoricProcessInstanceQueryInterface |
||
| 157 | { |
||
| 158 | $this->withRootIncidents = true; |
||
| 159 | return $this; |
||
| 160 | } |
||
| 161 | |||
| 162 | public function incidentType(string $incidentType): HistoricProcessInstanceQueryInterface |
||
| 163 | { |
||
| 164 | EnsureUtil::ensureNotNull("incident type", "incidentType", $incidentType); |
||
| 165 | $this->incidentType = $incidentType; |
||
| 166 | return $this; |
||
| 167 | } |
||
| 168 | |||
| 169 | public function incidentStatus(string $status): HistoricProcessInstanceQueryInterface |
||
| 170 | { |
||
| 171 | $this->incidentStatus = $status; |
||
| 172 | return $this; |
||
| 173 | } |
||
| 174 | |||
| 175 | public function incidentMessage(string $incidentMessage): HistoricProcessInstanceQueryInterface |
||
| 176 | { |
||
| 177 | EnsureUtil::ensureNotNull("incidentMessage", "incidentMessage", $incidentMessage); |
||
| 178 | $this->incidentMessage = $incidentMessage; |
||
| 179 | return $this; |
||
| 180 | } |
||
| 181 | |||
| 182 | public function incidentMessageLike(string $incidentMessageLike): HistoricProcessInstanceQueryInterface |
||
| 183 | { |
||
| 184 | EnsureUtil::ensureNotNull("incidentMessageLike", "incidentMessageLike", $incidentMessageLike); |
||
| 185 | $this->incidentMessageLike = $incidentMessageLike; |
||
| 186 | return $this; |
||
| 187 | } |
||
| 188 | |||
| 189 | public function startedBy(string $userId): HistoricProcessInstanceQueryInterface |
||
| 190 | { |
||
| 191 | $this->startedBy = $userId; |
||
| 192 | return $this; |
||
| 193 | } |
||
| 194 | |||
| 195 | public function processDefinitionKeyNotIn(array $processDefinitionKeys): HistoricProcessInstanceQueryInterface |
||
| 196 | { |
||
| 197 | EnsureUtil::ensureNotContainsNull("processDefinitionKeys cannot contain null", "processDefinitionKeys", $processDefinitionKeys); |
||
| 198 | EnsureUtil::ensureNotContainsEmptyString("processDefinitionKey cannot contain empty string", "processDefinitionKeys", $processDefinitionKeys); |
||
| 199 | $this->processKeyNotIn = $processDefinitionKeys; |
||
| 200 | return $this; |
||
| 201 | } |
||
| 202 | |||
| 203 | public function startedAfter(string $date): HistoricProcessInstanceQueryInterface |
||
| 204 | { |
||
| 205 | $this->startedAfter = $date; |
||
| 206 | return $this; |
||
| 207 | } |
||
| 208 | |||
| 209 | public function startedBefore(string $date): HistoricProcessInstanceQueryInterface |
||
| 210 | { |
||
| 211 | $this->startedBefore = $date; |
||
| 212 | return $this; |
||
| 213 | } |
||
| 214 | |||
| 215 | public function finishedAfter(string $date): HistoricProcessInstanceQueryInterface |
||
| 216 | { |
||
| 217 | $this->finishedAfter = $date; |
||
| 218 | $this->finished = true; |
||
| 219 | return $this; |
||
| 220 | } |
||
| 221 | |||
| 222 | public function finishedBefore(string $date): HistoricProcessInstanceQueryInterface |
||
| 223 | { |
||
| 224 | $this->finishedBefore = $date; |
||
| 225 | $this->finished = true; |
||
| 226 | return $this; |
||
| 227 | } |
||
| 228 | |||
| 229 | public function rootProcessInstances(): HistoricProcessInstanceQueryInterface |
||
| 230 | { |
||
| 231 | if ($this->superProcessInstanceId !== null) { |
||
| 232 | throw new BadUserRequestException("Invalid query usage: cannot set both rootProcessInstances and superProcessInstanceId"); |
||
| 233 | } |
||
| 234 | /*if (superCaseInstanceId !== null) { |
||
| 235 | throw new BadUserRequestException("Invalid query usage: cannot set both rootProcessInstances and superCaseInstanceId"); |
||
| 236 | }*/ |
||
| 237 | $this->isRootProcessInstances = true; |
||
| 238 | return $this; |
||
| 239 | } |
||
| 240 | |||
| 241 | public function superProcessInstanceId(string $superProcessInstanceId): HistoricProcessInstanceQueryInterface |
||
| 242 | { |
||
| 243 | if ($this->isRootProcessInstances) { |
||
| 244 | throw new BadUserRequestException("Invalid query usage: cannot set both rootProcessInstances and superProcessInstanceId"); |
||
| 245 | } |
||
| 246 | $this->superProcessInstanceId = $superProcessInstanceId; |
||
| 247 | return $this; |
||
| 248 | } |
||
| 249 | |||
| 250 | public function subProcessInstanceId(string $subProcessInstanceId): HistoricProcessInstanceQueryInterface |
||
| 251 | { |
||
| 252 | $this->subProcessInstanceId = $subProcessInstanceId; |
||
| 253 | return $this; |
||
| 254 | } |
||
| 255 | |||
| 256 | /*public function superCaseInstanceId(string $superCaseInstanceId): HistoricProcessInstanceQueryInterface |
||
| 257 | { |
||
| 258 | if ($this->isRootProcessInstances) { |
||
| 259 | throw new BadUserRequestException("Invalid query usage: cannot set both rootProcessInstances and superCaseInstanceId"); |
||
| 260 | } |
||
| 261 | $this->superCaseInstanceId = superCaseInstanceId; |
||
| 262 | return $this; |
||
| 263 | } |
||
| 264 | |||
| 265 | public HistoricProcessInstanceQueryInterface subCaseInstanceId(string $subCaseInstanceId) { |
||
| 266 | $this->subCaseInstanceId = subCaseInstanceId; |
||
| 267 | return $this; |
||
| 268 | } |
||
| 269 | |||
| 270 | public HistoricProcessInstanceQueryInterface caseInstanceId(string $caseInstanceId) { |
||
| 271 | $this->caseInstanceId = caseInstanceId; |
||
| 272 | return $this; |
||
| 273 | }*/ |
||
| 274 | |||
| 275 | public function tenantIdIn(array $tenantIds): HistoricProcessInstanceQueryInterface |
||
| 276 | { |
||
| 277 | EnsureUtil::ensureNotNull("tenantIds", "tenantIds", $tenantIds); |
||
| 278 | $this->tenantIds = $tenantIds; |
||
| 279 | $this->isTenantIdSet = true; |
||
| 280 | return $this; |
||
| 281 | } |
||
| 282 | |||
| 283 | public function withoutTenantId(): HistoricProcessInstanceQueryInterface |
||
| 284 | { |
||
| 285 | $this->tenantIds = null; |
||
| 286 | $this->isTenantIdSet = true; |
||
| 287 | return $this; |
||
| 288 | } |
||
| 289 | |||
| 290 | protected function hasExcludingConditions(): bool |
||
| 291 | { |
||
| 292 | return parent::hasExcludingConditions() |
||
| 293 | || ($this->finished && $this->unfinished) |
||
| 294 | || CompareUtil::areNotInAscendingOrder($this->startedAfter, $this->startedBefore) |
||
| 295 | || CompareUtil::areNotInAscendingOrder($this->finishedAfter, $this->finishedBefore) |
||
| 296 | || CompareUtil::elementIsContainedInList($this->processDefinitionKey, $this->processKeyNotIn) |
||
| 297 | || CompareUtil::elementIsNotContainedInList($this->processInstanceId, $this->processInstanceIds); |
||
| 298 | } |
||
| 299 | |||
| 300 | public function orderByProcessInstanceBusinessKey(): HistoricProcessInstanceQueryInterface |
||
| 301 | { |
||
| 302 | if ($this->isOrQueryActive) { |
||
| 303 | throw new ProcessEngineException("Invalid query usage: cannot set orderByProcessInstanceBusinessKey() within 'or' query"); |
||
| 304 | } |
||
| 305 | return $this->orderBy(HistoricProcessInstanceQueryProperty::businessKey()); |
||
| 306 | } |
||
| 307 | |||
| 308 | public function orderByProcessInstanceDuration(): HistoricProcessInstanceQueryInterface |
||
| 309 | { |
||
| 310 | if ($this->isOrQueryActive) { |
||
| 311 | throw new ProcessEngineException("Invalid query usage: cannot set orderByProcessInstanceDuration() within 'or' query"); |
||
| 312 | } |
||
| 313 | return $this->orderBy(HistoricProcessInstanceQueryProperty::duration()); |
||
| 314 | } |
||
| 315 | |||
| 316 | public function orderByProcessInstanceStartTime(): HistoricProcessInstanceQueryInterface |
||
| 317 | { |
||
| 318 | if ($this->isOrQueryActive) { |
||
| 319 | throw new ProcessEngineException("Invalid query usage: cannot set orderByProcessInstanceStartTime() within 'or' query"); |
||
| 320 | } |
||
| 321 | return $this->orderBy(HistoricProcessInstanceQueryProperty::startTime()); |
||
| 322 | } |
||
| 323 | |||
| 324 | public function orderByProcessInstanceEndTime(): HistoricProcessInstanceQueryInterface |
||
| 325 | { |
||
| 326 | if ($this->isOrQueryActive) { |
||
| 327 | throw new ProcessEngineException("Invalid query usage: cannot set orderByProcessInstanceEndTime() within 'or' query"); |
||
| 328 | } |
||
| 329 | return $this->orderBy(HistoricProcessInstanceQueryProperty::endTime()); |
||
| 330 | } |
||
| 331 | |||
| 332 | public function orderByProcessDefinitionId(): HistoricProcessInstanceQueryInterface |
||
| 333 | { |
||
| 334 | if ($this->isOrQueryActive) { |
||
| 335 | throw new ProcessEngineException("Invalid query usage: cannot set orderByProcessDefinitionId() within 'or' query"); |
||
| 336 | } |
||
| 337 | return $this->orderBy(HistoricProcessInstanceQueryProperty::processDefinitionId()); |
||
| 338 | } |
||
| 339 | |||
| 340 | public function orderByProcessDefinitionKey(): HistoricProcessInstanceQueryInterface |
||
| 341 | { |
||
| 342 | if ($this->isOrQueryActive) { |
||
| 343 | throw new ProcessEngineException("Invalid query usage: cannot set orderByProcessDefinitionKey() within 'or' query"); |
||
| 344 | } |
||
| 345 | return $this->orderBy(HistoricProcessInstanceQueryProperty::processDefinitionKey()); |
||
| 346 | } |
||
| 347 | |||
| 348 | public function orderByProcessDefinitionName(): HistoricProcessInstanceQueryInterface |
||
| 349 | { |
||
| 350 | if ($this->isOrQueryActive) { |
||
| 351 | throw new ProcessEngineException("Invalid query usage: cannot set orderByProcessDefinitionName() within 'or' query"); |
||
| 352 | } |
||
| 353 | return $this->orderBy(HistoricProcessInstanceQueryProperty::processDefinitionName()); |
||
| 354 | } |
||
| 355 | |||
| 356 | public function orderByProcessDefinitionVersion(): HistoricProcessInstanceQueryInterface |
||
| 357 | { |
||
| 358 | if ($this->isOrQueryActive) { |
||
| 359 | throw new ProcessEngineException("Invalid query usage: cannot set orderByProcessDefinitionVersion() within 'or' query"); |
||
| 360 | } |
||
| 361 | return $this->orderBy(HistoricProcessInstanceQueryProperty::processDefinitionVersion()); |
||
| 362 | } |
||
| 363 | |||
| 364 | public function orderByProcessInstanceId(): HistoricProcessInstanceQueryInterface |
||
| 365 | { |
||
| 366 | if ($this->isOrQueryActive) { |
||
| 367 | throw new ProcessEngineException("Invalid query usage: cannot set orderByProcessInstanceId() within 'or' query"); |
||
| 368 | } |
||
| 369 | return $this->orderBy(HistoricProcessInstanceQueryProperty::processInstanceId()); |
||
| 370 | } |
||
| 371 | |||
| 372 | public function orderByTenantId(): HistoricProcessInstanceQueryInterface |
||
| 373 | { |
||
| 374 | if ($this->isOrQueryActive) { |
||
| 375 | throw new ProcessEngineException("Invalid query usage: cannot set orderByTenantId() within 'or' query"); |
||
| 376 | } |
||
| 377 | return $this->orderBy(HistoricProcessInstanceQueryProperty::tenantId()); |
||
| 378 | } |
||
| 379 | |||
| 380 | public function executeCount(CommandContext $commandContext): int |
||
| 381 | { |
||
| 382 | $this->checkQueryOk(); |
||
| 383 | EnsureUtil::ensureVariablesInitialized(); |
||
|
|
|||
| 384 | return $commandContext |
||
| 385 | ->getHistoricProcessInstanceManager() |
||
| 386 | ->findHistoricProcessInstanceCountByQueryCriteria($this); |
||
| 387 | } |
||
| 388 | |||
| 389 | public function executeList(CommandContext $commandContext, Page $page): array |
||
| 390 | { |
||
| 391 | $this->checkQueryOk(); |
||
| 392 | EnsureUtil::ensureVariablesInitialized(); |
||
| 393 | return $commandContext |
||
| 394 | ->getHistoricProcessInstanceManager() |
||
| 395 | ->findHistoricProcessInstancesByQueryCriteria($this, $page); |
||
| 396 | } |
||
| 397 | |||
| 398 | public function executeIdsList(CommandContext $commandContext): array |
||
| 399 | { |
||
| 400 | $this->checkQueryOk(); |
||
| 401 | EnsureUtil::ensureVariablesInitialized(); |
||
| 402 | return $commandContext |
||
| 403 | ->getHistoricProcessInstanceManager() |
||
| 404 | ->findHistoricProcessInstanceIds($this); |
||
| 405 | } |
||
| 406 | |||
| 407 | public function executeDeploymentIdMappingsList(CommandContext $commandContext): array |
||
| 408 | { |
||
| 409 | $this->checkQueryOk(); |
||
| 410 | EnsureUtil::ensureVariablesInitialized(); |
||
| 411 | return $commandContext |
||
| 412 | ->getHistoricProcessInstanceManager() |
||
| 413 | ->findDeploymentIdMappingsByQueryCriteria($this); |
||
| 414 | } |
||
| 415 | |||
| 416 | public function getQueryVariableValues(): array |
||
| 417 | { |
||
| 418 | return array_values($this->queryVariableNameToValuesMap); |
||
| 419 | } |
||
| 420 | |||
| 421 | public function getQueryVariableNameToValuesMap(): array |
||
| 422 | { |
||
| 423 | return $this->queryVariableNameToValuesMap; |
||
| 424 | } |
||
| 425 | |||
| 426 | protected function ensureVariablesInitialized(): void |
||
| 427 | { |
||
| 428 | parent::ensureVariablesInitialized(); |
||
| 429 | |||
| 430 | if (!empty($this->queries)) { |
||
| 431 | $processEngineConfiguration = Context::getProcessEngineConfiguration(); |
||
| 432 | $variableSerializers = $processEngineConfiguration->getVariableSerializers(); |
||
| 433 | $dbType = $processEngineConfiguration->getDatabaseType(); |
||
| 434 | |||
| 435 | foreach ($this->queries as $orQuery) { |
||
| 436 | foreach ($orQuery->getQueryVariableValues() as $var) { |
||
| 437 | $var->initialize($variableSerializers, $dbType); |
||
| 438 | } |
||
| 439 | } |
||
| 440 | } |
||
| 441 | } |
||
| 442 | |||
| 443 | protected function addVariable(string $name, $value, string $operator, bool $processInstanceScope): void |
||
| 444 | { |
||
| 445 | $queryVariableValue = $this->createQueryVariableValue($name, $value, $operator, $processInstanceScope); |
||
| 446 | if (!array_key_exists($name, $this->queryVariableNameToValuesMap)) { |
||
| 447 | $this->queryVariableNameToValuesMap[$name] = [$queryVariableValue]; |
||
| 448 | } else { |
||
| 449 | $this->queryVariableNameToValuesMap[$name][] = $queryVariableValue; |
||
| 450 | } |
||
| 451 | } |
||
| 452 | |||
| 453 | public function getQueries(): array |
||
| 454 | { |
||
| 455 | return $this->queries; |
||
| 456 | } |
||
| 457 | |||
| 458 | public function addOrQuery(HistoricProcessInstanceQueryImpl $orQuery): void |
||
| 459 | { |
||
| 460 | $orQuery->isOrQueryActive = true; |
||
| 461 | $this->queries[] = $orQuery; |
||
| 462 | } |
||
| 463 | |||
| 464 | public function setOrQueryActive(): void |
||
| 465 | { |
||
| 466 | $this->isOrQueryActive = true; |
||
| 467 | } |
||
| 468 | |||
| 469 | public function isOrQueryActive(): bool |
||
| 470 | { |
||
| 471 | return $this->isOrQueryActive; |
||
| 472 | } |
||
| 473 | |||
| 474 | public function getActiveActivityIds(): array |
||
| 475 | { |
||
| 476 | return $this->activeActivityIds; |
||
| 477 | } |
||
| 478 | |||
| 479 | public function getBusinessKey(): string |
||
| 480 | { |
||
| 481 | return $this->businessKey; |
||
| 482 | } |
||
| 483 | |||
| 484 | public function getBusinessKeyIn(): array |
||
| 485 | { |
||
| 486 | return $this->businessKeyIn; |
||
| 487 | } |
||
| 488 | |||
| 489 | public function getBusinessKeyLike(): string |
||
| 490 | { |
||
| 491 | return $this->businessKeyLike; |
||
| 492 | } |
||
| 493 | |||
| 494 | public function getExecutedActivityIds(): array |
||
| 495 | { |
||
| 496 | return $this->executedActivityIds; |
||
| 497 | } |
||
| 498 | |||
| 499 | public function getExecutedActivityAfter(): string |
||
| 500 | { |
||
| 501 | return $this->executedActivityAfter; |
||
| 502 | } |
||
| 503 | |||
| 504 | public function getExecutedActivityBefore(): string |
||
| 505 | { |
||
| 506 | return $this->executedActivityBefore; |
||
| 507 | } |
||
| 508 | |||
| 509 | public function getExecutedJobAfter(): string |
||
| 510 | { |
||
| 511 | return $this->executedJobAfter; |
||
| 512 | } |
||
| 513 | |||
| 514 | public function getExecutedJobBefore(): string |
||
| 515 | { |
||
| 516 | return $this->executedJobBefore; |
||
| 517 | } |
||
| 518 | |||
| 519 | public function isOpen(): bool |
||
| 520 | { |
||
| 521 | return $this->unfinished; |
||
| 522 | } |
||
| 523 | |||
| 524 | public function isUnfinished(): bool |
||
| 525 | { |
||
| 526 | return $this->unfinished; |
||
| 527 | } |
||
| 528 | |||
| 529 | public function isFinished(): bool |
||
| 530 | { |
||
| 531 | return $this->finished; |
||
| 532 | } |
||
| 533 | |||
| 534 | public function getProcessDefinitionId(): string |
||
| 535 | { |
||
| 536 | return $this->processDefinitionId; |
||
| 537 | } |
||
| 538 | |||
| 539 | public function getProcessDefinitionKey(): string |
||
| 540 | { |
||
| 541 | return $this->processDefinitionKey; |
||
| 542 | } |
||
| 543 | |||
| 544 | public function getProcessDefinitionKeys(): array |
||
| 545 | { |
||
| 546 | return $this->processDefinitionKeys; |
||
| 547 | } |
||
| 548 | |||
| 549 | public function getProcessDefinitionIdLike(): string |
||
| 550 | { |
||
| 551 | return $this->processDefinitionKey . ":%:%"; |
||
| 552 | } |
||
| 553 | |||
| 554 | public function getProcessDefinitionName(): string |
||
| 555 | { |
||
| 556 | return $this->processDefinitionName; |
||
| 557 | } |
||
| 558 | |||
| 559 | public function getProcessDefinitionNameLike(): string |
||
| 560 | { |
||
| 561 | return $this->processDefinitionNameLike; |
||
| 562 | } |
||
| 563 | |||
| 564 | public function getProcessInstanceId(): string |
||
| 565 | { |
||
| 566 | return $this->processInstanceId; |
||
| 567 | } |
||
| 568 | |||
| 569 | public function getProcessInstanceIds(): array |
||
| 570 | { |
||
| 571 | return $this->processInstanceIds; |
||
| 572 | } |
||
| 573 | |||
| 574 | public function getStartedBy(): string |
||
| 575 | { |
||
| 576 | return $this->startedBy; |
||
| 577 | } |
||
| 578 | |||
| 579 | public function getSuperProcessInstanceId(): string |
||
| 580 | { |
||
| 581 | return $this->superProcessInstanceId; |
||
| 582 | } |
||
| 583 | |||
| 584 | public function setSuperProcessInstanceId(string $superProcessInstanceId): void |
||
| 585 | { |
||
| 586 | $this->superProcessInstanceId = $superProcessInstanceId; |
||
| 587 | } |
||
| 588 | |||
| 589 | public function getProcessKeyNotIn(): array |
||
| 590 | { |
||
| 591 | return $this->processKeyNotIn; |
||
| 592 | } |
||
| 593 | |||
| 594 | public function getStartedAfter(): string |
||
| 595 | { |
||
| 596 | return $this->startedAfter; |
||
| 597 | } |
||
| 598 | |||
| 599 | public function getStartedBefore(): string |
||
| 600 | { |
||
| 601 | return $this->startedBefore; |
||
| 602 | } |
||
| 603 | |||
| 604 | public function getFinishedAfter(): string |
||
| 605 | { |
||
| 606 | return $this->finishedAfter; |
||
| 607 | } |
||
| 608 | |||
| 609 | public function getFinishedBefore(): string |
||
| 610 | { |
||
| 611 | return $this->finishedBefore; |
||
| 612 | } |
||
| 613 | |||
| 614 | /*public String getCaseInstanceId() { |
||
| 615 | return caseInstanceId; |
||
| 616 | }*/ |
||
| 617 | |||
| 618 | public function getIncidentType(): string |
||
| 619 | { |
||
| 620 | return $this->incidentType; |
||
| 621 | } |
||
| 622 | |||
| 623 | public function getIncidentMessage(): string |
||
| 624 | { |
||
| 625 | return $this->incidentMessage; |
||
| 626 | } |
||
| 627 | |||
| 628 | public function getIncidentMessageLike(): string |
||
| 629 | { |
||
| 630 | return $this->incidentMessageLike; |
||
| 631 | } |
||
| 632 | |||
| 633 | public function getIncidentStatus(): string |
||
| 634 | { |
||
| 635 | return $this->incidentStatus; |
||
| 636 | } |
||
| 637 | |||
| 638 | public function getState(): string |
||
| 639 | { |
||
| 640 | return $this->state; |
||
| 641 | } |
||
| 642 | |||
| 643 | public function getFinishDateBy(): string |
||
| 644 | { |
||
| 645 | return $this->finishDateBy; |
||
| 646 | } |
||
| 647 | |||
| 648 | public function getStartDateBy(): string |
||
| 649 | { |
||
| 650 | return $this->startDateBy; |
||
| 651 | } |
||
| 652 | |||
| 653 | public function getStartDateOn(): string |
||
| 654 | { |
||
| 655 | return $this->startDateOn; |
||
| 656 | } |
||
| 657 | |||
| 658 | public function getStartDateOnBegin(): string |
||
| 659 | { |
||
| 660 | return $this->startDateOnBegin; |
||
| 661 | } |
||
| 662 | |||
| 663 | public function getStartDateOnEnd(): string |
||
| 664 | { |
||
| 665 | return $this->startDateOnEnd; |
||
| 666 | } |
||
| 667 | |||
| 668 | public function getFinishDateOn(): string |
||
| 669 | { |
||
| 670 | return $this->finishDateOn; |
||
| 671 | } |
||
| 672 | |||
| 673 | public function getFinishDateOnBegin(): string |
||
| 674 | { |
||
| 675 | return $this->finishDateOnBegin; |
||
| 676 | } |
||
| 677 | |||
| 678 | public function getFinishDateOnEnd(): string |
||
| 679 | { |
||
| 680 | return $this->finishDateOnEnd; |
||
| 681 | } |
||
| 682 | |||
| 683 | public function isTenantIdSet(): bool |
||
| 684 | { |
||
| 685 | return $this->isTenantIdSet; |
||
| 686 | } |
||
| 687 | |||
| 688 | public function getIsTenantIdSet(): bool |
||
| 689 | { |
||
| 690 | return $this->isTenantIdSet; |
||
| 691 | } |
||
| 692 | |||
| 693 | public function isWithIncidents(): bool |
||
| 696 | } |
||
| 697 | |||
| 698 | public function isWithRootIncidents(): bool |
||
| 699 | { |
||
| 700 | return $this->withRootIncidents; |
||
| 701 | } |
||
| 702 | |||
| 703 | protected $startDateBy; |
||
| 704 | protected $startDateOn; |
||
| 705 | protected $finishDateBy; |
||
| 706 | protected $finishDateOn; |
||
| 707 | protected $startDateOnBegin; |
||
| 708 | protected $startDateOnEnd; |
||
| 709 | protected $finishDateOnBegin; |
||
| 710 | protected $finishDateOnEnd; |
||
| 711 | |||
| 712 | public function startDateBy(string $date): HistoricProcessInstanceQueryInterface |
||
| 713 | { |
||
| 714 | $this->startDateBy = $this->calculateMidnight($date); |
||
| 715 | return $this; |
||
| 716 | } |
||
| 717 | |||
| 718 | public function startDateOn(string $date): HistoricProcessInstanceQueryInterface |
||
| 719 | { |
||
| 720 | $this->startDateOn = $date; |
||
| 721 | $this->startDateOnBegin = $this->calculateMidnight($date); |
||
| 722 | $this->startDateOnEnd = $this->calculateBeforeMidnight($date); |
||
| 723 | return $this; |
||
| 724 | } |
||
| 725 | |||
| 726 | public function finishDateBy(string $date): HistoricProcessInstanceQueryInterface |
||
| 727 | { |
||
| 728 | $this->finishDateBy = $this->calculateBeforeMidnight($date); |
||
| 729 | return $this; |
||
| 730 | } |
||
| 731 | |||
| 732 | public function finishDateOn(string $date): HistoricProcessInstanceQueryInterface |
||
| 733 | { |
||
| 734 | $this->finishDateOn = $date; |
||
| 735 | $this->finishDateOnBegin = $this->calculateMidnight($date); |
||
| 736 | $this->finishDateOnEnd = $this->calculateBeforeMidnight($date); |
||
| 737 | return $this; |
||
| 738 | } |
||
| 739 | |||
| 740 | private function calculateBeforeMidnight(string $date): string |
||
| 741 | { |
||
| 742 | return (new \DateTime())->setTimestamp(strtotime("+1 day -1 second", strtotime($date)))->format('c'); |
||
| 743 | } |
||
| 744 | |||
| 745 | private function calculateMidnight(string $date): string |
||
| 746 | { |
||
| 747 | $date = new \DateTime($date); |
||
| 748 | $date->setTime(0, 0, 0, 0); |
||
| 749 | return $date->format('c'); |
||
| 750 | } |
||
| 751 | |||
| 752 | public function isRootProcessInstances(): bool |
||
| 755 | } |
||
| 756 | |||
| 757 | public function getSubProcessInstanceId(): string |
||
| 758 | { |
||
| 759 | return $this->subProcessInstanceId; |
||
| 760 | } |
||
| 761 | |||
| 762 | /*public String getSuperCaseInstanceId() { |
||
| 763 | return superCaseInstanceId; |
||
| 764 | } |
||
| 765 | |||
| 766 | public String getSubCaseInstanceId() { |
||
| 767 | return subCaseInstanceId; |
||
| 768 | }*/ |
||
| 769 | |||
| 770 | public function getTenantIds(): array |
||
| 771 | { |
||
| 772 | return $this->tenantIds; |
||
| 773 | } |
||
| 774 | |||
| 775 | public function executedActivityAfter(string $date): HistoricProcessInstanceQueryInterface |
||
| 776 | { |
||
| 777 | $this->executedActivityAfter = $date; |
||
| 778 | return $this; |
||
| 779 | } |
||
| 780 | |||
| 781 | public function executedActivityBefore(string $date): HistoricProcessInstanceQueryInterface |
||
| 782 | { |
||
| 783 | $this->executedActivityBefore = $date; |
||
| 784 | return $this; |
||
| 785 | } |
||
| 786 | |||
| 787 | public function executedJobAfter(string $date): HistoricProcessInstanceQueryInterface |
||
| 788 | { |
||
| 789 | $this->executedJobAfter = $date; |
||
| 790 | return $this; |
||
| 791 | } |
||
| 792 | |||
| 793 | public function executedJobBefore(string $date): HistoricProcessInstanceQueryInterface |
||
| 797 | } |
||
| 798 | |||
| 799 | public function executedActivityIdIn(array $ids): HistoricProcessInstanceQueryInterface |
||
| 800 | { |
||
| 801 | EnsureUtil::ensureNotNull("activity ids", "ids", $ids); |
||
| 802 | EnsureUtil::ensureNotContainsNull("ids cannot contain null", "ids", $ids); |
||
| 803 | $this->executedActivityIds = $ids; |
||
| 804 | return $this; |
||
| 805 | } |
||
| 806 | |||
| 807 | public function activeActivityIdIn(array $ids): HistoricProcessInstanceQueryInterface |
||
| 808 | { |
||
| 809 | EnsureUtil::ensureNotNull("activity ids", "ids", $ids); |
||
| 810 | EnsureUtil::ensureNotContainsNull("ids cannot contain null", "ids", $ids); |
||
| 811 | $this->activeActivityIds = $ids; |
||
| 812 | return $this; |
||
| 813 | } |
||
| 814 | |||
| 815 | public function active(): HistoricProcessInstanceQueryInterface |
||
| 816 | { |
||
| 817 | EnsureUtil::ensureNull("Already querying for historic process instance with another state", "state", $this->state); |
||
| 818 | $state = HistoricProcessInstanceInterface::STATE_ACTIVE; |
||
| 819 | return $this; |
||
| 820 | } |
||
| 821 | |||
| 822 | public function suspended(): HistoricProcessInstanceQueryInterface |
||
| 823 | { |
||
| 824 | EnsureUtil::ensureNull("Already querying for historic process instance with another state", "state", $this->state); |
||
| 825 | $this->state = HistoricProcessInstanceInterface::STATE_SUSPENDED; |
||
| 826 | return $this; |
||
| 827 | } |
||
| 828 | |||
| 829 | public function completed(): HistoricProcessInstanceQueryInterface |
||
| 830 | { |
||
| 831 | EnsureUtil::ensureNull("Already querying for historic process instance with another state", "state", $this->state); |
||
| 832 | $this->state = HistoricProcessInstanceInterface::STATE_COMPLETED; |
||
| 833 | return $this; |
||
| 834 | } |
||
| 835 | |||
| 836 | public function externallyTerminated(): HistoricProcessInstanceQueryInterface |
||
| 837 | { |
||
| 838 | EnsureUtil::ensureNull("Already querying for historic process instance with another state", "state", $this->state); |
||
| 839 | $this->state = HistoricProcessInstanceInterface::STATE_EXTERNALLY_TERMINATED; |
||
| 840 | return $this; |
||
| 841 | } |
||
| 842 | |||
| 843 | public function internallyTerminated(): HistoricProcessInstanceQueryInterface |
||
| 844 | { |
||
| 845 | EnsureUtil::ensureNull("Already querying for historic process instance with another state", "state", $this->state); |
||
| 846 | $this->state = HistoricProcessInstanceInterface::STATE_INTERNALLY_TERMINATED; |
||
| 847 | return $this; |
||
| 848 | } |
||
| 849 | |||
| 850 | public function or(): HistoricProcessInstanceQueryInterface |
||
| 851 | { |
||
| 852 | if ($this != $this->queries[0]) { |
||
| 853 | throw new ProcessEngineException("Invalid query usage: cannot set or() within 'or' query"); |
||
| 854 | } |
||
| 855 | $orQuery = new HistoricProcessInstanceQueryImpl(); |
||
| 856 | $orQuery->isOrQueryActive = true; |
||
| 857 | $orQuery->queries = $this->queries; |
||
| 858 | $this->queries[] = $orQuery; |
||
| 859 | return $orQuery; |
||
| 860 | } |
||
| 861 | |||
| 862 | public function endOr(): HistoricProcessInstanceQueryInterface |
||
| 868 | } |
||
| 869 | } |
||
| 870 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.