|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Jabe\Engine\Impl; |
|
4
|
|
|
|
|
5
|
|
|
use Jabe\Engine\ProcessEngineConfiguration; |
|
6
|
|
|
use Jabe\Engine\Exception\NotValidException; |
|
7
|
|
|
use Jabe\Engine\History\{ |
|
8
|
|
|
CleanableHistoricProcessInstanceReportInterface, |
|
9
|
|
|
CleanableHistoricProcessInstanceReportResultInterface |
|
10
|
|
|
}; |
|
11
|
|
|
use Jabe\Engine\Impl\Interceptor\{ |
|
12
|
|
|
CommandContext, |
|
13
|
|
|
CommandExecutorInterface |
|
14
|
|
|
}; |
|
15
|
|
|
use Jabe\Engine\Impl\Util\EnsureUtil; |
|
|
|
|
|
|
16
|
|
|
|
|
17
|
|
|
class CleanableHistoricProcessInstanceReportImpl extends AbstractQuery implements CleanableHistoricProcessInstanceReportInterface |
|
18
|
|
|
{ |
|
19
|
|
|
protected $processDefinitionIdIn = []; |
|
20
|
|
|
protected $processDefinitionKeyIn = []; |
|
21
|
|
|
protected $tenantIdIn = []; |
|
22
|
|
|
protected $isTenantIdSet = false; |
|
23
|
|
|
protected $isCompact = false; |
|
24
|
|
|
|
|
25
|
|
|
protected $currentTimestamp; |
|
26
|
|
|
|
|
27
|
|
|
protected $isHistoryCleanupStrategyRemovalTimeBased; |
|
28
|
|
|
|
|
29
|
|
|
public function __construct(CommandExecutorInterface $commandExecutor) |
|
30
|
|
|
{ |
|
31
|
|
|
parent::__construct($commandExecutor); |
|
32
|
|
|
} |
|
33
|
|
|
|
|
34
|
|
|
public function processDefinitionIdIn(array $processDefinitionIds): CleanableHistoricProcessInstanceReportInterface |
|
35
|
|
|
{ |
|
36
|
|
|
EnsureUtil::ensureNotNull(NotValidException::class, "processDefinitionIdIn", $processDefinitionIds); |
|
37
|
|
|
$this->processDefinitionIdIn = $processDefinitionIds; |
|
38
|
|
|
return $this; |
|
39
|
|
|
} |
|
40
|
|
|
|
|
41
|
|
|
public function processDefinitionKeyIn(array $processDefinitionKeys): CleanableHistoricProcessInstanceReportInterface |
|
42
|
|
|
{ |
|
43
|
|
|
EnsureUtil::ensureNotNull(NotValidException::class, "processDefinitionKeyIn", $processDefinitionKeys); |
|
44
|
|
|
$this->processDefinitionKeyIn = $processDefinitionKeys; |
|
45
|
|
|
return $this; |
|
46
|
|
|
} |
|
47
|
|
|
|
|
48
|
|
|
public function tenantIdIn(array $tenantIds): CleanableHistoricProcessInstanceReportInterface |
|
49
|
|
|
{ |
|
50
|
|
|
EnsureUtil::ensureNotNull(NotValidException::class, "tenantIdIn", $tenantIds); |
|
51
|
|
|
$this->tenantIdIn = $tenantIds; |
|
52
|
|
|
$this->isTenantIdSet = true; |
|
53
|
|
|
return $this; |
|
54
|
|
|
} |
|
55
|
|
|
|
|
56
|
|
|
public function withoutTenantId(): CleanableHistoricProcessInstanceReportInterface |
|
57
|
|
|
{ |
|
58
|
|
|
$this->tenantIdIn = null; |
|
59
|
|
|
$this->isTenantIdSet = true; |
|
60
|
|
|
return $this; |
|
61
|
|
|
} |
|
62
|
|
|
|
|
63
|
|
|
public function compact(): CleanableHistoricProcessInstanceReportInterface |
|
64
|
|
|
{ |
|
65
|
|
|
$this->isCompact = true; |
|
66
|
|
|
return $this; |
|
67
|
|
|
} |
|
68
|
|
|
|
|
69
|
|
|
public function orderByFinished(): CleanableHistoricProcessInstanceReportInterface |
|
70
|
|
|
{ |
|
71
|
|
|
$this->orderBy(CleanableHistoricInstanceReportProperty::finishedAmount()); |
|
|
|
|
|
|
72
|
|
|
return $this; |
|
73
|
|
|
} |
|
74
|
|
|
|
|
75
|
|
|
public function executeCount(CommandContext $commandContext): int |
|
76
|
|
|
{ |
|
77
|
|
|
$this->provideHistoryCleanupStrategy($commandContext); |
|
78
|
|
|
$this->checkQueryOk(); |
|
79
|
|
|
return $commandContext |
|
80
|
|
|
->getHistoricProcessInstanceManager() |
|
81
|
|
|
->findCleanableHistoricProcessInstancesReportCountByCriteria($this); |
|
82
|
|
|
} |
|
83
|
|
|
|
|
84
|
|
|
public function executeList(CommandContext $commandContext, Page $page): array |
|
|
|
|
|
|
85
|
|
|
{ |
|
86
|
|
|
$this->provideHistoryCleanupStrategy($commandContext); |
|
87
|
|
|
$this->checkQueryOk(); |
|
88
|
|
|
return $commandContext |
|
89
|
|
|
->getHistoricProcessInstanceManager() |
|
90
|
|
|
->findCleanableHistoricProcessInstancesReportByCriteria($this, $page); |
|
91
|
|
|
} |
|
92
|
|
|
|
|
93
|
|
|
public function getCurrentTimestamp(): string |
|
94
|
|
|
{ |
|
95
|
|
|
return $this->currentTimestamp; |
|
96
|
|
|
} |
|
97
|
|
|
|
|
98
|
|
|
public function setCurrentTimestamp(atring $currentTimestamp): void |
|
|
|
|
|
|
99
|
|
|
{ |
|
100
|
|
|
$this->currentTimestamp = $currentTimestamp; |
|
101
|
|
|
} |
|
102
|
|
|
|
|
103
|
|
|
public function getProcessDefinitionIdIn(): array |
|
104
|
|
|
{ |
|
105
|
|
|
return $this->processDefinitionIdIn; |
|
106
|
|
|
} |
|
107
|
|
|
|
|
108
|
|
|
public function getProcessDefinitionKeyIn(): array |
|
109
|
|
|
{ |
|
110
|
|
|
return $this->processDefinitionKeyIn; |
|
111
|
|
|
} |
|
112
|
|
|
|
|
113
|
|
|
public function getTenantIdIn(): array |
|
114
|
|
|
{ |
|
115
|
|
|
return $this->tenantIdIn; |
|
116
|
|
|
} |
|
117
|
|
|
|
|
118
|
|
|
public function setTenantIdIn(array $tenantIdIn): void |
|
119
|
|
|
{ |
|
120
|
|
|
$this->tenantIdIn = $tenantIdIn; |
|
121
|
|
|
} |
|
122
|
|
|
|
|
123
|
|
|
public function isTenantIdSet(): bool |
|
124
|
|
|
{ |
|
125
|
|
|
return $this->isTenantIdSet; |
|
126
|
|
|
} |
|
127
|
|
|
|
|
128
|
|
|
public function isCompact(): bool |
|
129
|
|
|
{ |
|
130
|
|
|
return $this->isCompact; |
|
131
|
|
|
} |
|
132
|
|
|
|
|
133
|
|
|
protected function provideHistoryCleanupStrategy(CommandContext $commandContext): void |
|
134
|
|
|
{ |
|
135
|
|
|
$historyCleanupStrategy = $commandContext->getProcessEngineConfiguration() |
|
136
|
|
|
->getHistoryCleanupStrategy(); |
|
|
|
|
|
|
137
|
|
|
$this->isHistoryCleanupStrategyRemovalTimeBased = ProcessEngineConfiguration::HISTORY_CLEANUP_STRATEGY_REMOVAL_TIME_BASED == $historyCleanupStrategy; |
|
138
|
|
|
} |
|
139
|
|
|
|
|
140
|
|
|
public function isHistoryCleanupStrategyRemovalTimeBased(): bool |
|
141
|
|
|
{ |
|
142
|
|
|
return $this->isHistoryCleanupStrategyRemovalTimeBased; |
|
143
|
|
|
} |
|
144
|
|
|
} |
|
145
|
|
|
|
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